I need to perform convolution between two a filter and 5 signals in MATLAB without using the conv or filter commands.
My filter is a sampled cosine function multiplied by some constant.
h(t) = K cos(t) , [-pi/2, pi/2]
My signals are in columns of a matrix.
Column 1 = subsignal1
Column 2 = subsignal2
and so forth.
I would like to write a loop to perform each of these convolutions individually, or all at once if possible.
Something like:
/code
x = the 1st column in my matrix;
N = length(x);
h1=fliplr(h);
yc = x;
for t = 3:N-1
b = x(t-2:t+1)
s = b*h;
yc(t) = s;
end
/code
My filter is a sampled cosine function multiplied by some constant.
h(t) = K cos(t) , [-pi/2, pi/2]
My signals are in columns of a matrix.
Column 1 = subsignal1
Column 2 = subsignal2
and so forth.
I would like to write a loop to perform each of these convolutions individually, or all at once if possible.
Something like:
/code
x = the 1st column in my matrix;
N = length(x);
h1=fliplr(h);
yc = x;
for t = 3:N-1
b = x(t-2:t+1)
s = b*h;
yc(t) = s;
end
/code