splitted ReadUI.m into FFT_time2freq.m and itself
parent
2409a77399
commit
61f99dfd3d
|
@ -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));
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue