DSPRelated.com
Forums

Working out what type of filter a function represents

Started by briwel June 5, 2009
Hi.

Given the function of a filter, how do you work out what type of filter
(i.e. bandpass, bandstop, lowpass, highpass) it represents. IS there a
definitive way of calculating this?

As an example, I have the filter y(n) = x(n) + 0.5x(n - 1), but I'm more
interested in the technique that the answer to this particular question.

This question is from a past exam paper for a module I am currently
revising for.
briwel wrote:
> Hi. > > Given the function of a filter, how do you work out what type of filter > (i.e. bandpass, bandstop, lowpass, highpass) it represents. IS there a > definitive way of calculating this? > > As an example, I have the filter y(n) = x(n) + 0.5x(n - 1), but I'm more > interested in the technique that the answer to this particular question. > > This question is from a past exam paper for a module I am currently > revising for.
Work out the frequency response, then characterize that by inspection. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Thanks Jerry,

I've now calculated the frequency response, which I believe to be:
sqrt( ((1 + 0.5cos(x))^2) + (0.5sin(x))^2  )

Plotting this gives a wave (period  = 2*pi) which peaks at 1.5 and troughs
at 0.5. From the sample graphs I've got this don't seem to match up with
any type of filter.

Can you give me some advice as to what properties I am looking for in the
graph to tell me what type of filter it matches up with?

Thanks for your patience
briwel wrote:
> Thanks Jerry, > > I've now calculated the frequency response, which I believe to be: > sqrt( ((1 + 0.5cos(x))^2) + (0.5sin(x))^2 ) > > Plotting this gives a wave (period = 2*pi) which peaks at 1.5 and troughs > at 0.5. From the sample graphs I've got this don't seem to match up with > any type of filter. > > Can you give me some advice as to what properties I am looking for in the > graph to tell me what type of filter it matches up with? > > Thanks for your patience
I'd call it a not-very-sharp comb filter. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Jerry, I can see what you mean, as the frequency domain doesn't seem to
resemble any of the types of filter I mentioned.

However, the question is asked in a way that indicates it is definately
one of them four types (bandpass, badnstopp, highpass, lowpass)

Any ideas on which one it might be and why?

Or do you think I've done something wrong in deriving the equation?

>briwel wrote: >> Thanks Jerry, >> >> I've now calculated the frequency response, which I believe to be: >> sqrt( ((1 + 0.5cos(x))^2) + (0.5sin(x))^2 ) >> >> Plotting this gives a wave (period = 2*pi) which peaks at 1.5 and
troughs
>> at 0.5. From the sample graphs I've got this don't seem to match up
with
>> any type of filter. >> >> Can you give me some advice as to what properties I am looking for in
the
>> graph to tell me what type of filter it matches up with? >> >> Thanks for your patience > >I'd call it a not-very-sharp comb filter. > >Jerry >-- >Engineering is the art of making what you want from things you can get. >����������������������������������������������������������������������� >
On Fri, 05 Jun 2009 11:19:29 -0500, briwel wrote:

> Thanks Jerry, > > I've now calculated the frequency response, which I believe to be: sqrt( > ((1 + 0.5cos(x))^2) + (0.5sin(x))^2 ) > > Plotting this gives a wave (period = 2*pi) which peaks at 1.5 and > troughs at 0.5. From the sample graphs I've got this don't seem to match > up with any type of filter. > > Can you give me some advice as to what properties I am looking for in > the graph to tell me what type of filter it matches up with? > > Thanks for your patience
It's not a very useful filter, and hence isn't a good example. As a counter example, consider x_k = x_{k-1} + (u_k - x_{k-1})/20. -- http://www.wescottdesign.com
briwel wrote:
> Jerry, I can see what you mean, as the frequency domain doesn't seem to > resemble any of the types of filter I mentioned. > > However, the question is asked in a way that indicates it is definately > one of them four types (bandpass, badnstopp, highpass, lowpass) > > Any ideas on which one it might be and why?
It's none of those, as far as I see.
> Or do you think I've done something wrong in deriving the equation?
Quite possibly. I didn't derive it myself. Your solution seemed reasonable, but I didn't check it. Let's see: ((1 + 0.5cos(x))^2) = 1 + cos(x) + .25cos^2(x) = 1 + cos(x) + .25(1 - sin^2(x)) and (0.5sin(x))^2 = .25sin^2(x) so we get sqrt(.75 + cos(x)). It seems unlikely.
>> briwel wrote: >>> Thanks Jerry, >>> >>> I've now calculated the frequency response, which I believe to be: >>> sqrt( ((1 + 0.5cos(x))^2) + (0.5sin(x))^2 ) >>> >>> Plotting this gives a wave (period = 2*pi) which peaks at 1.5 and > troughs >>> at 0.5. From the sample graphs I've got this don't seem to match up > with >>> any type of filter. >>> >>> Can you give me some advice as to what properties I am looking for in > the >>> graph to tell me what type of filter it matches up with? >>> >>> Thanks for your patience >> I'd call it a not-very-sharp comb filter. >> >> Jerry >> -- >> Engineering is the art of making what you want from things you can get. >>
Jerry -- Engineering is the art of making what you want from things you can get.
Jerry, what did you do there to get sqrt(.75 + cos(x))? The graph seems to
indicate a bandstop filter.

Why did you derive that from the (1 + cos) part of the original equation,
and why did you discard the sin part?

cheers

Also, I have gathered that the example is rubbish, but its a past exam
question,so I assume there is an answer!
Ignore the last post, I was being an idiot.

Jerry, I think you made a slight mistake with your simplification.
sqrt(.75 + cos(x)) seems to give a bandstop filter, but the graph is
different to that for the original equation

However, using your derivations:

((1 + 0.5cos(x))^2) = 1 + cos(x) + .25cos^2(x)
 = 1 + cos(x) + .25(1 - sin^2(x)) 
AND
(0.5sin(x))^2 = .25sin^2(x)

We can say the original equation is equal to:
1 + cos(x) + .25(1 - sin^2(x)) + .25(sin^2(x)) 

which equals
(1.25 + cos(x)), which gives the same graph as the original equation.

I think that I may have made a mistake in the initial derivation. If
indeed the graph does equal sqrt(.75 +cos(x)), could we say that it was in
fact a bandstop filter?
briwel wrote:
> Ignore the last post, I was being an idiot. > > Jerry, I think you made a slight mistake with your simplification. > sqrt(.75 + cos(x)) seems to give a bandstop filter, but the graph is > different to that for the original equation > > However, using your derivations: > > ((1 + 0.5cos(x))^2) = 1 + cos(x) + .25cos^2(x) > = 1 + cos(x) + .25(1 - sin^2(x)) > AND > (0.5sin(x))^2 = .25sin^2(x) > > We can say the original equation is equal to: > 1 + cos(x) + .25(1 - sin^2(x)) + .25(sin^2(x)) > > which equals > (1.25 + cos(x)), which gives the same graph as the original equation.
I don't know how I came to 1 -.25 instead of 1 + .25. It was late and I hurried.
> I think that I may have made a mistake in the initial derivation. If > indeed the graph does equal sqrt(.75 +cos(x)), could we say that it was in > fact a bandstop filter?
I don't think I would. Practically any shape is possible. They don't all have common names. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������