LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Make FFT of Audio-Signal, edit spectral info and inverse FFT

Hey LabVIEW'ers,

 

I'm having an audio signal as input. Next, I'm performing an FFT (power spectrum). My task is to "delete" some frequencies which meet certain criteria (not discussed here). After that, I have to invert FFT back to a sound wave. I have the following questions:

 

- What kind of FFT is suited best for my goal (Power Spectrum, Complex, Magnitude/Phase)?

- I'm performing a peak-search and those peaks who meet the "criteria" will be set to zero. Is this the correct way to "delete frequencies"? It kinda feels unprofessional to just set them to zero...

- I've tried several methods, but the inverse FFT always results in nosense waveforms. They should look similar to the input. I guess I'm missing the Phase at the inverse transform? Also, the time-scale doesn't correspond with the input.

 

Any hints are appreciated. If you need further explaination, just let me know.

 

2014-05-06 12_59_45-d20041 - Remotedesktopverbindung.png

0 Kudos
Message 1 of 6
(6,400 Views)

You certainly need all the information, both amplitude and phase.

 

The basic FFT VI produces a complex array as output. All the other spectral VIs probably call FFT.vi internally. I would probably use the simple FFT VI because then I would know exactly how i was manipulating the output data.

 

As for the "correct" way to delete components, it may depend on the nature of the spectrum and exactly what you are doing with the results. Because of spectral leakage you may not be able to simply set certain amplitudes to zero. Setting the phase component to zero may result in a phase jump if the adjacent components are non-zero. It might be better to set the deleted components to values interpolated from data in nearby bins.

 

Can you tell us more about the original signal and about what you expect the output to look like? Is there a theoretical basis for what you want to do - in terms of the mechanism which generates the signal?

 

Without seeing your data and your algorithm for selection, it is hard to give specific advice.

 

Lynn

0 Kudos
Message 2 of 6
(6,364 Views)

Hey Lynn,

 

The input comes from a mechanical spring which vibrates and generates soundwaves which were recorded and saved in a TDMS file.

The goal is to analyze the sound of that spring and one part is to detect "hidden frequencies". Hidden means that because of the spectral constellation, the human hear can't distinguish them between more dominant frequencies. I want to identify these "hidden frequencies" and delete them, so that only the dominant frequencies remain.

 

In theory, the output should look slightly different when plotting the graph, but one should hear no different when the audio signal is played back.

 

I don't think I have to go into details about the theoretical background of the criteria of these hidden frequencies, but it may make a difference that the hidden frequencies lie very close to dominant frequencies. They are only a few Hertz apart.

 

In terms of the inverse FFT, see the attached screenshot of my current code (which produces garbage output). For a start, I just wanted to inverse FFT the input without deleting any frequencies. I'll try your hint with the complex output.

 

2014-05-07 08_41_41-d20041 - Remotedesktopverbindung.png

0 Kudos
Message 3 of 6
(6,348 Views)

I do not have the Sound and Vibration toolkit, so I do not know what is in that spectrum VI.

 

If you are trying to separate frequencies which are close together, you must make sure that your FFT has sufficient resolution. FRom the Detailed Help for FFT.vi:


   The frequency resolution, or the frequency spacing between the components of Y, is:

        df = fs/N

   where fs is the sampling frequency.


 

To be sure that you can separate the signals df should be small enough that the signal components are more than df apart. Actually, df needs to be small enough that the spectral leakage can also be separated. Ideally there would be at least one bin at baseline between the bins containing the dominant component and the bins containing the hidden component.

 

What is the sampling rate? What are the typical frequencies of two of the components you want to separate? Are there any non-linearities in the physical system (including microphone and preamplifier) which migh cause intermodualtion between the dominant and hidden frequencies?

 

Lynn

 

0 Kudos
Message 4 of 6
(6,324 Views)
Can you please forward the block diagram for the above example,my waveform is attached below.for this i have to take fft
0 Kudos
Message 5 of 6
(5,464 Views)

can you sent me the whole block diagram

 

0 Kudos
Message 6 of 6
(5,463 Views)