Commit 4a032aa4 authored by Dany Dumont's avatar Dany Dumont
Browse files

ajout de deux scripts utiles: t_tide et dft

parent c14d038e
function [X,f]=dft(x,dt)
% [X,f]=dft(x,dt)
%
% compute the dft (discrete fourier transform) X of x,
% a time series with regular time spacing dt,
% as given by fft,
% and also return the frequencies f corresponding to X.
X=fft(x);
N=length(x);
if (mod(N,2)==0)
f=[0 [1:N/2]/N [-N/2+1:-1]/N]/dt;
else
f=[0 [1:(N-1)/2]/N [(-N+1)/2:-1]/N]/dt;
end
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment