matlab - Not able to perform frequency domain windowing correctly? -
i trying perform frequency domain windowing convolving sinc signal (in blue color) impulse response of raise cosine window (1+0.5*cos()).
i have attached code same below. highly appreciated.
n0=0; w=0.5; n=64; ncap=5*n; l=ncap/n; n=(-ncap/2:(ncap/2)-1); ws=n/ncap; s=sinc(ws.*(n+n0)); test_fir=[0.5 0 0 0 0 1 0 0 0 0 0.5]; conv_out= (conv(test_fir,s)/max(conv(s,test_fir))); figure(2) plot(s,) hold on plot(conv_out,'k','linewidth',2)
for way proceed, result expected. you're plotting s
(which has 320 doubles) along conv_out
, has 330 elements (because convolution's result going have 1 less sum of number of elements per vectors convolve, i.e. 320 , 11).
since you're plotting both vectors against position of elements, quite normal conv_out
shifted compared s
(because have different lengths). need correctly choose x axis plotting. so, try figure correct x axis.
Comments
Post a Comment