Digital filter design

4 views (last 30 days)
Shanshan
Shanshan on 15 Feb 2011
Hello All Gentleperson,
I am an old user of Matlab and now I need to use it often. Could you remind me how to build the filters in the follow in the matlab:
1. Number of Tap of FIR 2. IIR 3. SINC and SINC3
Thanks, Shanshan

Answers (1)

Sulaymon Eshkabilov
Sulaymon Eshkabilov on 16 May 2019
%% Saw-tooth signal generation:
fs=25; t=0:1/fs:13;
% Saw-tooth like signal S(t) is generated:
S=sawtooth(t);
% Add White Gaussian noise to the signal S(t):
SN=awgn(S, 5,'measured');
% Note: SN noise added sgnal to simulate the FIR filter
%% FIR filter design
% Lowpass FIR filter design:
Fc = 0.12; % Cut off frequency
N = 12; % FIR filter order
Hf = fdesign.lowpass('N,Fc',N,Fc);
% Window method based filter design:
Hd(1)=design(Hf, 'window','window',{@chebwin,20});
Hd(2)=design(Hf, 'window','window',@hamming);
% Recall filter design tool:
HFvt=fvtool(Hd, 'Color', 'White');
% Windowing with Chebyshev window:
Yt1=filter(Hd(1), SN);
% Windowing with Hamming window:
Yt2=filter(Hd(2), SN);
%% Buttorworth: High-pass/Low-pass/Band-pass
[B,A] = BUTTER(N,Wn,'high') % designs a high-pass filter.
[B,A] = BUTTER(N,Wn,'low') % designs a low-pass filter.
[B,A] = BUTTER(N,Wn,'bandpass') % bandpass filter: Wn =[W1 W2]

Tags

Community Treasure Hunt

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

Start Hunting!