LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Frequency domain filter to time domain filter

Solved!
Go to solution

Hi,

 

I'm trying to apply A-weighting filtering to an audio signal.

 

I'm to plot the filter response in frequency domain.

 

How can I transform this to a time domain filter and use it with a real audio signal ?

 

 

0 Kudos
Message 1 of 14
(5,902 Views)
Solution
Accepted by adcpc
In the theory this is quite simple. You take the  s-domain  transfer function, and apply bilinear transform. After some reworking you can extract the 'feed-backward' coefficients and the  'feed-forward' coefficients. These coefficients may be used as input to Labview filter functions. As I said the theory is simple, but I think it will be a hard job to do this. A-weighting is used in sound level measurements, to mimic the human hearing curve. If you are planning to use spectrum analysis in your application, you can skip the filter and instead apply your formula to the frequency bins your spectrum. This way you may save a lot of work, since you stay in the frequency domain all the time.


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
Message 2 of 14
(5,890 Views)

Actually, applying the formula directly to the spectrum is what I'm doing. However, I need to go through all the spectrum (22050 points) and this needs some computation time. As I was planning to do it in real time, a digital filter would be probably better but, as you say, it's a lot of work. I will probably keep the easiest solution.

 

Thanks

0 Kudos
Message 3 of 14
(5,887 Views)
If you calculate your correction curve in advance it should not take much time to calculate the final result. Only a simple array operation is needed. I might be able to make filter for you, if you are interested. But it will only work for a specific sample rate. Do you use 44100 as sample rate?


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 4 of 14
(5,896 Views)

I've already done the filter. But it takes some seconds to be applied.

 

Is there any way to do it better ?

0 Kudos
Message 5 of 14
(5,869 Views)

I have modified the FOR Loop you have used for computation. Modified loop is coloured and i have attached it with this post.  It works pretty fast.

Post back if you have trouble.

With regards,
JK
(Certified LabVIEW Developer)
Give Kudos for Good Answers, and Mark it a solution if your problem is solved.
Message 6 of 14
(5,867 Views)
It works really faster ! Is this the effect of the shift register ?
0 Kudos
Message 7 of 14
(5,865 Views)
Its the effect of manuipulating the local variables within the loop too many times iteratively.  Reducing the access to local variables reduces the processing time drastically.  Take the advantage of "auto-indexing" in for loops to optimize the performance.
With regards,
JK
(Certified LabVIEW Developer)
Give Kudos for Good Answers, and Mark it a solution if your problem is solved.
0 Kudos
Message 8 of 14
(5,859 Views)

Hi

You have made some progress, but your programming style is typical Labview newbie. You do not take advantage of the labview data flow. It is also very bad programming to use local variables, for cleaning up diagrams. Do NOT do it. Your use of frames is strange. They do not serve any purpose in your program, so you do not need them at all. Also you've got to ask yourself one question (Not, do I feel lucky? Smiley Very Happy ). If you input 22050 samples to a power spectrum function, how many frequency bins do I get back ;). Also what is delta f. Browse through this http://zone.ni.com/devzone/cda/tut/p/id/4278 it is a good white paper. You did the correct thinking then adding the correction curve to the powerspectrum output, But the output units from the power spectrum VIs is Vrms^2 or Vrms depending on which function used. You have to scale it to Vpk. A simple task. I have included some VIs for you to look at. My examples takes 8 msec to  execute, I guess faster if you do not have large waveform charts. So if you have .5 seconds update rate it should perform well.

Good luck with your school project

Edit Note how much faster my A weighting freq domain VI perform, compared to your. 

Message Edited by t06afre on 04-03-2009 01:00 PM


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 9 of 14
(5,845 Views)

Thanks for this answer... Learning a lot !

 

In which case are used local variables ?

 

If I have 2 loops running in parallel, both working with same variable, should I use a local variable ?

0 Kudos
Message 10 of 14
(5,823 Views)