LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Equalizer

Hi,

I'm trying to implement an audio equalizer in Labview (8.0) and have some difficulty.
My program should be quite simple since the equalizer doesn't work in real time but modify an existing wav file. The biggest problem I've encountered is the reconstruction of the signal after I've split it to different frequencies using highpass and lowpass filters.
Does anyone have an idea how to combine the arrays created by the filters into a valid audio signal?
Maybe someone knows of an example of the implementation of an equalizer in Labview 8.0?

Thanks a lot,

Orel
0 Kudos
Message 1 of 10
(7,373 Views)
Orel,
 
 Are you breaking up the signal into its frequency components or just passing it through a filter? When you pass a signal through a filter VI, it returns the time domain signal with the filtered frequency. There Extract the Sine Wave.vi under the Example Finder >> Analyzing and Processing Signals >> Filtering and Conditioning is helpful in understanding the application of the filter VIs in LabVIEW.
 
To write the array data you have to a .wav file, I would recommend you to look at the 'Sound File Write Simple.vi' under the Functions palette >> Programming>>Graphics and Sound>>Sound>>Files. This VI can be used for writing LabVIEW data to .wav files.
 
As for an example for creating an audio equalizer, are you using the sound and vibration toolkit? The sound and vibration toolkit manual illustrates the implementation of an audio equalizer(Pg 15-4). The manual for the sound and vibration toolkit can be found at the following link:
 
 
I hope this helps!
 
 
 
 
Mehak D.
0 Kudos
Message 2 of 10
(7,346 Views)

Hi,

Thanks a lot for your help. I managed to reconstruct the signal and the equalizer works.

Although, I've encountered a new problem. The program takes a lot of RAM memory and therefore freezes. I noticed that the readwav.vi is using 250MB for a 20MB wav file. Therefore, any processing of the signal results in another 200MB used and in no time I get to the system freezing. Is there a reason the said vi is using that much memory? I can minimize my processing to use as little processing as possible but the first vi is crating a problem. Is there a way to solve this?

Thanks a lot,

Orel

0 Kudos
Message 3 of 10
(7,324 Views)
Would it be possible for you to put up your VIs so that I can test it out?
 
One way to optimize the use of processor is to add the 'wait until' or 'wait ms' timing VIs in all your loops. The wait ensures that the loops do not use all the processing power to run as fast as possible.
 
Let me know if that helps!
 
 
 
 
 
Mehak D.
0 Kudos
Message 4 of 10
(7,290 Views)
Hi,
I've attached my Vi's so you can test it and I'll explain again my problem.
I'm using the Snd-Read-Wav-File.vi to open a Wav file, perform the equalization process and play it (Later on I'll write the result to a new Wav file). My problem is that loading the Wav file into an array takes up to 200MB of RAM for a 20MB Wav file. Every time I duplicate the array (I do it 3 times in my program) it takes another 200MB. That means that for a small 20MB file, the program takes close to 800MB of RAM which is a big problem. I can make the program a bit more efficient by filtering each channel at a time but it still won't solve the problem since it will only save 200MB off 800 MB. The processing part of my program is really simple and doesn't take long so its not a problem.
My question is, how to make the program a lot more memory efficient? How come reading a Wav file into an array takes 10 times the memory? Is there a smarter way to open a Wav file and process it?
As an example, I added another, very simple, Vi just to show that loading a Wav file to an array uses ridiculous amounts of RAM.

Thank you very much for your help!

Orel
Download All
0 Kudos
Message 5 of 10
(7,274 Views)
This was reported to R&D (# 37575) for further investigation. R&D is currently investigating this issue. A possible work around for this would be to read the data from the .wav file in sections rather than in one large file. We appreciate your feedback!

Please let me know if you ahve any further questions on how to read the file in sections.

Thanks
Mehak D.
0 Kudos
Message 6 of 10
(7,227 Views)
Hi,

I'm glad I could help with a feedback. I didn't think this will turn out to be such a big problem. Is there a way to track R&D's progress on this matter? Maybe get a solution from them?
I tried figuring out myself how to read the wav file in sections but without success. I would appreciate any help you can give me.
I don't mind changing my equalizer to work in real time if that will help.

Thanks a lot,

Orel
0 Kudos
Message 7 of 10
(7,199 Views)
The following forum posts may help in providing a solution to this:

http://forums.ni.com/ni/board/message?board.id=170&message.id=68083&requireLogin=False

http://forums.ni.com/ni/board/message?board.id=170&message.id=147031&requireLogin=False

Let me know if this helps!


Mehak D.
0 Kudos
Message 8 of 10
(7,152 Views)
Hi,

Sorry for the delay in my response but I didn't have a lot of time to work on my equalizer this past 2 weeks.
I managed, thanks to your forum links, to break my wav file in parts but I can't manage to write it back to a different file in parts. The "Sound file write" vi doesn't have an offset control and I can't seem to add one with the "Set File Position" pallet cause the refnum's aren't the same and it gives an error. Do you have an idea how to write each part I processed to the end of the new wav file I created?
Again, thanks a lot for your help,

Orel

0 Kudos
Message 9 of 10
(7,077 Views)
If you wish to continously append the data to a wav file you will have to follow the given steps:

1. Create file and write header ( just to make room)
2. Append  data ( little endian if 16 bits) and keep count of bytes added
3. Write again the header using the correct data ( speed, mode, bits and bytes).

Refer to knowledgebase for more information on the header format. Also, the following forum posts will be helpful in providing examples to achieve the same:

http://forums.ni.com/ni/board/message?board.id=170&message.id=84357&requireLogin=False

http://forums.ni.com/ni/board/message?board.id=170&message.id=156093

I hope this helps!




Mehak D.
0 Kudos
Message 10 of 10
(7,041 Views)