how to compute the complex Fourier series expansion of half-wave rectified signal. and plot its phase and amplitude spectrum?
古いコメントを表示
My Question in the title, i am new to matlab and i need help with this please

回答 (4 件)
Sulaymon Eshkabilov
2020 年 8 月 12 日
1 投票
Hi,
Here are several nice tutorial examples of matlab on Fourier Transform.
Star Strider
2020 年 8 月 12 日
1 投票
My impression is that this is homework. We give hints for homework, not complete code. (You must write the code. We will help you to get your code to run if you have problems with it.)
It is straightforward to compute the Fourier transform symbolically. You need to remember also to allow for the part of the signal that is zero in the time range that you are computing it.
You already discovered Hi how do i plot a halfwave rectifier signal in matlab? i tried the coding below and only got the fullwave (since you posted a Comment to it to request thatI look at this Question), all you then need to do is to read the documentation for fft and use that with the signal I provided in that Answer.
9 件のコメント
WJ
2020 年 8 月 12 日
WJ
2020 年 8 月 12 日
Star Strider
2020 年 8 月 12 日
In that instance, use the second part of my Answer and plot the fft of the half-wave rectified signal.
The table that you posted appears to require a context that is not provided.
WJ
2020 年 8 月 12 日
WJ
2020 年 8 月 12 日
Star Strider
2020 年 8 月 12 日
Try this slightly modified version of your code:
f=50;
t=linspace(0,30,500);
Fs = 1/(t(2)-t(1));
Fn = Fs/2;
sig=sin(2*pi*f*t);
rect_sig = sig.*(sig > 0); % Half-Wave Rectification
y = fft(rect_sig)/numel(sig);
f = linspace(0, 1, fix(numel(sig)/2)+1)*Fn; % Frequency Vector
idx = 1:numel(f); % Index Vector
% f = (0:length(y)-1)*50/length(y);
figure
subplot(2,1,1)
semilogy(f,abs(y(idx))*2)
title('Magnitude')
grid
subplot(2,1,2)
plot(f,unwrap(angle(y(idx))))
title('Phase')
grid
figure
% subplot(221)
stem(t,rect_sig)
.
WJ
2020 年 8 月 12 日
Star Strider
2020 年 8 月 12 日
To get the amplitude (amplitude = magnitude) spectrum such as in the plot image, use the fftshift function, then plot using a symmetric frequency vector, for example:
sy = fftshift(y);
sf = linspace(-10,10, numel(sy));
then:
figure
stem(sf, sy)
or something similar.
Swapnil Khot
2021 年 5 月 8 日
0 投票
How we write code for half wave rectifier using Fourier series
EE_student
2021 年 6 月 19 日
0 投票
Wait have you sorted it out?
カテゴリ
ヘルプ センター および File Exchange で MATLAB についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
