How can I rebuilt a similar time series with less frequencies after performing an fft?
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello there,
I've been facing a problem for some time and I hope someone can help me on that.
I am using the fft on a signal (water waves elevation) in order to get its corresponding spectrum. As I want to simulate a similar signal in the time domain, I need to know the frequencies and their corresponding amplitude. Besides, each of the frequency is also needed for computing a wave force related to it and applying on a body.
I would like to "cut" the frequency range I take into consideration as after a certain value their amplitudes are so small that they are irrelevant for the force calculation and do not affect much the water wave elevation signal.
I tried to do it for various number of frequencies, but every time I have the new time series and that I perform an fft on it, I always have lower amplitudes than the original ones, and for this reason I simply can not use it.
I join hereinafter an example of what I am doing:
fq = 100; %Hz (Sampling time 0.01)
L1 = length(xx2); % xx2 is the original waves elevation signal
NFFT = 2^nextpow2(L1);
Y1 = fft(xx2,NFFT); %Fourier transform of the signal
Y11 = abs(Y1(1:NFFT/2+1)); %Selection of the left-hand side of the fft
f = fq/2*linspace(0,1,NFFT/2+1); Frequency vector correponding to Y11 [Hz]
wi = 2*pi()*f; %Conversion of f from Hz to rad.s-1
Y_norm = Y11/L1; %Normalisation of the experimental time serie FFT;
figure;plot(wi,Y_norm);
wn = 0:0.04:10.22; %Vector of desired frequencies
m3 = zeros(size(wn));
p0=0;
for k = 1:length(wn)
p = find(wi>=wn(k),1);
m3(k) = sum(Y_norm(p0+1:p));
p0 = p;
end
In this last part I try to take into account the frequencies from the fft which are smaller than the ones I'm aiming at to get the corresponding frequency.
t = 0:0.01:200;
yt = zeros(length(t),1);
teta = 2*pi*rand(size(m3));
for j = 1:length(t)
yt(j) = sum(m3.*cos(wn*t(j)+teta) );
end
This is for recomposing a similar time series with new phases. My problem is that everytime I try to apply an fft to the "yt" signal, I obtain a spectrum with more or less the same shape, but lower amplitudes than in the original one, thus preventing me to go further...
I thank you for any help or suggestion you can give me.
Matthieu
1 commentaire
Réponses (1)
Youssef Khmou
le 26 Mar 2013
Modifié(e) : Youssef Khmou
le 26 Mar 2013
hi, try this modified version :
% ORIGINAL SIGNAL
fq = 100; %Hz (Sampling time 0.01)
t = 0:1/fq:200;
wn = 0:0.04:10.22; %Vector of desired frequencies
xx2=0;
for n=1:length(wn)
xx2=xx2+cos(2*pi*t*wn(n));
end
xx2=xx2/length(wn);
figure, plot(t,xx2);
AX=axis;
% FORWARD DISCRET FOURIER TRANSFORM
L=length(xx2);
N=ceil(log2(L));
fxx2=fft(xx2,2^N)/L/2;
f=(fq/2^N)*(0:2^(N-1)-1);
FF=abs(fxx2(1:end/2));
figure, plot(f,FF)
% RECONSTRUCTION : NOT FINISHED YET
wn = 0:0.04:10.22; %Vector of desired frequencies
m3 = zeros(size(wn));
p0=0;
for k = 1:length(wn)
p = find(f>=wn(k),1);
m3(k) = sum(FF(p0+1:p));
p0 = p;
end
t = 0:0.01:200;
yt = zeros(length(t),1);
teta = 2*pi*randn(size(m3));
for j = 1:length(t)
yt(j) = sum(m3.*cos(wn*t(j)+teta) );
end
figure, plot(t,yt); axis(AX);
% FORWARD DISCRET FOURIER TRANSFORM of the RECONSTRUCTED SIGNAL
fyt=fft(yt,2^N)/L/2;
f=(fq/2^N)*(0:2^(N-1)-1);
FY=abs(fyt(1:end/2));
figure, plot(f,FY)
We discuss it , next....
0 commentaires
Voir également
Catégories
En savoir plus sur Discrete Fourier and Cosine Transforms dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!