Hi All, I'm looking to create a simple low pass filter in VC++ and was wondering what would the best / fastest way to do this. The signal I would like to decode is the subaudible 100hz to 200hz, 150bps waveform from voice comms in radio trunking systems. If using a sampling rate of 22050 hz to apply to the filter, how many points in the FFT would this require? How would one apply the FFT outputs to feed a low pass filter to convert the signal back to real domain? Any advice on how to do this or sample code to learn from would greatly be appreciated... Thanks, Jay
Simple 150hz Low Pass Fiter using FFT?
Started by ●January 3, 2008
Reply by ●January 3, 20082008-01-03
Jay wrote:> Hi All, > > I'm looking to create a simple low pass filter in VC++ and was wondering > what would the best / fastest way to do this. > > The signal I would like to decode is the subaudible 100hz to 200hz, 150bps > waveform from voice comms in radio trunking systems.My hearing is pretty bad at high frequencies, and maybe at low also (it hasn't been checked lately.) Still, 60 Hz hum can annoy me greatly. How do you come to call 200 Hz "subaudible"? Is the number a typo?> If using a sampling rate of 22050 hz to apply to the filter, how many > points in the FFT would this require? > How would one apply the FFT outputs to feed a low pass filter to convert the > signal back to real domain?How would you use the FFT? Have you considered an IIR or FIR filter?> Any advice on how to do this or sample code to learn from would greatly be > appreciated...Read the chapters on filtering in the on-line book at http://dspguide.com/ or get an introductory book on DSP. I recommend http://tinyurl.com/24vx7h if Smith's book doesn't suffice. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Reply by ●January 3, 20082008-01-03
On 2008-01-04, Jay <crazy__c@hot_mail.com> wrote:> I'm looking to create a simple low pass filter in VC++ and was wondering > what would the best / fastest way to do this.I'd develop this kind of thing in Matlab/Octave/Scilab and then translate to VC++ once your algorithm was working.> The signal I would like to decode is the subaudible 100hz to 200hz, 150bps > waveform from voice comms in radio trunking systems.You'll also need to know the modulation. WWV has a 100Hz subcarrier with pulse-width modulation containing the BCD time information. You can probably find several examples that decode it. -- Ben Jackson AD7GD <ben@ben.com> http://www.ben.com/
Reply by ●January 4, 20082008-01-04
"Jay" <crazy__c@hot_mail.com> a �crit dans le message de news: j1gfj.2597$HL1.295@newsfe21.lga...> Hi All, > > I'm looking to create a simple low pass filter in VC++ and was wondering > what would the best / fastest way to do this. > > The signal I would like to decode is the subaudible 100hz to 200hz, 150bps > waveform from voice comms in radio trunking systems. > > If using a sampling rate of 22050 hz to apply to the filter, how many > points in the FFT would this require? > How would one apply the FFT outputs to feed a low pass filter to convert > the > signal back to real domain?Hi Jay, If you plan to do an FFT of your time-domain signal, to multiply tt with a frequency mask (for example to remove all out of the band signals), and then to do an inverse-FFT to recover a time domain signal then you are EXACTLY using a FIR filter, just with a lot of extra and useless calculations. Just calculate once the iFFT of your desired frequency mask, this is the impulse response of your filter, and use it as coefficients for a FIR filter algorithm. The number of taps of this filter, which is the number of frequency bins of the FFT, is linked to the frequency resolution of your filter. For example if you need 50Hz resolution on a 22050Hz signal you will need around 500 taps. For your application you'd better use a far lower sampling rate. For more information you can read the FIR article I've published in Circuit Cellar in October 2007 (issue 207). Friendly yours, Robert Lacoste ALCIOM
Reply by ●January 4, 20082008-01-04
jay,
the number of points in FFT depends on the resolution you need.
for example the desired resolution is 50 Hz then points required
is 441 = 22050hz/50hz. since fft is more efficient if the number
of points is power of 2, the nearest number of points thus required
is 512.
you will also have to perform FFT of the low pass filter impulse
response by means of zero padding to bring it to 512 points.
filtering in FFT domain is simple, for magnitude just do
y(z) = x(z) x h(z); where x means simple multiplication
for phase you have to do
ang_y = ang_x + ang_h;
Then take the magnitude and phase information and perform inverse
512 point IFFT.
for performing decimation in time or decimation in frequency there
are many good books that you can refer.
regards
bharat pathak
Arithos Designs
www.arithos.com
>Hi All,
>
>I'm looking to create a simple low pass filter in VC++ and was wondering
>what would the best / fastest way to do this.
>
>The signal I would like to decode is the subaudible 100hz to 200hz,
150bps
>waveform from voice comms in radio trunking systems.
>
>If using a sampling rate of 22050 hz to apply to the filter, how many
>points in the FFT would this require?
>How would one apply the FFT outputs to feed a low pass filter to convert
the
>signal back to real domain?
>
>Any advice on how to do this or sample code to learn from would greatly
be
>appreciated...
>
>Thanks,
>Jay
>
>
>
Reply by ●January 4, 20082008-01-04
On Jan 4, 9:42�am, "bharat pathak" <bha...@arithos.com> wrote:> jay, > � � �the number of points in FFT depends on the resolution you need. > � � �for example the desired resolution is 50 Hz then points required > � � �is 441 = 22050hz/50hz. since fft is more efficient if the number > � � �of points is power of 2, the nearest number of points thus required > � � �is 512. > > � � �you will also have to perform FFT of the low pass filter impulse > � � �response by means of zero padding to bring it to 512 points. > > � � �filtering in FFT domain is simple, for magnitude just do > > � � �y(z) = x(z) x h(z); where x means simple multiplication > > � � �for phase you have to do > > � � �ang_y = ang_x + ang_h; > > � � �Then take the magnitude and phase information and perform inverse > � � �512 point IFFT. > > � � �for performing decimation in time or decimation in frequency there > � � �are many good books that you can refer. > > regards > bharat pathak > > Arithos Designswww.arithos.com > > > > > > >Hi All, > > >I'm looking to create a simple low pass filter in VC++ and was wondering > >what would the best / fastest way to do this. > > >The signal I would like to decode is the subaudible 100hz to 200hz, > 150bps > >waveform from voice comms in radio trunking systems. > > >If using a sampling rate of 22050 hz to apply to the filter, �how many > >points in the FFT would this require? > >How would one apply the FFT outputs to feed a low pass filter to convert > the > >signal back to real domain? > > >Any advice on how to do this or sample code to learn from would greatly > be > >appreciated... > > >Thanks, > >Jay- Hide quoted text - > > - Show quoted text -bharat pathak - Would you really multiply the magnitudes and phase as you describe? Do we know that the signal is guaranteed to be so short in duration that the resolution of the filter is the determining factor in the length of the DSP? Do you think he should use overlap and add, or overlap and save, if he uses an FFT? Do you think he should use an FFT implementation? What are some other alternatives he might try if perhaps computational efficiency is an issue? Dirk
Reply by ●January 4, 20082008-01-04
On 4 Jan, 02:32, "Jay" <crazy__c@hot_mail.com> wrote:> Hi All, > > I'm looking to create a simple low pass filter in VC++ and was wondering > what would the best / fastest way to do this. > > The signal I would like to decode is the subaudible 100hz to 200hz, 150bps > waveform from voice comms in radio trunking systems. > > If using a sampling rate of 22050 hz to apply to the filter, �how many > points in the FFT would this require? > How would one apply the FFT outputs to feed a low pass filter to convert the > signal back to real domain? > > Any advice on how to do this or sample code to learn from would greatly be > appreciated...Is this a production project or an educational project? Using the FFT in an on-line filter involves a lot of logistics with matching buffer wrap-around / end effects, shuffling data, system latency etc. There is no need to get bogged down with those sorts of implementation details unless there are very good reasons for doing so. If you want a working filter up and running quikly, use a standard IIR or FIR implementation. Rune
Reply by ●January 4, 20082008-01-04
Hi Jerry> My hearing is pretty bad at high frequencies, and maybe at low also (it > hasn't been checked lately.) Still, 60 Hz hum can annoy me greatly. How do > you come to call 200 Hz "subaudible"? Is the number a typo?My assumption from the OP was that he was using toll quality, typically 300-3000Hz. As an example, in analog two-way radios (both FRS and professional radios alike), 'subaudible' CTCSS (aka PL tones) is often used to help with squelching busy channels. CTCSS covers 67 to 250Hz. Cheers, Howard
Reply by ●January 4, 20082008-01-04
Howard Long wrote:> Hi Jerry > >> My hearing is pretty bad at high frequencies, and maybe at low also (it >> hasn't been checked lately.) Still, 60 Hz hum can annoy me greatly. How do >> you come to call 200 Hz "subaudible"? Is the number a typo? > > My assumption from the OP was that he was using toll quality, typically > 300-3000Hz.That makes his signals out of band, not subaudible. I acknowledge a serious failing, perhaps a fold-over from my borderline Asperger's youth. When people use words, my first assumption is that they mean what they say.> As an example, in analog two-way radios (both FRS and professional radios > alike), 'subaudible' CTCSS (aka PL tones) is often used to help with > squelching busy channels. CTCSS covers 67 to 250Hz.I think 'subaudible' is a bad choice of word there, except perhaps as an insiders jargon shorthand. How do you react to a presumably literate engineer who asks about a supersonic gizmo when in fact he means hypersonic? Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Reply by ●January 4, 20082008-01-04
Dirk,>Would you really multiply the magnitudes and phase as you describe? >Do we know that the signal is guaranteed to be so short in duration >that the resolution of the filter is the determining factor in the >length of the DSP? >Do you think he should use overlap and add, or overlap and save, if he >uses an FFT?As pointed out correctly by you, overlap and add or overlap and save methods have to be used to take care of boundary discontinuities.>Do you think he should use an FFT implementation? What are some other >alternatives he might try if perhaps computational efficiency is an >issue?I was assuming that somehow he has figured out that FFT is the way to go. Maybe because FFT module was lying idle in his design which he wanted to use for this purpose. Since the filter bandwidth is very small w.r.t Fs he can use a two stage interpolated FIR scheme. This will be computationally very efficient. Bharat






