user264230
user264230

Reputation: 650

Matlab cconv and circular convolution

My goal is to use Matlab to verify circular convolution calculations. I try to do this using cconv.

However, Matlab does not give the same answer to problems I know the answer for. Why?

An example is the circular convolution modulo 4 between [1, 2, 4, 5, 6] and [7, 8, 9, 3] as can be found in this paper by Abassi

According to the paper the answer is: [112, 91, 71, 88, 124].

But according to Matlab it is: [131, 127, 122, 106].

a = [1,2,4,5,6]
b = [7,8,9,3]
y = cconv(a,b,4)
ans =

   131   127   122   106

What do I do wrong here?

Upvotes: 0

Views: 1651

Answers (2)

Mehrez
Mehrez

Reputation: 90

The matlab code used in the Abbasi paper is written in the end :

A=fft(a);
B=fft(b);
y=ifft(A.*B);

I don't know why you use cconv if this doese the work.

Upvotes: 0

hiandbaii
hiandbaii

Reputation: 1331

y = cconv(a,b,5)

the 3rd argument is 5 not 4 for what the paper describes

Upvotes: 3

Related Questions