Digital signal processing LINEAR AND CIRCULAR CONVOLUTION length-N sequences error

Here is my code for --- Write a program to compute the circular convolution of two length-N
sequences via the DFT-based approach.
clc; clear all; close all;
x =[2+j3 3-1j -1+j2 j3 2+j4];
h =[-3-j2 1+j4 1+j2 5+j3 1+j2];
y = conv(x,h);
plot(x,h);
stem(x);
ylabel( 'AMPLITUDE');
xlabel('First Sequence');
subplot(3,1,2);stem(h);
ylabel( 'AMPLITUDE');xlabel('Second Sequence') ;
subplot(3,1,3);stem(y);
ylabel( 'AMPLITUDE');xlabe1('Output Sequence');
disp( 'The Resultant Signal is: ');y
Here i am getting error stating
Error in (line 3) x =[2+j3 3-1j -1+j2 j3 2+j4]
can someone help me as i am not sure if there somthing wrong this ''x =[2+j3 3-1j -1+j2 j3 2+j4''
I have been trying this sequnce with varies of other codes and method but still getting same error..

 採用された回答

Ridwan Alam
Ridwan Alam 2019 年 12 月 23 日

5 件のコメント

Mohsen Salimy
Mohsen Salimy 2019 年 12 月 23 日
Yes i think that sorted however im still gettin error for the 2nd sequence - see below,
Error in m31 (line 4)
h = [-3-j2 1+j4 1+j2 5+j3 1+j2];
Ridwan Alam
Ridwan Alam 2019 年 12 月 23 日
Please follow the link above to learn how you are supposed to write imaginary numbers in Matlab.
Mohsen Salimy
Mohsen Salimy 2019 年 12 月 23 日
Thank you so much
Image Analyst
Image Analyst 2019 年 12 月 23 日
Swap the number and j. So not j2, but 2j.
Ridwan Alam
Ridwan Alam 2019 年 12 月 24 日
編集済み: Ridwan Alam 2019 年 12 月 25 日
Sure. Glad to help.

サインインしてコメントする。

その他の回答 (0 件)

質問済み:

2019 年 12 月 23 日

編集済み:

2019 年 12 月 25 日

Community Treasure Hunt

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

Start Hunting!

Translated by