Inverse FFT question
Inverse FFT question
(OP)
Hi,
I am trying to shift the frequency spectrum of a signal by a fixed amount. A phase vocoder multiplies all frequencies by a fixed factor (for example, a factor of 2 moves 2Hz to 4Hz, 6Hz to 12Hz and so on) but I wish to move every frequency by a set amount (say, add 2Hz so that2Hz to 4Hz, 6Hz to 8Hz).
To do this I was hoping it would be possbile to simply shift the frequency spectrum by the desired amount, and then convert this into the time domain via the inverse Fourier transform.
Basically I'm not really sure how to get from the frequency spectrum back to the time domain.
Any help would be appreciated,
Thanks,
Jonny
I am trying to shift the frequency spectrum of a signal by a fixed amount. A phase vocoder multiplies all frequencies by a fixed factor (for example, a factor of 2 moves 2Hz to 4Hz, 6Hz to 12Hz and so on) but I wish to move every frequency by a set amount (say, add 2Hz so that2Hz to 4Hz, 6Hz to 8Hz).
To do this I was hoping it would be possbile to simply shift the frequency spectrum by the desired amount, and then convert this into the time domain via the inverse Fourier transform.
Basically I'm not really sure how to get from the frequency spectrum back to the time domain.
Any help would be appreciated,
Thanks,
Jonny





RE: Inverse FFT question
% Create a test signal
t=(0:1023)'/1024;
x1=cos(20*2*pi*t);
z=cos(10*2*pi*t); % 10Hz cosine for a 10Hz shift
% Shift original by +10Hz
x2=real(hilbert(x1).*hilbert(z));
RE: Inverse FFT question
Can I just ask how close is "too close" to the Nyquist frequency, and what sort of effects would I expect to see if there were some frequency components close to Nyquist?
Cheers,
Jonny
RE: Inverse FFT question
You just need to be aware of this before trusting your results. I guess in practice you could low-pass filter your data before the frequency shift, using one of Matlab's many filter design functions.
RE: Inverse FFT question
Thanks again!
Jonny
RE: Inverse FFT question
i.e.
dataTimeDomain = rand( 1, 1024 );
dataFrequencyDomain = fftshift( fft( dataTimeDomain ); )
dataShiftedFequencyDomain = [ dataFrequencyDomain( end ) dataFrequencyDomain( 1 : ( end - 1 ) ) ];
% You will get DC shifted to 2 Hz (in your example). Is this really what you want?
RE: Inverse FFT question
I have to say SomptingGuy's hilbert transform method worked a treat.....it saves the hassle of calculating the FFT, shifting the spectrum and then obtaining a new time-domain representation from this.
Thanks anyway,
Jonny
RE: Inverse FFT question
Cheers
Greg Locock
Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.
RE: Inverse FFT question