资源简介
设计带通滤波器,MATLAB程序.这个程序简单明了,能够很容易的进行滤波。
代码片段和文件信息
function Hd = untitled
%UNtitleD Returns a discrete-time filter object.
f1=5;f2=10;f3=20;
N=200;Fs=100;n=0:N-1;Ts=1/Fs;t=n*Ts;
s=sin(2*pi*f1*t)+sin(2*pi*f2*t)+sin(2*pi*f3*t);
figure(1);hold on;plot(ts);
nfft=200;
Y=fft(snfft)/sqrt(N-1);f=(0:nfft-1)*Fs/nfft;
figure(2);hold on;stem(f(1:N/2)abs(Y(1:N/2)))
grid on
%
% MATLAB Code
% Generated by MATLAB(R) 8.0 and the Signal Processing Toolbox 6.18.
%
% Generated on: 03-Jun-2014 16:12:04
%
% Butterworth Bandpass filter designed using FDESIGN.BANDPASS.
% All frequency values are in Hz.
Fs = 200; % Sampling Frequency
Fstop1 = 6; % First Stopband Frequency
Fpass1 = 8; % First Pass
评论
共有 条评论