-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathcomputeSystemNOFRF.m
52 lines (49 loc) · 1.84 KB
/
computeSystemNOFRF.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
% This functions performs all steps to compute the NOFRFs (Nonlinear Output Frequency Response Function) of a system
% with the given GFRFs and input u.
%
% written by: Renato Naville Watanabe
%
% [NOFRF, U, f] = computeSystemNOFRF(GFRF, u, Fs, fres, minDegree, maxDegree, fmin, fmax, f_inputMin, f_inputMax)
%
%
% Inputs:
%
% GFRF: cell, contains all the GFRFs until the specified degree.
%
% u: vector of floats, input signal, in a column-vector.
%
% Fs: float, sampling frequency, in Hz.
%
% fres: float, frequency resolution of the FFT, in Hz.
%
% minDegree: integer, minimal degree to have the NOFRF computed.
%
% maxDegree: integer, maximal degree to have the NOFRF computed.
%
% fmin: float, lower frequency limit of the NOFRF computation, in Hz.
%
% fmax: float, upper frequency limit of the NOFRF computation, in Hz.
%
% f_inputMin: vector of floats, lower frequency limit of the input signal, in Hz.
% You can define one value for each degree or simply one value for all
% degrees. For example: f_inputMin = [19;19;0;0;19;0] if you will use
% GFRFs up to degree six.
%
% f_inputMax: vector of floats, upper frequency limit of the input signal, in Hz.
% You can define one value for each degree or simply one value for all
% degrees. For example: f_inputMax = [21;21;2;2;21;2] if you will use
% GFRFs up to degree six.
%
%
% Outputs:
%
% NOFRF: vector of complex, the NOFRF of the system for the given input at
% each frequency.
%
% U: vector of complex, the FFT of the input signal u.
%
% f: vector of floats, the vector of frequencies.
function [NOFRF, U, f] = computeSystemNOFRF(GFRF, u, Fs, fres, minDegree, maxDegree, fmin, fmax, f_inputMin, f_inputMax)
U = computeSignalFFT(u, Fs, fres);
[NOFRF, f] = computeNOFRF(GFRF, U, minDegree, maxDegree, Fs, fres, fmin, fmax, f_inputMin, f_inputMax);
end