Hello dear
I try to make a program that implements the synthesis of recursive digital lowpass filter on the analog lowpass filter prototype with the sampling method the impulse invariant.
after studying the help section of the program
got the following:
Fd = 10000;% sampling rate
fp = 1000;% frequency bandwidth
fs = 1500;% frequency stop
Rp = 2;% maximum attenuation in the passband
Rs = 50;% minimum attenuation in stopband
Wp = 2 * fp / Fd;% Limit bandwidth
Ws = 2 * fs / Fd;% boundary of the stopband
[n, Wn] = buttord (Wp, Ws, Rp, Rs, 's');% calculates the minimum order analog Butterworth filter required to meet specified requirements.
[b, a] = butter (n, Wn, 's');% synthesis of analog Butterworth lowpass filter
[bz, az] = impinvar (b, a, Fd);% impulse invariant
[h, w] = freqs (b, a);% calculation of the frequency response of analog integrated system from its transfer function, given in the s-field
[hz, wz] = freqz (bz, az);% calculation of the complex frequency response of discrete system from its transfer function, given in the z-field
subplot (2, 2, 1)% divide the figure in box 2 by 2 matrix of object, with the number of Building 1 for the current plot
plot (w / (2 * pi), 20 * log10 (abs (h)))% frequency response graph in Hz and dB
title ( 'AFC of analog filter')% title graphic
xlabel ( 'frequency Hz')% name of the x-axis
xlim ([0 Fd / 2])% of set limits on the x-axis
ylabel ( 'amplitude dB')% name of the y-axis
ylim ([-100 20])% of set limits on the y-axis
grid on% the grid on the chart
subplot (2, 2, 2)% divide the figure in box 2 by 2 matrix of object, with the number of Building 2 for the current plot
plot (w, unwrap (angle (h)) * 180/pi)% plot PFC (in degrees)
title ( 'PFC of analog filter')% title graphic
xlabel ( 'frequency Hz')% name of the x-axis
xlim ([0 Fd / 2])% of set limits on the x-axis
ylabel ( 'phase Degrees')% name of the y-axis
ylim ([-300 300])% of set limits on the y-axis
grid on% the grid on the plot
subplot (2, 2, 3)% divide the figure in box 2 by 2 matrix of object, with the number of Building 3 for the current plot
plot (wz / (2 * pi), 20 * log10 (abs (hz)))% frequency response graph in Hz and dB
title ( 'AFC discretized filter')% title graphic
xlabel ( 'frequency Hz')% name of the x-axis
xlim ([0 Fd / 2])% of set limits on the x-axis
ylabel ( 'amplitude dB')% name of the y-axis
ylim ([-100 20])% of set limits on the y-axis
grid on% the grid on the plot
subplot (2, 2, 4)% divide the figure in box 2 by 2 matrix of object, with the number of Building 4 for the current plot
plot (wz, unwrap (angle (hz)) * 180/pi)% plot PFC (in degrees)
title ( 'PFC discretized filter')% title graphic
xlabel ( 'frequency Hz')% name of the x-axis
xlim ([0 Fd / 2])% of set limits on the x-axis
ylabel ( 'phase Degrees')% name of the y-axis
ylim ([-300 300])% of set limits on the y-axis
grid on% the grid on the plot
1. Where I made a mistake, because based on the graphics is that something strange instead of the desired filter
2.How to add to the figure of a graphical display of the impulse response of analog and discrete systems?
3.Sorry for my English
|
|
0
|
|
|
|
Reply
|
AHrap
|
12/29/2009 10:28:04 PM |
|
"AHrap Golovin" <Aveng3r@uralweb.ru> wrote in message <hhdvpk$rl5$1@fred.mathworks.com>...
> Hello dear
> I try to make a program that implements the synthesis of recursive digital lowpass filter on the analog lowpass filter prototype with the sampling method the impulse invariant.
> after studying the help section of the program
> got the following:
>
> Fd = 10000;% sampling rate
> fp = 1000;% frequency bandwidth
> fs = 1500;% frequency stop
> Rp = 2;% maximum attenuation in the passband
> Rs = 50;% minimum attenuation in stopband
>Wp = 2 * pi * fp;% passband edge frequency (in rad / s)
>Ws = 2 * pi * fs;% stopband edge frequency (in rad / s)
> [n, Wn] = buttord (Wp, Ws, Rp, Rs, 's');% calculates the minimum order analog Butterworth filter required to meet specified requirements.
> [b, a] = butter (n, Wn, 's');% synthesis of analog Butterworth lowpass filter
> [bz, az] = impinvar (b, a, Fd);% impulse invariant
> [h, w] = freqs (b, a);% calculation of the frequency response of analog integrated system from its transfer function, given in the s-field
> [hz, wz] = freqz (bz, az);% calculation of the complex frequency response of discrete system from its transfer function, given in the z-field
> subplot (2, 2, 1)% divide the figure in box 2 by 2 matrix of object, with the number of Building 1 for the current plot
> plot (w / (2 * pi), 20 * log10 (abs (h)))% frequency response graph in Hz and dB
> title ( 'AFC of analog filter')% title graphic
> xlabel ( 'frequency Hz')% name of the x-axis
> xlim ([0 Fd / 2])% of set limits on the x-axis
> ylabel ( 'amplitude dB')% name of the y-axis
> ylim ([-100 20])% of set limits on the y-axis
> grid on% the grid on the chart
> subplot (2, 2, 2)% divide the figure in box 2 by 2 matrix of object, with the number of Building 2 for the current plot
> plot (w, unwrap (angle (h)) * 180/pi)% plot PFC (in degrees)
> title ( 'PFC of analog filter')% title graphic
> xlabel ( 'frequency Hz')% name of the x-axis
> xlim ([0 Fd / 2])% of set limits on the x-axis
> ylabel ( 'phase Degrees')% name of the y-axis
> ylim ([-300 300])% of set limits on the y-axis
> grid on% the grid on the plot
> subplot (2, 2, 3)% divide the figure in box 2 by 2 matrix of object, with the number of Building 3 for the current plot
> plot (wz / (2 * pi), 20 * log10 (abs (hz)))% frequency response graph in Hz and dB
> title ( 'AFC discretized filter')% title graphic
> xlabel ( 'frequency Hz')% name of the x-axis
> xlim ([0 Fd / 2])% of set limits on the x-axis
> ylabel ( 'amplitude dB')% name of the y-axis
> ylim ([-100 20])% of set limits on the y-axis
> grid on% the grid on the plot
> subplot (2, 2, 4)% divide the figure in box 2 by 2 matrix of object, with the number of Building 4 for the current plot
> plot (wz, unwrap (angle (hz)) * 180/pi)% plot PFC (in degrees)
> title ( 'PFC discretized filter')% title graphic
> xlabel ( 'frequency Hz')% name of the x-axis
> xlim ([0 Fd / 2])% of set limits on the x-axis
> ylabel ( 'phase Degrees')% name of the y-axis
> ylim ([-300 300])% of set limits on the y-axis
> grid on% the grid on the plot
>
> 1. Where I made a mistake, because based on the graphics is that something strange instead of the desired filter
> 2.How to add to the figure of a graphical display of the impulse response of analog and discrete systems?
> 3.Sorry for my English
found my mistake and corrected, but now I get a message
Warning: The output is not correct / robust.
Coeffs of B (s) / A (s) are real, but B (z) / A (z) has complex coeffs.
Probable cause is rooting of high-order repeated poles in A (s).
> In impinvar at 124
|
|
0
|
|
|
|
Reply
|
Aveng3r (1)
|
12/30/2009 6:57:02 AM
|
|
|
1 Replies
281 Views
(page loaded in 0.222 seconds)
Similiar Articles: Windowed sinc - comp.dspHelp me understand better and I'll try to do better as ... you want to have the property of "reverse time invariance". ... works just fine as long as the aggregate FIR impulse ... DSP-impulse invariance method | Comp.DSP | DSPRelated.comNow, I use the impulse invariance to design a lowpass filter. I need to find the H(s) from pole pairs. I don't know how toconvert H(s) to H(z). Can anyone help me? Invariance | DSPRelated.comNow, I use the impulse invariance to design a lowpass filter. I need to find the H(s) from pole pairs. I don't know how toconvert H(s) to H(z). Can anyone help me? 7/14/2012 10:11:20 PM
|