Modeling Filters described in frequency domain in Simulink and /or Matlab
2 views (last 30 days)
Show older comments
Hi,
I have a signal f(x), and two filters H(w) and G(w) where H(w) = e^(jw/2)*cos(w/2) and G(w) = 4*e^(jw/2)*sin(w/2)
The output is G(w)H(w)F(w).
I have the signal f(x) as a vector. How do I simulate this system in Matlab or Simulink.
thanks
0 Comments
Answers (1)
Wayne King
on 16 Aug 2012
Edited: Wayne King
on 16 Aug 2012
In your particular example, that is easy:
Your first filter:
H(w) = e^(jw/2)*cos(w/2)
is h(n) = \delta(n+1) + \delta(n)
Note that above is noncausal, so you can use the causal version
h = [1 1];
Your second filter:
G(w) = 4*e^(jw/2)*sin(w/2)
is
g(n) = 2\delta(n+1)+2\delta(n)
also, noncausal, you can use
g = [2 2];
You can get the resulting FIR filter with
b = conv(h,g);
In general, if you want to design filters in the frequency domain using magnitude only, you can use:
fir2 or fdesign.arbmag
If you want to design with phase and magnitude, you can use:
fdesign.arbmagnphase in the DSP System Toolbox.
2 Comments
Wayne King
on 16 Aug 2012
For that I just found the inverse Fourier transform with a pencil and paper.
For your other transfer functions, did you get my response about fdesign.arbmagnphase?
Something like:
F = linspace(0,1,100);
H = exp(1i*F ).*(cos(F)).^3;
d = fdesign.arbmagnphase('N,F,H',50,F,H);
Hd = design(d);
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!