练习-笔记-jcmaxx33

记录MATLAB数字信号处理练习笔记

eg-1(2022-11-04)

syms x; f=sin(x)/(x^2 + 4*x +3); y=diff(f,x,4)

定义符号函数求指定阶导数

 

eg-2 (2022-11-06)

Fs = 1000; % Sampling frequency T = 1/Fs; % Sampling period L = 1500; % Length of signal t = (0:L-1)*T; % Time vector X = sin(2*2*pi*t)+(3.8/12)*(sin(6*2*pi*t)+sin(10*2*pi*t)); fplot(X,[0,1]); Y = fft(X); P2 = abs(Y/L); P1 = P2(1:L/2+1); P1(2:end-1) = 2*P1(2:end-1); f = Fs*(0:(L/2))/L; plot(f,P1) ; title("Single-Sided Amplitude Spectrum of X(t)"); xlabel("f (Hz)"); ylabel("|P1(f)|");

FFT计算,即给定函数表达式 f(t)=sin(2*pi*2*t)+sin(2*pi*6+t)+sin(2*pi*10*t)的频谱

运行结果

 

posted @ 2022-11-07 00:16  jcmaxx33  阅读(24)  评论(0编辑  收藏  举报