DSP Resonance filter

t_n_k

Joined Mar 6, 2009
5,455
Yep - you need T. In fact you have it indirectly. T=1/fs is the sampling interval or period.

Regarding ωc.

This would be fixed for each particular evaluation of the frequency response.

So if fc [hence ωc] has 6 possible options you would need to evaluate 6 separate frequency responses.

I'll have a look at doing an example plot based on your values and get back to you.
 

t_n_k

Joined Mar 6, 2009
5,455
Ive attached a magnitude response plot for H(z) for 3 different r values at fc=1000 and fs=10000

Horizontal axis is in frequency [Hz - as in cycles per second]
Vertical axis is |H(z)|

black trace is for r=0.99
red trace is for r=1.1
blue trace is for r=2

Note that each trace has magnitude '1' at f=fc as predicted by the analysis.

It should be noted that the frequency response would only be physically relevant up to the Nyquist frequency [fN=fs/2]
 

Attachments

Last edited:

Thread Starter

O'Fithcheallaigh

Joined Sep 15, 2010
20
Hello.

Thanks for that, at least I know what I should be getting now :rolleyes:

So, for just one set of parameter, I am right in just plugging the values in? Also, I am not sure at all what the plot code should be.

Seán
 

t_n_k

Joined Mar 6, 2009
5,455
Perhaps you could supply some additional detail - the complete problem statement perhaps. It becomes cumbersome guessing exactly what you are trying to achieve.
 

t_n_k

Joined Mar 6, 2009
5,455
So, for just one set of parameter, I am right in just plugging the values in? Also, I am not sure at all what the plot code should be.
Regarding a plot of two numeric vectors / arrays as an x-y plot the following is a simple example from the Mathworks site.

Plot a sine curve.

x = -pi : .1 : pi
y = sin(x)
plot(x,y)

array x ranges from -Pi to +Pi in steps of 0.1 radian
array y is of the same dimension as x and the y values are the result of calculating sin(x) for each term in array x

On the matter of calculating the plot arrays for each of the 6 nominated parings of fc and r.

The value of T is always the same T=1/fs=1/10kHz=100us

For each plot you only need to generate one array of ω values as the angular frequency baseline.

Suppose you want 1000 samples for each plot and you also want the frequency to vary from 0Hz to the Nyquist frequency fN=fs/2=5kHz. That's the same as the angular frequency ω varying from 0 to ~31.4 krads/sec

You can generate an ω array of 1000 equally spaced elements using a code line such as

ω=linspace(0,31400,1000)

Then you could generate an array of H(ω) values using the ω array as the independent variable in the generic H(z) function of post#14 .
 
Top