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
x[n] = A e^{j \frac{\omega}{\omega_s} n}
where
e^{j \theta} = \cos \theta + j \sin \theta,
\omega = 2 \pi f,
\omega_s = 2 \pi f_s,
and for this particular problem,
f = 0 \ \mathrm{Hz}, \ \frac{f_s}{4}, \ \frac{f_s}{2}.
@MYMLA should be able to confirm that. MYMLA, is there there a specific input waveform, x[n], 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, H(e^{j \frac{\omega}{\omega_s}}) = \frac{Y(e^{j \frac{\omega}{\omega_s}})}{X(e^j {\frac{\omega}{\omega_s}})}, there is more than one way to approach the problem. You could take the discrete-time Fourier transform of the impulse response, h[n], or you could calculate the
steady-state ratio of \frac{y[n]}{x[n]} (the "steady state" ratio assumes that n approaches infinity, but that's easy here since the filter has a finite impulse response. This latter method also assumes that x[n] is sinusoidal as expressed above [i.e., x[n] = A e^{j \frac{\omega}{\omega_s} n} ]). 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 x[n] = \delta[n]. 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.]