So there is two main equation:

enter image description hereenter image description here

I wish to filter out frequency $\le 10000Hz$, for example. So my $H(w)$ needs to be a rectangle wave with length 2*1000. However, H(w) needs to be periodic with period $2\pi$, because it's the Discrete-time-FT of $h_d(n)$.

In the link, $H(w)$ is sampled from $-\pi$ to $\pi$. But my $H(w)$ needs to be sampled from $-1000Hz$ to $1000Hz$.

Which step am I missing? How to make a low pass filter using frequency sampling that work with any frequency (not just $\lt \pi$)?

Thank you.


The article is assuming that you already somewhat understand sampling. As soon as you sample a signal, you need to express all of the frequencies with respect to the sampling rate (or you have to carry the sampling rate inside all of your calculations, which is both tedious and loses some generality).

For discrete-time Fourier transform the definition of the Fourier transform is that you do the integration from $-\pi$ to $\pi$. The way you integrate a function that's defined as the second one is from calculus class: do the integration only over the non-zero parts of $H_d(\omega)$:

$$h_d(n) = \int_{-\omega_c}^{\omega_c} e^{j n \omega} d\omega$$

You'll find that the result has an infinitely long response, which is a bit awkward for fitting into our real, finite world. A lot of practical DSP design is doing things like finding an acceptable tradeoff between filter length and how close it comes to what you want.

In your case, you want to cut off at $1000\mathrm{Hz}$ in real-world units, which means you need to scale your cutoff frequency by the sampling rate, so that $\omega_c$ is in radians/sample. I.e., $\omega_c = \frac{1000\mathrm{Hz}}{F_s}$, where $F_s$ is your sampling rate.

| improve this answer | |
  • $\begingroup$ But the problem is what happens when Wc > pi ? I miss out information in that case $\endgroup$ – Duke Le Feb 24 at 16:05
  • 1
    $\begingroup$ I'll try to edit this into my answer when I have time -- the author is expressing frequencies in per-sample values. So you need to add the sampling rate into your calculations. Let the sampling rate be $f_s$. Then your desired $\omega_c = 2 \pi (1000\mathrm{Hz}) / f_s$. $\endgroup$ – TimWescott Feb 24 at 17:06
  • $\begingroup$ - Due to discrete nature of the signal the max frequency is $2\pi$ and anything beyond are the aliases. $\endgroup$ – jomegaA Feb 24 at 22:16
  • $\begingroup$ @TimWescott that's the exact answer I'm looking for. I was wondering whether I could treat "effective frequency" as f / Fs. If you could add more details, it would be very helpful. thank you. $\endgroup$ – Duke Le Feb 25 at 1:12
  • $\begingroup$ @TimWescott But there's something wrong. if $f_c = f_s$, then $w_c = 2*pi$, which is again out of range $\endgroup$ – Duke Le Feb 25 at 1:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.