Filter Graphing Help - Calculate & Graph Response

In summary: I think I understand now. Sorry I'm just getting more confused. Where did... sorry, I think I understand now.
  • #1
MYMLA
7
0

Homework Statement


Calculate and graph the response of the filter:

y(n) = ½*x(n) + ½*x(n-1)

at the frequencies: i) 0 Hz, ii) sr/4, iii) sr/2 (Nyquist frequency).

Homework Equations

The Attempt at a Solution


If I put each of those into the formula as n? But how do i know what sample rate/4 is? I'm guessing that it's a low pass.
 
Physics news on Phys.org
  • #2
MYMLA said:

Homework Statement


Calculate and graph the response of the filter:

y(n) = ½*x(n) + ½*x(n-1)

at the frequencies: i) 0 Hz, ii) sr/4, iii) sr/2 (Nyquist frequency).

Homework Equations

The Attempt at a Solution


If I put each of those into the formula as n? But how do i know what sample rate/4 is? I'm guessing that it's a low pass.
Yes, it does look like a lowpass filter. Your sample rate is just integers -- 1, 2, 3, 4, etc. The SR/2 is just every other sample, the SR/4 is just every 4th sample, etc.

So can you show us what you get for the frequencies above? Just input 1's and 0's as indicated.
 
  • #3
berkeman said:
Yes, it does look like a lowpass filter. Your sample rate is just integers -- 1, 2, 3, 4, etc. The SR/2 is just every other sample, the SR/4 is just every 4th sample, etc.

So can you show us what you get for the frequencies above? Just input 1's and 0's as indicated.
I'm confused. so I just plug in 1's and 0's into the formula?
 
  • #4
MYMLA said:
I'm confused. so I just plug in 1's and 0's into the formula?
I'm assuming the x() are the inputs and y() is the output, right? So for the first DC case, input all 1's and see what you get for the y(n) outputs. Then for an input frequency of SR/2, you would have alternating 1's and 0's. For SR/4, you would have two 1's in a row followed by two 0's in a row, and so on. You should then be able to keep lowering the frequency of the input variations to see what kind of a frequency response you get.
 
  • #5
berkeman said:
I'm assuming the x() are the inputs and y() is the output, right? So for the first DC case, input all 1's and see what you get for the y(n) outputs. Then for an input frequency of SR/2, you would have alternating 1's and 0's. For SR/4, you would have two 1's in a row followed by two 0's in a row, and so on. You should then be able to keep lowering the frequency of the input variations to see what kind of a frequency response you get.

That makes more sense but how do I get the all ones, one zero one zero and two ones two zeros part? is that always the same?. Thankyou for the help.
 
  • #6
MYMLA said:
That makes more sense but how do I get the all ones, one zero one zero and two ones two zeros part? is that always the same?. Thankyou for the help.
You just work it out by hand, I guess. Alternately you can do this in Excel -- I do a lot of my basic digital filter checks in Excel. You just make a column for n that counts 1, 2, 3, 4, ... And then the next column is x(n), and the next column is y(n). You put a formula into the 2nd cell down for y(n) so you can add the x(n) and x(n-1) terms using the formula you were given. Then just click that y(2) cell and drag it down a ways, and do a Fill-Down. That pastes the formula into all the cells in that column.

You would make Excel sheets for each of the input sequences. One for the DC case where x(n)=1 for all n, one for the SR/2 case where you alternate 1/0 in each row, etc.
 
  • #7
berkeman said:
You just work it out by hand, I guess. Alternately you can do this in Excel -- I do a lot of my basic digital filter checks in Excel. You just make a column for n that counts 1, 2, 3, 4, ... And then the next column is x(n), and the next column is y(n). You put a formula into the 2nd cell down for y(n) so you can add the x(n) and x(n-1) terms using the formula you were given. Then just click that y(2) cell and drag it down a ways, and do a Fill-Down. That pastes the formula into all the cells in that column.

You would make Excel sheets for each of the input sequences. One for the DC case where x(n)=1 for all n, one for the SR/2 case where you alternate 1/0 in each row, etc.
Sorry I'm just getting more confused. Where did you get the 1 for all n from and the alternate one. How do you know its 1 for all n and alternating?
 
  • #8
MYMLA said:
Sorry I'm just getting more confused. Where did you get the 1 for all n from and the alternate one. How do you know its 1 for all n and alternating?
This is for a digital filter, right? So the input to the digital filter is a single bit that can take values of 0 or 1, and can change for each n. You can have an input bitstream that is 100 bits long, numbered n=1, n=2, n=3, etc.

The problem asks you what the output of your filter equation is for frequency = 0Hz. That means that the input value is holding steady at either a 0 or a 1 always for the whole bitstream. Having x(n) = 0 for the whole bitstream is pretty uninteresting, so instead set them all to 1. The output of your digital filter equation for each value of n will be the response of the filter to a DC input signal of x(n) = 1.

Then to find out what the response of the filter is to the highest frequency input that you can have, you want to make the x(n) alternate between 0 and 1 each time. That looks to be what they are calling the SR/2 case. Then you can do lower frequencies like SR/4 by changing the x(n) in each row of your spreadsheet more slowly.
 
  • #9
MYMLA said:

Homework Statement


Calculate and graph the response of the filter:

y(n) = ½*x(n) + ½*x(n-1)

at the frequencies: i) 0 Hz, ii) sr/4, iii) sr/2 (Nyquist frequency).

Homework Equations

The Attempt at a Solution


If I put each of those into the formula as n? But how do i know what sample rate/4 is? I'm guessing that it's a low pass.

berkeman said:
Yes, it does look like a lowpass filter. Your sample rate is just integers -- 1, 2, 3, 4, etc. The SR/2 is just every other sample, the SR/4 is just every 4th sample, etc.

So can you show us what you get for the frequencies above? Just input 1's and 0's as indicated.

berkeman said:
This is for a digital filter, right? So the input to the digital filter is a single bit that can take values of 0 or 1, and can change for each n. You can have an input bitstream that is 100 bits long, numbered n=1, n=2, n=3, etc.

@berkeman, I'm not sure if that's that's quite right. I don't see any indication in the problem statement that the filter is quantized in amplitude. It is obviously a discrete-time filter, in that it is quantized in the time domain, but as far as I can tell the amplitudes can take on any value.

To me it appears that the problem statement is asking for the frequency response, where the input function is assumed to be sinusoidal such as
[tex] x[n] = A e^{j \frac{\omega}{\omega_s} n} [/tex]
where
[tex] e^{j \theta} = \cos \theta + j \sin \theta, [/tex]
[tex] \omega = 2 \pi f, [/tex]
[tex] \omega_s = 2 \pi f_s, [/tex]
and for this particular problem,
[tex] f = 0 \ \mathrm{Hz}, \ \frac{f_s}{4}, \ \frac{f_s}{2}. [/tex]

@MYMLA should be able to confirm that. MYMLA, is there there a specific input waveform, [itex] x[n] [/itex], that you are expected to use or is the input assumed to be sinusoidal?

What's not clear in the problem statement though if it is asking to calculate and graph the frequency response or the transient response.

If you are being asked to calculate the frequency response, [itex] H(e^{j \frac{\omega}{\omega_s}}) = \frac{Y(e^{j \frac{\omega}{\omega_s}})}{X(e^j {\frac{\omega}{\omega_s}})} [/itex], there is more than one way to approach the problem. You could take the discrete-time Fourier transform of the impulse response, [itex] h[n] [/itex], or you could calculate the steady-state ratio of [itex] \frac{y[n]}{x[n]} [/itex] (the "steady state" ratio assumes that [itex] n [/itex] approaches infinity, but that's easy here since the filter has a finite impulse response. This latter method also assumes that [itex] x[n] [/itex] is sinusoidal as expressed above [i.e., [itex] x[n] = A e^{j \frac{\omega}{\omega_s} n} [/itex] ]). Note that the frequency response is complex, and has a varying magnitude and phase as function of the input frequency.

If you are being asked to calculate the transient response (instead of the frequency response), then you need a specific input signal. I sort of doubt this is what is being asked of you unless the problem gives you more information than was given here.

[Edit: The "impulse response" of which I spoke earlier, is special case of the transient response where the input signal is [itex] x[n] = \delta[n] [/itex]. This is an easy to calculate waveform for a FIR filter. The discrete-time Fourier transform of the impulse response is the filter's "frequency response," as expressed as a function of frequency.]
 
Last edited:
  • Like
Likes berkeman
  • #10
collinsmark said:
I'm not sure if that's that's quite right. I don't see any indication in the problem statement that the filter is quantized in amplitude. It is obviously a discrete-time filter, in that it is quantized in the time domain, but as far as I can tell the amplitudes can take on any value.
You may be right. At the very least the values x(n) could be multi-bit values, rather than the single-bit example I was thinking of. And the filter response would be a lot clearer if the values could be multi-bit. Thanks for seeing that. :smile:
 
  • Like
Likes collinsmark
  • #11
I'm still confused by this :/
 

Attachments

  • filter.JPG
    filter.JPG
    35.8 KB · Views: 337
  • filter.JPG
    filter.JPG
    35.8 KB · Views: 338
  • #12
MYMLA said:
I'm still confused by this :/
Sorry, but I'm confused too. :confused:
 

What is filter graphing?

Filter graphing is a method used in signal processing to analyze and visualize the response of a filter to an input signal. It involves plotting the frequency response of a filter on a graph to show how the filter affects different frequencies in the input signal.

Why is filter graphing important?

Filter graphing is important because it allows scientists and engineers to understand how filters affect signals in different frequency ranges. This information is crucial for designing and optimizing filters for various applications, such as audio signal processing, image processing, and communication systems.

What is the process for calculating filter response?

The process for calculating filter response involves determining the transfer function of the filter, which is a mathematical representation of how the filter affects different frequencies in an input signal. This transfer function can then be used to calculate the magnitude and phase response of the filter, which can be plotted on a graph to visualize the filter's behavior.

What are some common types of filters?

Some common types of filters include low-pass filters, high-pass filters, band-pass filters, and band-stop filters. Other types include notch filters, all-pass filters, and comb filters. Each type of filter has a different frequency response and is used for different applications.

How can filter graphing help in real-world applications?

Filter graphing is used in many real-world applications, such as audio equalization, noise reduction, and signal extraction. By understanding the frequency response of a filter, engineers and scientists can design filters to achieve specific goals, such as removing unwanted frequencies, amplifying certain frequencies, or isolating specific signals from a noisy environment.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
27
Views
2K
  • Introductory Physics Homework Help
Replies
3
Views
1K
  • Introductory Physics Homework Help
Replies
10
Views
1K
  • Introductory Physics Homework Help
Replies
25
Views
2K
  • Introductory Physics Homework Help
Replies
6
Views
7K
  • Introductory Physics Homework Help
Replies
10
Views
5K
  • Introductory Physics Homework Help
Replies
6
Views
2K
  • Introductory Physics Homework Help
Replies
19
Views
1K
  • Electrical Engineering
Replies
4
Views
820
  • Introductory Physics Homework Help
Replies
26
Views
6K
Back
Top