splitted ReadUI.m into FFT_time2freq.m and itself

pull/1/head
Sebastian Held 2010-03-31 15:38:37 +02:00
parent 2409a77399
commit 61f99dfd3d
2 changed files with 10 additions and 7 deletions

9
matlab/FFT_time2freq.m Normal file
View File

@ -0,0 +1,9 @@
function [f,val] = FFT_time2freq( t, val )
dt=t(2)-t(1);
val = [val zeros(1,5000)];
L=numel(val);
f = (0:L-1)/L/dt;
f = f(1:floor(L/2));
val = 2*fft(val)/L;
val = val(1:floor(L/2));

View File

@ -18,11 +18,5 @@ for n=1:numel(filenames)
UI.TD{n}.t = t;
UI.TD{n}.val = val;
dt=t(2)-t(1);
val = [val zeros(1,5000)];
L=numel(val);
UI.FD{n}.f = (0:L-1)/L/dt;
UI.FD{n}.f = UI.FD{n}.f(1:floor(L/2));
UI.FD{n}.val = 2*fft(val)/L;
UI.FD{n}.val = UI.FD{n}.val(1:floor(L/2));
[UI.FD{n}.f,UI.FD{n}.val] = FFT_time2freq( t,val );
end