How to convolve and plot fft of cosine function

3 ビュー (過去 30 日間)
Dalia Lezzar
Dalia Lezzar 2017 年 4 月 13 日
回答済み: Ankitha Kollegal Arjun 2017 年 4 月 18 日
X1[n]=3*cos((2*pi*3*n)/25); X2[n]=6*cos((2*pi*9*n)/25); X3[n]=9*cos((2*pi*12*n)/25); k=1,2,3 X[n] = summation from k=1 to 3 of (Xk[n])
I need to convolve each Xk[n] with X[n] and find the length of each sequence

回答 (1 件)

Ankitha Kollegal Arjun
Ankitha Kollegal Arjun 2017 年 4 月 18 日
To perform convolution of 2 sequences, the conv() function can be used. To find the length of a sequence, the length() function can be used. Here is an example:
n = 0:10;
x1 = 3*cos((2*pi*3*n)/25);
x2 = 6*cos((2*pi*9*n)/25);
x3 = 9*cos((2*pi*12*n)/25);
x = x1+x2+x3;
conv_x1 = conv(x1,x);
length_conv_x1 = length(conv_x1);
conv_x2 = conv(x2,x);
length_conv_x2 = length(conv_x2);
conv_x3 = conv(x3,x);
length_conv_x3 = length(conv_x3);
FFT of a sequence can be obtained using fft() function.

カテゴリ

Help Center および File ExchangeFourier Analysis and Filtering についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by