Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How do you convert from frequency to time domain??

Status
Not open for further replies.

virginiatech

Newbie level 2
Joined
May 6, 2010
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,295
I have a set of data in the frequency domain. It is a matrix with the first row as real values and the second row as complex values. I know the sampling frequency is 0.01 Hz. How do I convert and plot this in the time domain?
 

Convert from frequency domain (real/imag) to time domain?

I do not have matlab with me now, but it is something like:
Code:
x=ifft(data(1,:)+i*data(2,:));
plot(x)
 

Convert from frequency domain (real/imag) to time domain?

Yeah I tried that already but for some reason it's not coming out right. This is my code thus far:

Fs = 0.01; % sampling frequency
T = 1/Fs; %sample time
N = length(data); %length of signal
t = (0:N-1)/N; % define time
t = t*T; % define time in seconds

realData = data(1,:);
imagData = data(2,:);
FinalData = realData + 1i.*imagData;

figure; plot(t,abs(ifft(FinalData)))

This is not working!! Please help!!
 

First of all, you should not use abs for the ifft. Second, is the input data coming from an fft or is it generated by some software? In order to calculate the ifft, you need an array of complex data where the second N/2 samples are conjugate of the first N/2 samples (and flipped). Here is the formula:
Code:
plot(ifft([Y(1:N/2) -Y(1) fliplr(conj(Y(2:N/2)))]*N))
where Y is your FinalData and N/2 is your N.
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top