I'm trying to use a cardinal sine as a lowpass filter for a cosine signal with a fundamental of 1k.
In frequency domain, what really happens is that I'm multiplying two impulses (centered at -1k and 1k) with a rectangular pulse of width equals 2 (convolution is multiplication in frecuency domain). The result would be a constant zero function. However using the above code in Matlab I'm getting again the sinc function as output. Any help would be appreciated (attached the full plot).
D = 5; f0 = 1000; fm = 2*f0; % nyquist reestriction t = (-D:1/fm:D); x = cos(1000*2*pi*t); h = sinc(t); x_p = filter(h,1,x); plot(x_p);