Help with Chirp FFT
조회 수: 28 (최근 30일)
이전 댓글 표시
I am trying to make a fft for a chirp signal with a frequency range of 15-25 MHz over a period of 10 micro seconds. When I attempt to plot the power vs. the frequency, I end up with a "square"-like wave from 15 MHz to 25 MHz and another one from 25 MHz to 35 MHz. I only need to generate the one wave that is from 15-25 MHz. Please find attached the plot and I have included the code below:
SPF=50e6;
frames = 16;
nfft = SPF/frames;
f_max = 25e6;
f_min = 15e6;
start_time=2e-6;
end_time=12e-6;
d_chirp = 10e-6;
Fs=2*f_max;
hchirp = dsp.Chirp('InitialFrequency',f_min,'TargetFrequency',f_max,...
'TargetTime', d_chirp,'SweepTime', d_chirp, 'SampleRate', SPF, 'SamplesPerFrame', nfft);
chirpData = (step(hchirp))';
freq_chirp=fft(chirpData,nfft);
power=abs(freq_chirp);
freq =(0:nfft-1)*Fs/nfft;
figure();
plot(freq,power);
xlabel('Frequency (Hz)');
ylabel('Power');
xlim([0 50e6]);
댓글 수: 1
Hieu Nguyen
2019년 11월 21일
I have the same problem; the bandwidth seems to double its length. Also, sweeping up and down have different results
답변 (1개)
Daniel M
2019년 11월 21일
You are plotting the incorrect frequency vector. fft() does not return the frequencies in order from most negative to most positive. Follow the example in the documentation for more information.
Change your freq and power vectors to:
freq2 = (0:(nfft-1)/2)*Fs/nfft;
power2 = power(1:(nfft/2));
Also note that this isn't typically what is considered the power. This is just the energy. Power is energy squared. You would also have to divide by nfft to scale properly.
댓글 수: 1
Daniel M
2019년 11월 21일
I also recommend increasing your sampling rate because it is not sufficient to fully represent this signal. At least 60 MHz should be OK.
참고 항목
카테고리
Help Center 및 File Exchange에서 Fourier Analysis and Filtering에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!