issofa
Newbie level 6

Hello there.
I would like u guys to help me generate a PSD of an output waveform of a 2 level 4 quadrant IGBT DC/AC converter.
Here is my script in M-file which doesn't work properly.
dt = 1/100;
T = 100;
t = (0:dt:T-dt);
% I think the above times have to be somehow related to the ouput waveform
% and not just randomly writen as I have done, but I don't know how
% to do it
x1 = voltage2.signals.values
,1);
y = fft(x1)/length(x1)*2;
m = abs
;
m(1)= m(1)/2;
f = (0:length
-1)*100/length
;
plot(f,20*log10(m)),
hold on
ylabel('Abs. Magnitude dB'),
x2 = voltage3.signals.values
,1);
y = fft(x2)/length(x2)*2;
m = abs
;
m(1)= m(1)/2;
f = (0:length
-1)*100/length
;
plot(f,20*log10(m),'-.'),
axis ([0 max(f)/2 -60 10])
hold off
h = legend('Uu','Uu0');
Actually my X1 & X2 are the output from the workspace of Mathlab.
Please have a look on my attach file for the waveform and how my PSD should look like .
Many Thank
I would like u guys to help me generate a PSD of an output waveform of a 2 level 4 quadrant IGBT DC/AC converter.
Here is my script in M-file which doesn't work properly.
dt = 1/100;
T = 100;
t = (0:dt:T-dt);
% I think the above times have to be somehow related to the ouput waveform
% and not just randomly writen as I have done, but I don't know how
% to do it
x1 = voltage2.signals.values
y = fft(x1)/length(x1)*2;
m = abs
m(1)= m(1)/2;
f = (0:length
plot(f,20*log10(m)),
hold on
ylabel('Abs. Magnitude dB'),
x2 = voltage3.signals.values
y = fft(x2)/length(x2)*2;
m = abs
m(1)= m(1)/2;
f = (0:length
plot(f,20*log10(m),'-.'),
axis ([0 max(f)/2 -60 10])
hold off
h = legend('Uu','Uu0');
Actually my X1 & X2 are the output from the workspace of Mathlab.
Please have a look on my attach file for the waveform and how my PSD should look like .
Many Thank