Skip to content

Commit 99cab05

Browse files
committed
Power spec stacked plots
1 parent e4688d8 commit 99cab05

1 file changed

Lines changed: 22 additions & 1 deletion

File tree

Analysis/SK/Scripts-in-progress/SinePowerSpec.m

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,14 @@
7979
% is in matlab or if my data can be one, or what a linear time-invariant
8080
% system is or why a Bode plot is useful
8181
%%
82+
figure();
8283
eachFreq = [0 10 30 100 200 500 1000];
8384
sf = 10000; %Hz
8485
allPSD = [];
8586
allF = [];
8687
allSize = [];
8788

88-
whichPeaks = sinePeaks;
89+
whichPeaks = sinePeaksPD;
8990
% ally = []; %for plotting fft magnitude and phase
9091
% allf_fft = [];
9192

@@ -147,6 +148,26 @@
147148
set(gca,'children',flipud(chH));
148149
plotfixer;
149150

151+
% meansByFreqPD = meansByFreq;
152+
% meansByFreqI = meansByFreq;
153+
154+
%% Plot stacked power spectra
155+
figure();
156+
yyh = cell(0);
157+
158+
for i = 1:size(meansByFreq,2)
159+
axh(i) = subtightplot(size(meansByFreq,2),1,i,0.02,0.05,0.1);
160+
yyh{i} = plotyy(meanF,meansByFreqI(:,i),meanF,meansByFreqPD(:,i));
161+
set(yyh{i}, 'YScale', 'log', 'XScale', 'log','box','off');
162+
set(yyh{i}(1),'YLim',[1e-30 1e-20])
163+
set(yyh{i}(2),'YLim',[1e-10 1e0])
164+
end
165+
166+
for i = 1:size(meansByFreq,2)-1
167+
set(yyh{i},'XTickLabel',[]);
168+
end
169+
170+
150171
%% Plot steady state sine comparison
151172

152173
whichPeaks = sinePeaksNorm;

0 commit comments

Comments
 (0)