% script to generate 3D plot of an analytic signal clc, clear, close all % read a speech signal [y,fs] = wavread('0zk_clean.wav'); % select a section of the signal % (about 300 ms section containing a vowel in this case, because give the % pretties picture) y = y(0.7*fs:fs); % let's upsample the signal 10 times for a smoother plot y = resample(y,10,1); fs = fs * 10; % find the analytic signal using the hilbert transform yh = hilbert(y); % generate a time vector t = ((1:length(yh))-1)/fs; % plot the real and imaginary parts of y1h versus time in a 3d plot figure(1) plot3(t,real(yh),imag(yh)) grid on axis tight % you can select a more interesting viewpoint with the % Figure's "Rotate 3D" button % FANCY VERSION: fprintf(1,'Plotting figure 2, please wait...\n'); [y,fs] = wavread('0zk_clean.wav'); y = y(0.7*fs:fs); yh = hilbert(y); t = ((1:length(yh))-1)/fs; uc = exp(1j*linspace(0,2*pi,100)); H = length(uc); yy = real(uc)' * abs(yh)'; zz = imag(uc)' * abs(yh)'; figure(2) h = surf(repmat(t,H,1),yy,zz,repmat(abs(yh)',H,1)); set(h,'facelight','phong','facealpha',0.1,'edgecolor','none'); view(-18,36); grid on fprintf(1,'Done\n');