problem with wavelet transform of voice signal

1 次查看(过去 30 天)
i have taken a realtime voice signal as an input and trying to perform wavelet transform of it.... i can get the individual plotting of each increment of sampling fequency but i cant plot all the spectrum in a single 3d image Can you help me how can i get the image? i have attached my code below
play(rec);
a = getaudiodata(rec);
plot(a); L=length(a);
init_freq=0.05; final_freq=.250;
freq_inc=0.05; freq_step=(final_freq-init_freq)/freq_inc;
S_STFT=tVWFT(a,init_freq,freq_inc,final_freq); % Windowed Fourier transorm
%%%%%%%%%%%%%%%%%%%%%%%%%%% code for the function%%%%%%%%%%%%%%%%%%%%%%%%%%
function Y=tVWFT(x,wxl,wxi,wxh)
f=fopen('STFT_V.txt','w'); L=length(x);
Y=[];
for wxt=wxl: wxi: wxh
wxt=0.7;
if(wxt~=0.0)
hwl=floor(3.0/abs(wxt));
else
hwl=floor(3.0/abs(0.01*wxi));
end
wl=2*hwl+1;
win_cor=-hwl:hwl;
if L<wl
z=wl-L;
x=[x,zeros(1,z)];
end
win=exp(-win_cor.^2/2.0/wl/wl);
wave=win.*exp(i*wxt*2.0*pi*win_cor);
Y1=conv(x,wave);
Y2=Y1((hwl+1):(L+hwl));
figure;
plot(abs(Y2));
for iii=1:L
fprintf(f,'%0.2f\t',abs(Y2(iii)));
end
fprintf(f,'\n');
Y=[Y;Y2];
end
fclose(f);
figure;
imagesc(abs(Y));
end

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Signal Analysis 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by