% SCALDMO demo script on the scalogram.
%
% SCALDMO is a demo script that illustrates the capabilities
% of the scalogram function using the Morlet wavelet for
% the signal analysis.
%
% SCALDMO may be accessed from the WTDEMO command interactive
% menu, choosing the 'Scalogram' demo section.
%--------------------------------------------------------
% Copyright (C) 1994, 1995, 1996, by Universidad de Vigo
%
%
% Uvi_Wave is free software; you can redistribute it and/or modify it
% under the terms of the GNU General Public License as published by the
% Free Software Foundation; either version 2, or (at your option) any
% later version.
%
% Uvi_Wave is distributed in the hope that it will be useful, but WITHOUT
% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
% FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
% for more details.
%
% You should have received a copy of the GNU General Public License
% along with Uvi_Wave; see the file COPYING. If not, write to the Free
% Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
%
% Author: Santiago Gonzalez Sanchez
% Nuria Gonzalez Prelcic
% e-mail: Uvi_Wave@tsc.uvigo.es
%--------------------------------------------------------
echo on;
%--------------------------------------------------------
% Let f(t) be a continous signal and F(a,b) its continous wavelet
% transform. The representation of the modulus of the transform
% (or its phase, if it is a complex signal) in the (b,a) open
% half-plane is called a scalogram. The shift b is arbitrary and
% the scale a is strictly positive (a>0).
% The most used prototype function for signal analysis is the
% Morlet wavelet (a windowed complex exponential). The "morletw"
% function calculates this complex wavelet at any scale and
% sampled at the specified rate. Figure 1 shows its real and
% imaginary part at scale 1 and a sampling rate of 400 Hz, and
% taking the second as time unit.
[w,t]=morletw(400,1);
figure(1)
subplot(211); plot(t,real(w)); title('Real part')
subplot(212); plot(t,imag(w)); title('Imaginary part')
% Press any key to continue ...
pause
% --------------------------------------------------------
echo off
clear w
echo on
% The "scalog" function returns the scalogram of a finite length
% signal sampled at a certain rate. It uses the Morlet wavelet
% as the analyzing function. We have to set the minimum and
% maximum scale of the wavelet transform and the step between
% them. Now, we will see some example signals and their corresponding
% scalograms.
% In figure 1 you can see the first example signal: a rectangular
% pulse which has been sampled at 8 kHz.
x=[zeros(1,362) ones(1,300) zeros(1,362)];
subplot(111); plot(x)
% Now we are going to compute its scalogram from scale 1 to 20,
% with step 0.3:
figure(2)
% Please, wait ...
[sc,t,s]=scalog(x,8e3,1,20,0.3);
% We can display the modulus of the transform with a 2-D plot, using
% "show". The holes appearing in the scalogram are due to destructive
% interference between the analyzing wavelets.
colormap('pink')
show(abs(sc),1,t,s);
xlabel('Time'); ylabel('Scale')
% Press any key to continue ...
pause
%--------------------------------------------------------
% To obtain a 3-D plot we can use the "srf" function:
figure(3)
colormap('pink')
srf(abs(sc),5,5,t,s);
% On the scalogram of a signal you can clearly detect abrupt changes
% in it or in its derivatives. This is due to the good time localization
% of the wavelet transform at low scales.
% You can observe this in the preceding example, where the start and the
% end of the pulse are very sharp transitions. These changes lead to local
% maxima in the modulus of the WT.
%
% You can see this clearly in figure 3.
% When the scale grows, the analyzing wavelet dilates and then the
% scalogram focuses on long term details (the pulse itself).
% Press any key to continue ...
pause
%--------------------------------------------------------
echo off
clear s t sc
echo on
% You can set the time unit for Morlet wavelet at scale 1 or use the
% default value, which is approximated according to the input sampling
% rate. The effect of taking a shorter time unit is equivalent to decrease
% the values of the employed scales. On the other hand, a longer time
% unit corresponds to increase the scale (the prototype wavelet dilates).
% For our example signal, let us set the time unit to 0.5 ms (half the
% default value of 1 ms):
% Please, wait ...
colormap('pink')
[sc,t,s]=scalog(x,8e3,1,20,0.3,0.5e-3);
show(abs(sc),1,t,s)
xlabel('Time'); ylabel('Scale')
% As you can observe in the figure, the effect is similar to divide by 2 the
% scale values of the specified range (1 to 20).
% Press any key to continue ...
pause
%--------------------------------------------------------
echo off
clear s t sc
echo on
% Now, setting the time unit to the double of the default value.
% Please, wait ...
[sc,t,s]=scalog(x,8e3,1,20,0.3,2e-3);
show(abs(sc),1,t,s)
xlabel('Time'); ylabel('Scale')
% It is equivalent to use higher scales in the analysis.
% Press any key to continue ...
pause
%--------------------------------------------------------
echo off
close(2);close(3)
clear s t sc
echo on
% Now, we are going to calculate the scalogram for a finite signal
% composed by two tones starting and finishing at different instants.
% For example, let us take 80 and 240 Hz tones, sampled at 8 kHz:
x=[cos((2*pi*80/8000)*(0:723)) zeros(1,300)]+...
[zeros(1,400) cos((2*pi*240/8000)*(0:623))];
plot(x)
% The duration of the signal is 128 ms. The tone of lowest frequency
% finishes 37.5 ms before the end of the signal and the other one
% begins 50 ms later Figure 1 depicts this signal.
% Press any key to continue ...
pause
%--------------------------------------------------------
% We analyze the signal using the "scalog" function, with the scale ranging
% from 1 to 14 and a step of 0.1.
% Please, wait ...
figure(2); colormap('pink')
[sc,t,s]=scalog(x,8e3,1,14,0.1);
show(abs(sc),1,t,s)
xlabel('Time'); ylabel('Scale')
% Figure 2 shows its scalogram, where you can notice the presence of two
% parallel strips of constant scale, corresponding to each one of the tones.
% Moreover, you can observe their points of start and end.
% Press any key to continue ...
pause
%--------------------------------------------------------
echo off
clear s t sc
echo on
% In order to achieve a high temporal resolution, we calculate the transform
% at lower scales:
figure(3); colormap('pink')
[sc,t,s]=scalog(x,8e3,0.3,0.75,0.03);
show(abs(sc),10,t,s)
xlabel('Time'); ylabel('Scale')
% Figure 3 shows these 'zoomed' analysis of the signal.
% Press any key to continue ...
pause
%--------------------------------------------------------
echo off
clear s t sc
close(2); close(3)
echo on
% Now, let us consider a a 'chirp' signal, as depicted in the figure.
% The frequency grows linearly from 120 to 240 Hz, and the sampling
% rate is 8000 Hz again.
w=(2*pi*120/8000)*(1+(0:1023)/512);
x=cos(w.*(0:1023)); plot(x)
% We calculate its scalogram for the scales from 1 to 10, with a step 0.1
% between them. You can see it in figure 2.
% Please, wait ...
figure(2); colormap('pink')
[sc,t,s]=scalog(x,8e3,1,1
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
压缩感知(Compressed sensing),也被称为压缩采样(Compressive sampling)或稀疏采样(Sparse sampling),是一种寻找欠定线性系统的稀疏解的技术。压缩感知被应用于电子工程尤其是信号处理中,用于获取和重构稀疏或可压缩的信号。
资源推荐
资源详情
资源评论
收起资源包目录
压缩感知 压缩采样 稀疏采样 (139个子文件)
main.asv 554B
forman.bmp 100KB
lena256.bmp 65KB
COPYING 18KB
scaldmo.m 10KB
iwt.m 9KB
formatdm.m 8KB
basisdmo.m 8KB
wvt2ddmo.m 7KB
wspl_dmo.m 7KB
mrs__dmo.m 7KB
siteband.m 7KB
remezdmo.m 7KB
flat_dmo.m 6KB
basis.m 6KB
wp2d_dmo.m 6KB
daub_dmo.m 6KB
startup.m 6KB
wt.m 6KB
remezwav.m 6KB
syml_dmo.m 5KB
wt___dmo.m 5KB
wp_dmo.m 5KB
scalog.m 5KB
prune2d.m 5KB
btlmrdmo.m 5KB
bas2ddmo.m 5KB
reg__dmo.m 5KB
wpk.m 5KB
fmt2ddmo.m 5KB
genimg.m 5KB
iwpk.m 5KB
inss2d.m 5KB
symlets.m 5KB
prunenon.m 4KB
wpk2d.m 4KB
nss2d.m 4KB
siteaux.m 4KB
pruneadd.m 4KB
inssffb.m 4KB
growadd.m 4KB
chformat.m 4KB
format2d.m 4KB
nssffb.m 4KB
bandsite.m 4KB
grownon.m 4KB
iwpk2d.m 4KB
wavelet.m 4KB
morletw.m 4KB
daub.M 4KB
bandins.m 4KB
bandmax.m 3KB
wavepack.m 3KB
insband.m 3KB
mres2d.m 3KB
maxflat.m 3KB
bandadj.m 3KB
multires.m 3KB
tree.m 3KB
coefext.m 3KB
gnimgdmo.m 3KB
isplit.m 3KB
tfplot.m 3KB
wtmethod.m 3KB
calhpf.m 3KB
wspline.m 3KB
bandext.m 3KB
regdaub.m 3KB
fc_cceps.m 3KB
localext.m 3KB
band2d.m 3KB
center.m 2KB
discplot.m 2KB
extband.m 2KB
lemarie.m 2KB
detail.m 2KB
tempreg.m 2KB
srf.m 2KB
show.m 2KB
trigpol.m 2KB
aprox.m 2KB
remezflt.m 2KB
specreg.m 2KB
maxrsize.m 2KB
band2idx.m 2KB
Contents (2).m 2KB
split.m 2KB
invcceps.m 2KB
cmpnum.m 2KB
wtcenter.m 2KB
elmin.m 2KB
cmparea.m 2KB
weaklp.m 2KB
cwent.m 2KB
wtdemo.m 2KB
rh2rg.m 2KB
atang1.m 2KB
lphrec.m 2KB
wvltsize.m 2KB
nrm.m 2KB
共 139 条
- 1
- 2
资源评论
wouderw
- 粉丝: 334
- 资源: 2961
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功