Cody

Problem 2106. Compute circular convolution

Solution 2996659

Submitted on 27 Sep 2020 at 4:34
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Fail
x = [1 2 0 1]; h = [2 2 1 1]; y_correct = [6 7 6 5]; assert(isequal(circconv(x,h),y_correct))

y = 2 6 5 5 6 7 6 5 4 1 1

Index in position 1 exceeds array bounds (must not exceed 1). Error in circconv (line 3) y = y(1+numel(x),2*numel(x)); Error in Test1 (line 4) assert(isequal(circconv(x,h),y_correct))

2   Fail
x = [1 2 3 4 5]; h = [-5 3 -2 4 3]; y_correct = [20 8 21 4 -8]; assert(isequal(circconv(x,h),y_correct))

y = -5 -7 -11 -11 -8 20 8 21 4 -8 25 15 32 15

Index in position 1 exceeds array bounds (must not exceed 1). Error in circconv (line 3) y = y(1+numel(x),2*numel(x)); Error in Test2 (line 4) assert(isequal(circconv(x,h),y_correct))

Suggested Problems

More from this Author1

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!