band pass filter design

2 views (last 30 days)
ayman osama
ayman osama on 12 Feb 2013
clc; clear; % n=256;%order % Fs=16*10^6; % fcn1=3*10^6/(Fs/2); % fcn2=4*10^6/(Fs/2); % x=fir1(n, [fcn1 fcn2]); object=mmreader('xylophone.MPG'); video=read(object,1);
A_stop1 = 60; % Attenuation in the first stopband = 60 dB F_stop1 = 2.9*10^6; % Edge of the stopband = 8400 Hz F_pass1 = 3*10^6; % Edge of the passband = 10800 Hz F_pass2 = 4*10^6; % Closing edge of the passband = 15600 Hz F_stop2 = 4.1*10^6; % Edge of the second stopband = 18000 Hz A_stop2 = 60; % Attenuation in the second stopband = 60 dB A_pass = 2; % Amount of ripple allowed in the passband = 1 dB
d = fdesign.bandpass; BandPassSpecObj = ... fdesign.bandpass('Fst1,Fp1,Fp2,Fst2,Ast1,Ap,Ast2', ... F_stop1, F_pass1, F_pass2, F_stop2, A_stop1, A_pass, ... A_stop2, 16*10^6); set(BandPassSpecObj, 'Fpass2', 4.2*10^6, 'Fstop2', 5.2*10^6); designmethods(BandPassSpecObj);
BandPassFilt = design(BandPassSpecObj, 'equiripple'); fvtool(BandPassFilt); output = filter(BandPassFilt,object);
hi i am trying to filter a video signal with band pass filter but it give me error n filtering any help????????

Answers (2)

Wayne King
Wayne King on 12 Feb 2013
You will need a 2D filter if you wish to filter frames of a video. The FIR filter you get from fdesign.bandpass is only for 1-D signals.

Wayne King
Wayne King on 14 Feb 2013
You can design a 2D separable filter from a 1D filter, for example:
b = fir1(48,[0.35 0.65]); % bandpass from 0.35pi radians/sample to 0.65pi
h = b'*b; % 2D separable filter
% assume this is your image
im = randn(512,512);
imfilt = filter2(h,im,'same');
If you have the Image Processing Toolbox, you have more possible for 2D filter design.

Community Treasure Hunt

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

Start Hunting!