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 Comment
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/463554-help-with-chirp-fft#comment_769956
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/463554-help-with-chirp-fft#comment_769956
Sign in to comment.