How to implement Complex Exponential Function Using Matlab ?
3 views (last 30 days)
Show older comments
Muhammad Salem
on 3 Nov 2023
Commented: Star Strider
on 4 Nov 2023
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.
0 Comments
Accepted Answer
Star Strider
on 3 Nov 2023
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)
.
13 Comments
Star Strider
on 4 Nov 2023
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
.
More Answers (0)
See Also
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!