frequency to time domain

I have magnitude and phase of signal in frequency domain and I need to have it in time domain. I know I have to use ifft function, but I heard about mirroring and concatenating these values and I'm kinda lost. I'd appreciate any help with that
I have tried doing something like this, but I'm clearly missing the point
%A - magnitude
z = A .* exp(i*phase);
X = ifft(z);
figure, plot(abs(X))
figure, plot(angle(X))
These are my magnitude and phase in frequency domain

 Accepted Answer

First, the phase must be in radians, and the highest frequency in both plots must be the Nyquist frequency for any inversion to work.
Then, experiment with this:
Fs = 2*max(frequency_vector)
t = linspace(0, 2*numel(frequency_vector), 2*numel(frequency_vector)).'/Fs; % Time Vector
z = [A(:) .* exp(1i*phase(:)); conj(A(:) .* exp(1i*phase(:)))]; % Force Column Vectors & Concatenate
X = ifft(z);
figure
plot(t, real(X))
There should not be any imaginary values in ‘X’, however they could be present although extremely small, so this would be the approach I would take. Depending upon how ‘z’ was calculated, there could be a scaling issue of numel(t)/2 that it could be necessary to multiply by to recover ‘X’ correctly.
I cannot be certain that this will work with your data, however it should at least get you started.

2 Comments

Hello
I have 2 signals and between their frequency spectrum I was expecting for a shift in frequency at maximum amplitude. I got a shift but how do I prove that this frequency shift is not because of a phase shift in time domain? I am attaching an image of the signals.
Thanks in advance
Please post this as a new Question. It does not actually pertain to this problem, and there is not enuogh information. I will delete it and this Comment in a few hours.

Sign in to comment.

More Answers (0)

Products

Asked:

on 10 Sep 2020

Commented:

on 18 Feb 2023

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!