Download presentation
Presentation is loading. Please wait.
Published byEmil Russell Modified over 8 years ago
1
Phase Vocoder Marlon Smith
2
Split into amplitude and phase %do the windowing, stored in seperate %sections for FFT for m=0:1:(loopsentinel-(win/Ra)) for n=1:win windoweda1(m+1,n) = a1((Ra*m)+n) * h(n); end %cyclic shift sound a1 temp=windoweda1; for m=1:size(windoweda1) for n=1:(win/2) temp(m,n)=windoweda1(m,n+1024); temp(m,n+(win/2))=windoweda1(m,n); end windoweda1=temp; %take the fft of the windowed pieces for m=1:(size(windoweda1)) fftwindoweda1(m,:) = fft(windoweda1(m,:)); fftamplitude(m,:) = abs(fftwindoweda1(m,:)); fftphase(m,:) = angle(fft(windoweda1(m,:))); end
3
Time Stretching Window Cyclic Shift FFT for m=2:(size(fftphase)) %correct phase for time stretch for n=2:win fftphase(m,n) = (Rs/Ra) * ( (2*pi*n/2048)*1024 + princarg(fftphase(m,n) - fftphase(m-1,n) - (2*pi*n/2048)*1024)); end IFFT Cyclic Shift for m=1:1:(windowedfinalsize) for n=1:win output((m-1)*Rs+n) = output((m-1)*Rs+n) + windowedfinal(m,n); end
4
Pitch Shifting Window Cyclic Shift FFT IFFT Cyclic Shift Overlap Add for m=1:(size(fftamplitude)) %resample in frequency domain to get pitch shift fftamplituderesamp(m,:)=resample(fftamplitude(m,:),2,3); fftphaseresamp(m,:)=resample(fftphase(m,:),2,3); end clear fftamplitude; clear fftphase; fftamplitude=fftamplituderesamp; fftphase=fftphaseresamp;
5
Robotization Window Cyclic Shift FFT IFFT Cyclic Shift Overlap Add for m=1:size(fftphase) for n=1:win fftphase(m,n) = 0; end
6
Whisperization Window Cyclic Shift FFT IFFT Cyclic Shift Overlap Add % randomize phase to get whisperization effect fftphase=(2*pi*rand(size(fftphase),win)-pi);
7
Denoising Window Cyclic Shift FFT IFFT Cyclic Shift Overlap Add % set all amplitudes below threshold to zero for m=1:size(fftamplitude) for n=1:win if (fftamplitude(m,n) < 1) fftamplitude(m,n) = 0; fftphase(m,n) = 0; end
8
Wah-Wah Filter in Frequency Domain Window Cyclic Shift FFT IFFT Cyclic Shift Overlap Add fb=100; fs=8000; Ts=1/6; c = (tan(pi*fb/fs)-1)/(tan(2*pi*fb/fs)+1); for m=1:(size(fftamplitude)) fc(m)=1000+(3000*(0.5+0.5*sin(2*pi*1*m*Ts)));% variation of center frequency from 1 kHz to 4 kHz d=-cos(2*pi*fc(m)/fs); for n=1:2048 % rebuild the filter with a new center frequency A(n)=0.5*(1-((-c+d*(1-c)*exp(-1i*2*pi*n/2048)+exp(-1i*4*pi*n/2048))/(1+d*(1-c)*exp(-1i*2*pi*n/2048)-c*exp(-1i*4*pi*n/2048)))); end for n=1:2048 fftamplitude(m,n) = fftamplitude(m,n)*A(n); end
9
Questions?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.