audio - wavread error in vibrato function matlab -
i trying compile vibrato sound effect code found on internet. code has function call wavread
, in function matlab showing error, i've search codes , every code use function open de wav file, happening? code below:
vibrato script:
clear all; close all; clc; infile = 'musica.wav'; % read in wav sample [ x, fs, n ] = wavread(infile); %set parameters vibrato % change these experiment vibrato modfreq = 10; %10 khz width = 0.0008; % 0.8 milliseconds % vibrato yvib = vibrato(x, fs, modfreq, width); % write output wav files wavwrite(yvib, fs, 'out_vibrato.wav'); % plot original , equalised waveforms figure(1) hold on plot(x(1:500),'r'); plot(yvib(1:500),'b'); title('vibrato first 500 samples');
vibrato function:
% vibrato function y=vibrato(x,samplerate,modfreq,width) ya_alt=0; delay=width; % basic delay of input sample in sec delay=round(delay*samplerate); % basic delay in # samples width=round(width*samplerate); % modulation width in # samples if width>delay error('delay greater basic delay !!!'); return; end modfreq=modfreq/samplerate; % modulation frequency in # samples len=length(x); % # of samples in wav-file l=2+delay+width*2; % length of entire delay delayline=zeros(l,1); % memory allocation delay y=zeros(size(x)); % memory allocation output vector n=1:(len-1) m=modfreq; mod=sin(m*2*pi*n); zeiger=1+delay+width*mod; i=floor(zeiger); frac=zeiger-i; delayline=[x(n);delayline(1:l-1)]; %---linear interpolation----------------------------- y(n,1)=delayline(i+1)*frac+delayline(i)*(1-frac); %---allpass interpolation------------------------------ %y(n,1)=(delayline(i+1)+(1-frac)*delayline(i)-(1-frac)*ya_alt); %ya_alt=ya(n,1); end
the error appears:
undefined function or variable 'wavread'
.
in line:
[ x, fs, n ] = wavread(infile);
Comments
Post a Comment