- #1
commelion
- 40
- 0
Hi , Hope someone could offer me a solution to this piece of code, the code below shows a period in time of a synchronous generator transient response, My scaling is the problem as I am not getting 50 Hz 230 volts, your help would be appreciated..
My efforts so far are
% Transient Response of Generator
%clear all;
%close all;
%Highest known frequency component > 50 Hz
% set appropriate signal variables
fs = 150;
T = 1/fs;
N = 400;
n = 0:N-1;
t = n*T;
fax = (0:N/2) * (fs/N);
% Discrete signal
x = (D5(2000:5000));
subplot(211)
% Plot discrete signal
subplot (211);
plot (x);
title('Syn Generator Transient Window','FontSize',14);
xlabel('Samples', 'FontSize',12);
ylabel('Amplitude','FontSize', 12);
%Plot DFT
subplot(212)
X = abs(fft(x));
stem(fax,(2/N) * X(1:N/2+1));
title('DFT','FontSize',14);
xlabel('Frequency [Hz]','FontSize',12);
ylabel('Magnitude','FontSize',12);
My efforts so far are
% Transient Response of Generator
%clear all;
%close all;
%Highest known frequency component > 50 Hz
% set appropriate signal variables
fs = 150;
T = 1/fs;
N = 400;
n = 0:N-1;
t = n*T;
fax = (0:N/2) * (fs/N);
% Discrete signal
x = (D5(2000:5000));
subplot(211)
% Plot discrete signal
subplot (211);
plot (x);
title('Syn Generator Transient Window','FontSize',14);
xlabel('Samples', 'FontSize',12);
ylabel('Amplitude','FontSize', 12);
%Plot DFT
subplot(212)
X = abs(fft(x));
stem(fax,(2/N) * X(1:N/2+1));
title('DFT','FontSize',14);
xlabel('Frequency [Hz]','FontSize',12);
ylabel('Magnitude','FontSize',12);
Attachments
Last edited: