HOW CAN I PLOT A CURVE OVER THE SPECTROGRAM OF A LOGARITHMIC CHIRP

조회 수: 2 (최근 30일)
raj
raj 2012년 3월 9일
댓글: William Rose 2022년 11월 27일
I want to represent the true frequency of a logarithmic chirp. So I want to plot a curve over the spectrogram plane can you help me with this??
  댓글 수: 1
Buba
Buba 2022년 11월 27일
See the link below for guide
https://www.mathworks.com/help/signal/ref/spectrogram.html

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

답변 (1개)

William Rose
William Rose 2022년 11월 27일
YOu can follow the spectrogram command with "hold on" and then make additinal plots on the same image.
  댓글 수: 1
William Rose
William Rose 2022년 11월 27일
For example:
t = 0:1/1e3:10; %time vector (s)
f0=10; f1=400; %start, end frequencies (Hz)
y = chirp(t,f0,t(end),f1,'logarithmic');
pspectrum(y,t,'spectrogram') %compute and plot spectrogram of the chirp
ax=gca; ax.YScale = 'log'; %make y axis log scale
Now add a plot of the expected frequency versus time
%Next: compute expected frequency versus time
fexp=f0*exp((t/t(end))*log(f1/f0)); %expected frequency
hold on; plot(t,fexp,'-r') %plot expected freq. vs. time

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

카테고리

Help CenterFile Exchange에서 Measurements and Feature Extraction에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by