-
Notifications
You must be signed in to change notification settings - Fork 0
/
CL_plot_all_fft_and_history.m
executable file
·95 lines (83 loc) · 2.35 KB
/
CL_plot_all_fft_and_history.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
clear all
close all
sysdir
list0=dir('g1.0a*m*r*');
n0=length(list0);
s=0;
for j=1:n0
cd (list0(j).name)
listf1=dir('0*');
n=length(listf1);
cd ('../')
str=list0(j).name;
%str(str=='r')=[];
str(str=='u')=[];
str(str=='n')=[];
str(str=='_')=[];
str(str=='z')=[];
str(str=='r')=[' '];
%str1=str;
str(str=='g')=' ';
str(str=='a')=' ';
str(str=='m')=' ';
gam=str2num(str);
G=gam(1);
A1=gam(2);
m=gam(3);
for i=1:n % i=1:n
dirnamef=[list0(j).name,'/',listf1(i).name,'/'];
%v01=load([dirname,'VIV01.DAT']);
cd(dirnamef)
disp(pwd);
%[y,t]=loadv02yt(0);
fdir=pwd;
cd ../; cd ../;
tempo=['plotting_force/',list0(j).name];
mkdir(tempo)
cd (tempo)
disp(tempo)
ttl=['G=',num2str(G),' A_1=',num2str(A1),' m=',num2str(m),' f1=',listf1(i).name,' Cylinder 2'];
pdir=pwd;
pname=[list0(j).name,'_',listf1(i).name];
f1=str2double(listf1(i).name);
ylimfft=[0 1]; disp(['ylimfft = ',num2str(ylimfft)])
plotforce(fdir,[],24000,pdir,[],pname,ylimfft,f1,4,[],A1)
cd ('../')
cd ('../')
close all
end
end
% figure(6)
% plot(t,y,'color','r') % y displacement of cylinder 2 (free)
% title(ttl)
% xlabel('t*fn2');
% ylabel('Y/D');
%
%
% print('-dpng','-r500',[pname,'_Time_history.png']);
%
% %% fft
% figure(5)
% T=t(20)-t(19);
% Fs = 1/T; % Sampling frequency % Sampling period
% L = length(y); % Length of signal
%
% Y = fft(y);
% %%
% % Compute the two-sided spectrum |P2|. Then compute the single-sided
% % spectrum |P1| based on |P2| and the even-valued signal length |L|.
%
% %% Key zero taging approximation
% zpf=2;
% Y = fft(y,zpf*L);
% P2 = abs(Y/L);
% P1 = P2(1:ceil(L/2)+1);
% P1(2:end-1) = 2*P1(2:end-1);
% f = Fs*(0:ceil(L/2))/(zpf*L);
%
% plot(f,P1)
% xlim([0 4.8]);
% title(ttl)
% xlabel('f (Hz)')
% ylabel('|A2(f)|')
% print('-dpng','-r500',[pname,'_FFT_.png']);