I got a code for glottal pulse and when i tried to run that by initializing the parameters i get a single pulse. But, when i try to implement it on signal i could not get an output. I am getting error as:
Subscripted assignment dimension mismatch
fs= 11025;
f0= 190;
N1=12;
N2=17;
T=1/f0; %period in seconds
pulselength=floor(T*fs); %length of one period of pulse
%select N1 and N2 for duty cycle
N2=floor(pulselength*N2);
N1=floor(N1*N2);
gn=zeros(1,N2);
%calculate pulse samples
for n=1:N1-1
gn(n)=0.5*(1-cos(pi*(n-1)/N1));
end
for n=N1:N2
gn(n)=cos(pi*(n-N1)/(N2-N1)/2);
end
gn=[gn zeros(1,(pulselength-N2))];
plot(gn);
Please go through the code and help me where i am going wrong.