LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

frequency shift

After calculating the FFT of a waveform in the time domain, how do I shift the frequency to a more audible range and rebuild it back in the time domain.

 

M.Leo

0 Kudos
Message 1 of 11
(5,893 Views)
You can just shift the array of frequency information, (insert\delete elements at the begininng). A better way perhaps would be to use some of the FIR and IIR filters to affect the signal.

Regards

Jon B
Applications Engineer
NIUK
0 Kudos
Message 2 of 11
(5,849 Views)
Changing the dt may do what you want. Example in LV 8 attached.

Lynn
0 Kudos
Message 3 of 11
(5,840 Views)

 

Can you please post the same example for LabView 7.1?

Thank you
0 Kudos
Message 4 of 11
(5,631 Views)
It is really simple. After you have done an inverse FFT, you increase the dt. dt is equal to 1/(sample frequency). If I sample a 100 Hz signal with 40Khz and replay it with a dt equal to 1/(40Khz/2) it will be played as a 50Hz signal


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

The methods described by johnsold and t06afre will stretch your signal, so it will become longer and the frequencies will drop accordingly. I have a feeling this might not be what you want?

 

 The method described by  JonBowers will indeed shift your frequencies (as you requensted), if you keep the array the same length. So, if you say remove the first 1000 Hz, 2000 Hz will become 1000 Hz, 4000 Hz will become 3000 Hz, etc. In other words, any harmony that may have been in the signal will be lost.

Adding (empty) elements at the end of the FFT will again cause the resulting signal to have a dropped frequencies and be longer as well.

 

I don't know how to "properly" deal with resampling (if there is such a way), just thought I'd point it out.

 

[edit]

but you might want to take a look at http://en.wikipedia.org/wiki/Sample_rate_conversion 

[/edit]

Message Edited by Jacco K on 01-14-2009 05:08 AM
Message Edited by Jacco K on 01-14-2009 05:09 AM
0 Kudos
Message 6 of 11
(5,603 Views)

As I know from signal theory. To move signal spectrum on a frequency domain, you should multiply that signal by COSINE. Example, you have a signal s(t) at 500Hz. You want to shift that signal in frequency domain to DC axis. Then you got your expression like this: cos(500*2*pi*t)*s(t). By changing that cos(2*pi*f*t) "f" you can move your signal.

 

Correct me if I'm wrong

0 Kudos
Message 7 of 11
(5,584 Views)

Here is some basic FFT(DFT) information. Say I have sampled a 10.0000 Hz sinus wave with a offset=1 volt and amplitude=1 volt (100% noise free) with 1 Khz sample rate. If I a run FFT on this signal using the "Real fft.vi" function. I will get an array with 1000 frequency bins. The frequency resolution will be equal to (Fsample/(number of samples)). The first bin (index 0) is the DC component equal to the mean value. Since I have a sinus wave equal to 10 Hz I will find this sinus wave weight in the bin at index 10 and index 1000-10. (equal to signal frequency/resolution, and num. of samples-index). If I have had 2000 samples, the bins would have been equal to 20, and 2000-20. This example is correct. But for real world signals we will always experience a phenomenon called spectral leakage. You will see this if you change the signal frequency to say 10.265 Hz. Anyway If you want to do some frequency shifting using FFT and Inverse FFT. All you do is to shift the frequency bins around, or delete them. If I set the values at index 0 and do a inverse FFT I will remove the DC component. So let us say I have 1000 samples and I want to move delete all frequencies from DC and up to 100 Hz, and shift the frequency in range 200 to 300 down to this area. To accomplish this I move all indexes from 200-300 down to the index (0....n+i) where i =0 to 100. But I also have to move all indexes starting at index 1000-300, and ending at 1000-200, to index (900....n+i) where i=0 to 100. I also think the value at index 0 and 100 have to be multiplied with 2. I have omitted lots of details ;). 



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

I wrote this, but due to incoming phone calls I lost my focus and made some errors. Sorry for that

----------------------------------------------------------------------------------------------------------------------------------------- 

 

But I also have to move all indexes starting at index 1000-300, and ending at 1000-200, to index (900....n+i) where i=0 to 100. I also think the value at index 0 and 100 have to be multiplied with 2.

 ----------------------------------------------------------------------------------------------------------------------------------------- 

This have to be corrected to

But I also have to move all indexes starting at index 1000-300, and ending at 1000-200, to index (900....n+i) where i=0 to 99. I also think the value at index 0 has to be multiplied with 2.

Message Edited by t06afre on 01-14-2009 04:49 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 11
(5,567 Views)
Ah yes, you're right, I completely forgot about the mirror'ed side of the FFT, since I usually cut that off. Oh well, looks like the OP's question has been solved long ago, so no harm done I guess.
0 Kudos
Message 10 of 11
(5,544 Views)