RDFT – Running discrete Fourier transform

Block SymbolLicensing group: ADVANCED
PIC

Function Description
The RDFT function block analyzes the analog input signal using the discrete Fourier transform with the fundamental frequency freq and optional higher harmonic frequencies. The computations are performed over the last m samples of the input signal u, where m= nperfreqTS, i.e. from the time-window of the length equivalent to nper periods of the fundamental frequency.

If nharm > 0 the number of monitored higher harmonic frequencies is given solely by this parameter. On the contrary, for nharm = 0 the monitored frequencies are given by the user-defined vector parameter freq2.

For each frequency the amplitude (vAmp output), phase-shift (vPhi output), real/cosine part (vRe output) and imaginary/sine part (vIm output). The output signals have the vector form, therefore the computed values for all the frequencies are contained within. Use the VTOR function block to disassemble the vector signals.

Inputs

u

Analog input of the block

double

HLD

Hold

bool

Outputs

amp

Amplitude of the fundamental frequency

double

thd

Total harmonic distortion (only for nharm 1)

double

vAmp

Vector of amplitudes at given frequencies

reference

vPhi

Vector of phase-shifts at given frequencies

reference

vRe

Vector of real parts at given frequencies

reference

vIm

Vector of imaginary parts at given frequencies

reference

E

Error flag

bool

iE

Error code

error

i ....

REXYGEN general error

Parameters

freq

Fundamental frequency   0.000000001  1000000000.0 1.0

double

nper

Number of periods to calculate upon   1  10000 10

long

nharm

Number of monitored harmonic frequencies   0  16 3

long

ifrunit

Frequency units   1  2 1

long

1 ....

Hz

2 ....

rad/s

iphunit

Phase shift units   0  2 1

long

1 ....

degrees

2 ....

radians

nmax

Allocated size of array   10  10000000 8192

long

freq2

Vector of user-defined monitored frequencies  [2.0 3.0 4.0]

double

2019 © REX Controls s.r.o., www.rexygen.com