test0802chirp.m

来自「信号处理实例」· M 代码 · 共 33 行

M
33
字号
%---------------------------------------------------------------------------------------
% test0801chirp.m,  for  example 08.02
% chirp signal and its spectrum
% 2006.12.15 LYB
%----------------------------------------------------------------------------------------
echo off
clear
t=0:0.002:1-0.002;
n=500;
t1=1;
f0=10;
f1=100;
signal = CHIRP(t,f0,t1,f1)
figure(1);
subplot(211);
plot(signal);
axis([0 n-1 -1.5 1.5]);
title('chirp signal and spectrum');
xlabel('n');
ylabel('time signal x(n)');


signalspectrum=abs(fft(signal));
subplot(212);
plot(signalspectrum);
axis([0 n/2-1 0 50]);
xlabel('k');
ylabel('DFT X(k)'); 
text(210,55,'test0802chirp');

%tfrstft(signal');grid on;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?