Using Ak and Bk to find the inverse Fourier transform
3 views (last 30 days)
Show older comments
So I have t and y that are raw data, T and Y that are sampled data, and now i'm finding a new data set (time_vector, fI) that I am finding from my coefficients Ak and Bk. I don't want to overwhelm or don't add what isn't necessary to this question so this is only a part of the code. This part of the code is what I'm using to find the inverse DFT. This equation is what the inverse discrete fourier transform is.
%from the book example:
%frequency = 1600 Hz
%tau = 0.05;
%t = linespace(0,tau, 800)
%time_vector = linspace(0,tau,400)
%my problem:
kL = length(kp);
time_vector = linspace(0,Ti,%??);
pi2Ti = 2*pi/Ti;
for j = 1:2*N
fI(j) = 0;
for k = 1:kL
fI(j) = fI(j) + Ak(k)*sin(pi2Ti*(k-1)*time_vector(j)) + Bk(k)*cos(pi2Ti*(k-1)*time_vector(j));
end
end
figure
plot(t,y,'k',T,Y,'oc',time_vector,fI,'--c','markersize',15,'LineWidth',1)
legend('f(t)','Sampled f(t)','Inverse DFT of f(t)')
0 Comments
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!