Octave - 由IQ数据计算功率谱


load "C:\\Users\\guest\\Desktop\\Octave\\IQ_Data.csv";
I_data = C__Users_guest_Desktop_Octave_IQ_Data(:,1);
Q_data = C__Users_guest_Desktop_Octave_IQ_Data(:,2);

# 采样率307200
sampling_rate = 307200
num_samples = length(I_data);
delta_t = 1/sampling_rate;

t = 0 : delta_t : delta_t*(num_samples - 1);

subplot(2,1,1);
power = sqrt(I_data.*I_data + Q_data.*Q_data);
plot(t, power);
xlabel("Time(s)");
ylabel("Power");

subplot(2,1,2);
z = I_data + j * Q_data;
fft_result = fft(z);
delta_f = sampling_rate/num_samples;
f = 0 : delta_f : delta_f * (num_samples - 1);
plot(f(1:length(f)/2), abs(fft_result)(1:length(f)/2));
xlabel("Frequency(Hz)");
ylabel("Power Spectrum");

 

上一篇:无监督学习


下一篇:使用树状图做层次聚类分析