필터 지우기
필터 지우기

How to implement Complex Exponential Function Using Matlab ?

조회 수: 18 (최근 30일)
Muhammad Salem
Muhammad Salem 2023년 11월 3일
댓글: Star Strider 2023년 11월 4일
Please
How can I implement the Complex Exponential Function mentioned in this equation:
X(N) =exp^(j*w1*N) + exp^(j*w2*N)
Suppose:
F =40KHZ
N=Range 1 to 20
w1: is the first angular frequency
w1=2*pi*F
w2: is the second angular frequency
w2=2*pi*F
Finally,
display the values are saved in X(N) in command window.
We apply fast fourier transform (FFT) on X(N) Then we plot the result.

채택된 답변

Star Strider
Star Strider 2023년 11월 3일
I am not certain what you are doing or what ‘w1’ and ‘w2’ are, so using my best guess —
format longE
F = 40E+3;
N = (0:20).';
omega1 = 2*pi*F; % Guessing: 'W1'
omega2 = 4*pi*F; % Guessing: 'w2'
X = exp(1j*omega1*N) + exp(1j*omega2*N)
X =
2.000000000000000e+00 + 0.000000000000000e+00i 2.000000000000000e+00 - 1.165637649496438e-11i 2.000000000000000e+00 - 2.331275298992875e-11i 2.000000000000000e+00 - 3.496912948489312e-11i 2.000000000000000e+00 - 4.662550597985751e-11i 2.000000000000000e+00 + 2.909640830059826e-10i 2.000000000000000e+00 - 6.993825896978625e-11i 2.000000000000000e+00 - 4.308406009455551e-10i 2.000000000000000e+00 - 9.325101195971502e-11i 2.000000000000000e+00 + 2.443385770261251e-10i 2.000000000000000e+00 + 5.819281660119652e-10i 2.000000000000000e+00 - 4.774661069254125e-10i 2.000000000000000e+00 - 1.398765179395725e-10i 2.000000000000000e+00 + 1.977130710462676e-10i 2.000000000000000e+00 - 8.616812018911102e-10i 2.000000000000000e+00 - 5.240916129052701e-10i 2.000000000000000e+00 - 1.865020239194300e-10i 2.000000000000000e+00 - 1.245896296856808e-09i 2.000000000000000e+00 + 4.886771540522501e-10i 2.000000000000000e+00 - 5.707171188851276e-10i 2.000000000000000e+00 + 1.163856332023930e-09i
.
  댓글 수: 13
Muhammad Salem
Muhammad Salem 2023년 11월 4일
I am really sorry
The question has been updated. Perhaps the question contains some errors or may not be clear.
Please give me the answer again
Star Strider
Star Strider 2023년 11월 4일
That simply requires minor tweaks to the existing code.
See the documentation on the fft function to perform the Fourier transform. There are abundant examples throughout Answers. (I wrote many of them.)
That result may not be very exciting to view, since ‘X’ is created by returning integer multiples of .

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by