Issue with Chirp function in Matlab

조회 수: 8(최근 30일)
Anum Ahmed Pirkani
Anum Ahmed Pirkani 2021년 3월 2일
댓글: Mathieu NOE 2021년 3월 12일
Hello,
I am currently facing an issue with the chirp function in Matlab. It works correctly for certain parameters, however I am not getting the expected chirp for another set of parameters. I have compared the result with exponential function as well, but getting the same problem.
fc = 77e9;
BW = 1500e6;
Sp_T = 204.8e-6;
fs = 2.*BW;
ts = real(1./fs);
t = 0:ts:Sp_T-ts;
Swp_S = BW./Sp_T;
Sig1 = chirp(t,fc,t(end),fc+BW,'complex'); % Using chirp function
Sig2 = 1.*exp(1i.*(2.*pi.*(fc.*t+0.5.*Swp_S.*t.^2))); % using exponential
figure;subplot(211);plot(t,real(Sig_C));
[S,F,~,~] = spectrogram(Sig1,64,32,128,fs,'yaxis');subplot(212);imagesc(t*1e6,F*1e-9,abs(S));set(gca,'YDir','normal')
Both the signals Sig1 and Sig2 gave the similar result attached below:
The shift in frequency is also visible in the time domain plot.
However, as soon as the bandwidth is changed to 1000e6 or 2000e6 (keeping all the other parameters same), the chirp becomes linear.
Furthermore, how is it identified where to start the spectrogram plot? In both the cases, the start frequency is same, I just changed the bandwidth. But on the spectrogram plot, both the signals start with a different frequency.
Regards
Anum

채택된 답변

Mathieu NOE
Mathieu NOE 2021년 3월 3일
hello
there are a few points that I don't understand :
  • why 'complex' chirp signal ? we can only plot real signal
  • the sampling frequency is inconsistent with how you define the frequency range of the chirp. You specifiy the min freq = fc and the max freq = fc + BW. the sampling rate must be at least 2 x the max freq (= fc + BW) and not 2 x BW.
also I noticed , the frequency variation is very low , only +2% of increase - really ? this is to be seen in the spectrogram plot, the line is almost horizontal and located at the fc = 77e9 Hz
see code below :
fc = 77e9;
BW = 1500e6;
Sp_T = 204.8e-6;
fs = 3.*(fc+BW);
ts = real(1./fs);
t = 0:ts:Sp_T-ts;
Swp_S = BW./Sp_T;
Sig1 = chirp(t,fc,t(end),fc+BW,'real'); % Using chirp function
% Sig2 = 1.*exp(1i.*(2.*pi.*(fc.*t+0.5.*Swp_S.*t.^2))); % using exponential
figure;subplot(211);plot(t,real(Sig1));
[S,F,~,~] = spectrogram(Sig1,64,32,128,fs,'yaxis');
subplot(212);imagesc(t*1e6,F*1e-9,abs(S));set(gca,'YDir','normal')
  댓글 수: 2
Mathieu NOE
Mathieu NOE 2021년 3월 12일
Glad it works at the end !

댓글을 달려면 로그인하십시오.

추가 답변(0개)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by