Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %LPC vocoder
- s = loadbin('frame_unvoiced.bin');
- s2 = loadbin('frame_voiced.bin');
- fs = 16000;
- p = 16;
- N = length(s);
- [a,E] = lpc(s,p);
- exc = randn(N,1);
- out = filter(sqrt(E),a,exc);
- x = abs(fft(out));
- figure(1)
- subplot(211)
- plot(s,'b')
- hold on
- plot(out,'r')
- hold off
- subplot(212)
- y = abs(fft(s));
- plot(y,'b')
- hold on
- plot(x,'r')
- hold off
- %%%%%%%%%%%%%%%%%%%% For voiced signal
- fs = 16000;
- p = 16;
- N = length(s2);
- L0 = 150;
- [a,E] = lpc(s2,p);
- exc2 = randn(N,1);
- out2 = filter(sqrt(E),a,exc2);
- x2 = abs(fft(out2));
- figure(2)
- subplot(211)
- plot(s2,'b')
- hold on
- plot(out2,'r')
- hold off
- subplot(212)
- y2 = abs(fft(s2));
- plot(y2,'b')
- hold on
- plot(x2,'r')
- hold off
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement