Академический Документы
Профессиональный Документы
Культура Документы
DIgSILENT GmbH Heinrich-Hertz-Strasse 9 D-72810 Gomaringen Tel.: +49 7072 9168 - 0 Fax: +49 7072 9168- 88 http://www.digsilent.de e-mail: mail@digsilent.de
Fast Fourier Transformation Published by DIgSILENT GmbH, Germany Copyright 2007. All rights reserved. Unauthorised copying or publishing of this or any part of this document is prohibited. TechRef ElmFft V1 Build 331 30.03.2007
Table of Contents
Table of Contents
1 GENERAL DESCRIPTION ....................................................................................................................................... 4 1.1 OPERATION .................................................................................................................................................................. 4 1.1.1 Basics......................................................................................................................................................................... 4 1.1.2 Calculating the frequency scale from the time scale ...................................................................................................... 6 1.2 WINDOW ...................................................................................................................................................................... 6 2 INPUT/OUTPUT DEFINITIONS OF SIMULATION MODEL ...................................................................................... 7 3 INPUT PARAMETER DEFINITIONS........................................................................................................................ 7 4 EXAMPLE CONFIGURATION .................................................................................................................................. 8 4.1 OVERVIEW .................................................................................................................................................................... 8 4.2 FREQUENCY <=> TIME SCALE....................................................................................................................................... 9 4.3 PLOTS......................................................................................................................................................................... 10
1 General Description
1 General Description
The Fast Fourier Transformation model is used for calculating a fast fourier transformation in the simulation. The spectral lines of the magnitude, phase, real part and imaginary part are output signals. In addition there is the option to apply a hanning window on the input signal. The fourier transformation model has the option to input three or one single signals.
1.1 Operation
1.1.1 Basics
X FFT Y
3.00
P1 P3
2.00 1.00
X 0.00
-1.00 -2.00 -3.00 0.000 1.25 1.00 0.75
P1 P2 P3 P4 P2 P4
0.012
0.024
0.036
0.048
[s]
0.060
Y 0.50
0.25 -0.00 -0.25 0.000
0.012
0.024
0.036
0.048
[s]
0.060
DIgSILENT
1 General Description
samples. All following fft calculations are performed after another n/2 samples. The plot on top shows the analyzed wavevorm, the one on the bottom displays the magnitude of the frequencies. P1 in the frequency plot is calculated from the signal in P1 in the time plot. The following equations show the relation between sampling frequency, fft size and the output.
Tc =
1 fc n fc
(1)
T1 = Tc n = fc 2
(2)
f max =
df =
(3)
f 1 = c T1 n
(4)
Tc : Clock Period f c : Clock Frequency n : Number of Samples in FFT calculation T1 : Time sampled for one complete fft calculation f max :Highest frequency in fft calculation df : Delta f of frequency between spectral lines
T1 =
f max =
df =
1 1 = = 50 Hz T1 20ms
Therefore a new calculation is completed every 10 ms. Every time that a spectrum has completed the ready signal is set to 1. Other models using the fft output as input value use the ready signal to trigger their calculations. If the ready signal is shown in a plot it can be used to calculate the time period sampled by the fft calculation or to mark the beginning of a new fft calculation.
1 General Description
dt = t t start i = dt f c f = i df
Calculating the time on the scale for a given frequency:
i=
f df i fc
(8)
dt =
(9)
t = t start + dt
The newly invented variables are:
(10)
dt : Time difference on time scale between current time and start of current spectrum t : Time i : Index in spectrum t start :Time at start of current spectrum f : Frequency
1.2 Window
There are two different windows for the fft calculation. These are: 1. 2. Rectangular (no window) Hanning Window, where the following filter is applied to the input:
2i y i = x i 1 cos n
with n = Number of Samples in FFT calculation
phase_A phase_B phase_C re_A re_B re_C im_A im_B im_C cl ready
4 Example Configuration
4 Example Configuration
4.1 Overview
The following example shows a small configuration where the Fast Fourier Transformation model is used to perform a fft analysis on a signal. The analyzed signal is created with the Fourier Source model. The output yo of the Fourier Source is a waveform created from given harmonic orders and their corresponding amplitudes.
DIgSILENT
FFT 1 ph:
Clock Fast Fourier Transformation
Clock ElmClock
Fourier Source
output
cl
FFT ElmFft
yo
Waveform A ElmFsrc
input
4 Example Configuration
1.25 1.00 0.75 0.50 0.25 0.00 25.00 41.7187 ms 0.0850 p.u. 30.0781 ms 1.0000 40.0781 ms 1.0000 40.9375 ms 0.3500 p.u.
29.00
33.00
37.00
41.00
[ms]
45.00
40.9375ms .From the ready 40.0781ms in the given example. The time beetween two
n 1 1 values. Therefore T1 = 2 Tr = 2 10ms = 20ms and d f = = = 50 Hz 2 T1 20ms dt = t t start = 40.9375ms 40.0781ms = 0.8594ms
Time between spectral line of interest and start The index of the spectral line is
It is assumed that we want to calculate the value on the time scale for a given frequency of
i=
f 1050 Hz = = 21 df 50 Hz
dt = i 21 = = 1.64ms f c 12.8kHz
The difference on the time scale between the spectral line and the start of the fft is
4 Example Configuration
4.3 Plots
3.00
DIgSILENT
2.00
1.00
-0.00
-1.00
-2.00
-3.00 0.040
0.064
0.072
[s]
0.080
1.25
1.00
0.75
0.50
0.25
-0.00
-0.25 0.040
0.043
0.044
[s]
0.045
10