IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
extracting sin wave from audio data
anshulthejain
post Sep 29 2003, 18:50
Post #1





Group: Members
Posts: 1
Joined: 29-September 03
Member No.: 9067



hi,

I have a query regarding digital audio data. I want to seperate a 10 Hz sin wave from a digital audio data. sin wave of frequencies 10Hz and 20 Hz are explicitly added to the audio data for some purpose.

i treid using filters but as i am getting lot of trouble designing and implementing the filter , as the sampling freq is fixed to be 44.1KHz and cant be changed.

Please suggest me some other method. Also will resonance will be a better solution.

Thanks in advance
Anshul
Go to the top of the page
+Quote Post
jmvalin
post Sep 29 2003, 19:53
Post #2


Xiph.org Speex developer


Group: Developer
Posts: 473
Joined: 21-August 02
Member No.: 3134



QUOTE (anshulthejain @ Sep 29 2003, 12:50 PM)
I have a query regarding digital audio data. I want to seperate a 10 Hz sin wave from a digital audio data. sin wave of frequencies 10Hz and 20 Hz are explicitly added to the audio data for some purpose.

i treid using filters but as i am getting lot of trouble designing and implementing the filter , as the sampling freq is fixed to be 44.1KHz and cant be changed.

Please suggest me some other method. Also will resonance will be a better solution.

There are many options. The simplest (but least effective) is to use resonant (IIR) filters tuned at 10 and 20 Hz. Another (better) is to use FFT's on windows that should be at least one second long. If you really need lots of precision and fast response, the best algorithm would probably be the MUSIC algorithm. However, it requires stuff like computation of eigenvalue/vectors and it's much more complex (both in terms of code and CPU). So only try that if all else fails.
Go to the top of the page
+Quote Post
2Bdecided
post Sep 30 2003, 09:27
Post #3


ReplayGain developer


Group: Developer
Posts: 4945
Joined: 5-November 01
From: Yorkshire, UK
Member No.: 409



what are you using to implement the filter?


People usually use IIR filters at such low frequencies, because FIR must be very long. But with modern computers, and off-line (i.e. not real time) processing, this isn't such an issue.


If you want near-perfect isolation of 10Hz from 20Hz, the time resolution will be quite poor. A couple of cycles ringing at 10Hz is 1/5th of a second.


You say you can't change the sample rate. Some processing tools (e.g. Cool Edit, MATLAB, etc etc) will simply let you lie about the sampling rate. So, say it's 176.4kHz sampled audio. Then your 10Hz becomes 40Hz, and 20Hz becomes 80Hz. These are in the audio range that most software is made to deal with. Note that it doesn't make the calculation easier at all - the filters are just as difficult (identical, in fact), but it does bring everything into the range of the GUI of these programs, so you can at least see what you're doing.


The quickest to program (but slowest to execute) would be to use a very long FIR filter. A carefully designed IIR filter would be much better - can't you make a standard design stable at these frequencies?

I'm assuming that there's nothing of interest below 10Hz, and that you can just high or low pass at ~ 15Hz. Is it more complicated than this? What are you trying to do?

Cheers,
David.
Go to the top of the page
+Quote Post
Guest_Dex4now_*
post Sep 30 2003, 12:07
Post #4





Guests






I wonder if this would be possible: Using something like Cool Edit, copy the track to a new one, (running side-by-side), invert its phase, do a simple filter above, say, 15hz on the inverted one, mix the two together.

Or something like that. Perhaps shift the frequency higher before processing, to bring it all up into the audio range first, like 2Bdecided said.

Dex
Go to the top of the page
+Quote Post
NumLOCK
post Sep 30 2003, 13:22
Post #5


Neutrino G-RSA developer


Group: Developer
Posts: 852
Joined: 8-May 02
From: Geneva
Member No.: 2002



QUOTE (2Bdecided @ Sep 30 2003, 09:27 AM)
The quickest to program (but slowest to execute) would be to use a very long FIR filter. A carefully designed IIR filter would be much better - can't you make a standard design stable at these frequencies?

Just a little precision: to meet given requirements a carefully designed IIR filter will be shorter than a carefully designed FIR. However, if you can afford the processing time a FIR filter will always be superior (or equal).


--------------------
Try Leeloo Chat at http://leeloo.webhop.net
Go to the top of the page
+Quote Post
2Bdecided
post Sep 30 2003, 14:27
Post #6


ReplayGain developer


Group: Developer
Posts: 4945
Joined: 5-November 01
From: Yorkshire, UK
Member No.: 409



I meant better, as in faster execution speed. Thanks for clarifying it, though I probably had the following in mind too...

I would expect the pre/post ring on the filter to be unmanageable, given that it should be linear phase filter (hence FIR), with a sharp cut off (which he seems to want) at such a low frequency. I'd expect him to choose to sacrifice the phase and sharpness of cut off, in order to reduce the ringing - this would make some IIR design optimal. I know you can make an FIR filter with any phase response you want, but if we're not going with linear phase, it makes sense to try a simpler IIR filter design.

Until Anshul tells us more, this is just guesswork! And I'm wary of teaching my grandmother to suck eggs.

Cheers,
David.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 21st April 2014 - 13:35