Wavelet display problem - marked difference in frequency content between 'contour' and 'imagec'
Mostrar comentarios más antiguos
Dear all, I analyze a test signal containing two sinus waves of 100Hz and 300 Hz with an wavelet transformation (code attachted). When I display the result with the 'contour' plot, the centre frequencies appear correctly at 100Hz and 300Hz, while when I display the same variables with the imagec command the centre frequencies appear at around 125Hz and 350Hz. Where does such difference stem from and how can I force the imagec to display the frequency content correctly? Looking forward to your explanation. Best, Peter
WaveT='morl';
fs = 2e4;
t = 0:1/fs:2-1/fs;
x = 2*cos(2*pi*100*t).*(t<0.500)+3*cos(2*pi*300*t).*...
(t>0.500 & t <1)+randn(size(t));
dt = 1/fs;
figure
subplot(3,1,1)
title('signal')
plot(t,x);
subplot(3,1,2)
fc = centfrq(WaveT);
dt=1/fs;
minscale = centfrq(WaveT)/(300*dt);
maxscale = centfrq(WaveT)/(100*dt);
scales = minscale-10:maxscale+10;
Coeffs = cwt(x,scales,WaveT);
F = scal2frq(scales,WaveT,1/fs);
contour(t,F,abs(Coeffs));
xlabel('Time'); ylabel('Frequency');
axis xy
title('contour')
subplot(3,1,3)
imagesc(t,F,abs(Coeffs));
xlabel('Time'); ylabel('Frequency');
axis xy
title('imagec')
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Contour Plots en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!