%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Multimedia Signal Synthesis at CTU Prague % Copyright © 2015 by Roman Cmejla %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Suggestions for 7th laboratory: % Cross synthesis % November 13, 2015 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Recommended links: % http://cnx.org/contents/b6d030f8-c170-4ce8-9ab0-f1237a574f30@2/contents/b6d030f8-c170-4ce8-9ab0-f1237a574f30@2/Linear_Prediction_and_Cross_Sy %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% % Example 1: Speech signal and FFT spectrum % % E - 512 samples signal1=pet1(1500:2012); N1=512; % one period E 64 samples signal2=pet1(1500:1564); N2=64; % initial P - 256 samples signal3=pet1(150:406); N3=256; % final T - 128 samples signal4=pet1(4100:4356); N4=128; psd1=(abs(fft(signal1)/N1)).^2; plot(psd1(1:N1/2)); %% % Example 2: LPC spectrum % aa1=lpc(signal1,16); fch1z=abs(freqz(1,aa1,128)).^2; plot(w/pi,fch1z); %% % Example 3: Prediction error % %% % Example 4: Prediction error and AR model order selection % %% % Example 5: LPC vocoder - different excitation (noise, impulses, prediction error) % [signal,fs] = wavread('why11.wav'); signal = signal-mean(signal); sig = signal./max(abs(signal)); N = length(sig); % VOCODER PARAMETERS window_length = 512; window_shift = round(2*window_length/3); %% % Example 6: LPC vocoder - time changes (koef1) % and frefrequency changes (koef2) koef1=0.5; % < 1 shorter; > 1 longer koef2=0.5; % < 1 deeper; > 1 higher %% % Example 7: Audio efect "vocoding" or "cross-synthesis" % Speech - parameters of time-variable filter % Music - excitation signal % [signal1,fs] = wavread('tom.wav'); signal1 = signal1-mean(signal1); sig1 = signal1./max(abs(signal1)); [signal2,fs] = wavread('kytara.wav'); signal2 = signal2-mean(signal2); sig2 = signal2./max(abs(signal2)); N = length(sig1); window_length = 512; window_shift = round(2*window_length/3); X = []; k=1; %% % -----------------------------------------------------------