Afficher commentaires plus anciens
Good Afternoon,
A question on the implementation of the FFT when applied to a distortion. I am using a set of polar coordinates for a cylinder that has been distorted. Background: the variation in geometry around the circumference of a distorted cylinder bore may be modeled by a general fourier series. R(theta)=sum(a_i cos(theta) +b_i sin(theta) from 0 to n where n is the order of distortion. This enables one to use the FFT algorithm. When implementing this idea: I first convert the nodal displacements into polar coordinates and then oversample said coordinates to use in an interpolation function to generate a function used for the fft. I’ll call this interpolation function p. So
%Calculate fft
Fourierfun=fft(p)
%Calculating DC component and Ntheta is number of points used
a0=2.*p(1)/Ntheta
%Calculating coefficients
for ik = 1:Ncoeffs
ij = ik +1; %index for fft
%Cosine Terms (ak)
ak(ik)=2.*(-1)^(ik).*real(p(ik))/Ntheta
%Sine Terms
bk(ik)=2.*(-1)^(j).*p(ij))/Ntheta
I think the order of distortion is sqrt(ak.^2+bk.^2) which will get me the order.
Does this seem like the correct methodology for amplitude of order of distortion?
Réponse acceptée
Plus de réponses (1)
Dr. Seis
le 30 Jan 2012
0 votes
Ok... let's start over. I found a link to the "fcoeffs_fft" code (located here: http://pastebin.com/001id7SB). Are you trying to modify this code to suite your needs? I noticed that the equations for "ak" are different between the website I listed and the one you listed before, which showed all but the last two lines of code (i.e., <http://www.mediafire.com/imageview.php?quickkey=439h3j30080hh2k&thumb=6>).
2 commentaires
Melissa
le 1 Fév 2012
Dr. Seis
le 1 Fév 2012
I don't think you need the (-1)^(ij). I tried the original code and it seemed to work for me (it reconstructed an ellipse). I haven't tried anything more complicated through. I will write out an explanation of what is going on a little later tonight.
Catégories
En savoir plus sur Linear Prediction dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!