examp33.m

来自「ADSP TOOLBOX: Version 2.0 and gui m-file」· M 代码 · 共 23 行

M
23
字号

clc,echo on 
%EXAMPLE 33 
F0=0.05;F1=0.4;                       % Digital frequencies
N=800;n=0:N-1;                        % Number of points and DT index
xc=cos(2*pi*(n*F0+(F1-F0)*n.*n/2/N)); % Chirp signal
plot(n,xc),pause(2)                   % Plot chirp
timefreq(xc);pause(2)                 % Look at its spectrum
psdwelch(xc);pause(2)                 % Look at its spectrum
n1=-80:80;                            % Index for filter coefficients
ha=0.4*cos(0.4*n1*pi).*sinc(0.2*n1);
h=udelta(n1)-ha;                      % Generate filter coefficients
yf=filter(h,1,xc);
plot(n,yf), pause(2)                  % Filter the chirp and plot
timefreq(yf);pause(2)                 % Spectrum of filtered chirp
psdwelch(yf);pause(2)                 % Spectrum of filtered chirp
h1=0.3*sinc(0.3*n1);                  % Generate filter coefficients
yf1=filter(h1,1,xc);
plot(n,yf1),pause(2)                  % Filter the chirp and plot
timefreq(yf1);pause(2)                % Spectrum of filtered chirp
psdwelch(yf1);                        % Spectrum of filtered chirp
echo off %end of example

⌨️ 快捷键说明

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