How to change frequency range doubling of Complex-valued Chirp Signal Spectrogram to match the Real-Valued Chirp Spectrogram
2 次查看(过去 30 天)
显示 更早的评论
When real-valued linear chirp is plotted in spectrogram, the frequency range is limited to the Nyquist rate frequency range.
However, when complex-valued linar chirp with the same parameters is plotted, the frequency range of the spectrogram doubles. Is there an option to limit the frequeny range to the Nyquist rate?
%%%% Sample Code %%%%
Fs=2E3; %sampling rate
f0=0; %initial frequency offset = 0
f1=0.5E3; %LFM sweeping frequency
t1=0.5;
t=0:1/Fs:t1;
%
%Real Valued Chirp
%
yr=chirp(t,f0,t1,f1,'real');
figure
spectrogram(yr,[],256,512,Fs,'yaxis');
title('UP Chirp-Real in Time-Freq ')
%
%Complex Valued Chirp
%
yc=chirp(t,f0,t1,f1,'complex');
figure
spectrogram(yc,[],256,512,Fs,'yaxis');
title('UP Chirp-Complex in Time-Freq ')
0 个评论
采纳的回答
Paul
2024-5-2
编辑:Paul
2024-5-2
Fs=2E3; %sampling rate
f0=0; %initial frequency offset = 0
f1=0.5E3; %LFM sweeping frequency
t1=0.5;
t=0:1/Fs:t1;
%
%Real Valued Chirp
%
yr=chirp(t,f0,t1,f1,'real');
figure
spectrogram(yr,[],256,512,Fs,'yaxis');
title('UP Chirp-Real in Time-Freq ')
%
%Complex Valued Chirp
%
yc=chirp(t,f0,t1,f1,'complex');
figure
spectrogram(yc,[],256,512,Fs,'yaxis');
title('UP Chirp-Complex in Time-Freq ')
ylim([0 1])
Or return the output arguments from spectrogram and then make the plot over whatever frequency range is desired.
But keep in mind that for complex signals the fully frequency range is typically required, i.e., there is no symmetry in the frequency domain as there would be for a real-valued signal.
4 个评论
Paul
2024-5-2
"The ylim command did not work,"
ylim worked exactly as advertised. It limited the range of the y-axis to be between 0 and 1 (kHz, which is Fs/2), just like spectrogram did itself for the real input.
According to spectrogram, the default freqrange for a real signal is 'onesided', which is what we see above, i.e., the frequency range goes from 0 -> Fs/2. But, becasuse the spectrum of a complex signal is not symmetric, the default freqrange for a complex signal is 'twosided', i.e., the frequency range covers 0 -> Fs. Or we can specify 'centered' to have the frequency range cover -Fs/2 -> Fs/2. According to that doc page, specifying 'onesided' as the freqrange for a complex input signal results in an error, which is why ylim is needed if you really want to limit the plot for the complex input to 0 -> Fs/2.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Time-Frequency Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!