How to create two graph plots in one, plus scale aside?
1 次查看(过去 30 天)
显示 更早的评论
How to do this figure in MatLab?
Partial code:
M = 256; sigma = 6.0;
h = sin(+2*pi*sigma*log((1-([0:M-1]/M))-0.2));
h(1:37) = 0; h(193:M) = 0;
H= [fft(h) fft(h) fft(h)];
k = ([0:floor(M/2)-1 -floor(M/2):-1]);
S(1,:)=sum(ifft(H(1:M)))/M*ones(1,M);
for n=1:floor(M/2)-1;
W=(1./M)*exp(-n^2*k.^2/(2*M^2))...
.*exp(-2*pi*i*(n*k/M-sign(n) ...
*sigma*log(sigma+abs(n)*k/M)));
W(M/2+1:M-ceil(sigma*M/abs(n))+1)=0;
W = W/sum(W);
S(n+1,:) = ifft(H(n+M+1:n+M+M).* fft(W));
end
figure(10), contour(abs(S),'ShowText','off');
colorbar
Source code and picture, article DOI: 10.1016/j.sigpro.2004.03.015
Title: "Time-local Fourier analysis with a scalable, phase-modulated analyzing function: the S-transform with a complex window"
0 个评论
采纳的回答
Santhana Raj
2017-5-4
The trick is to use position property in subplot.
figure, subplot('position',[0.1 0.3 0.8 0.7]),contour(abs(S),'ShowText','off');xlim([0 M]);
subplot('position',[0.1 0.1 0.8 0.1]),plot(1:M,h),xlim([0 M]);
you can modify the parameters of position vector to get the exact to what you want.
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!