Constructor examples of the FSDATA class


Construct empty FSDATA object
Construct a FSDATA object by loading the object from a file
Construct a FSDATA object from a data vector
Construct a FSDATA object from a data vector and frequency vector
Construct a FSDATA object from a data vector and the corresponding frequency
Construct a FSDATA object from a data vector, frequency vector and the corresponding frequency

Construct empty FSDATA object

The following example creates an empty fsdata object

f1 = fsdata()
----------- fsdata 01 -----------

  name:  None
    fs:  0
     x:  [0 0], double
     y:  [0 0], double
xunits:  Hz
yunits:
---------------------------------

Construct a FSDATA object by loading the object from a file

The following example creates a new fsdata object by loading the fsdata object from disk.

f1 = fsdata('f1.mat')
f1 = fsdata('f1.xml')

Construct a FSDATA object from a data vector

creates a frequency-series object with the given y-data. Sample rate of the data is assumed to be 1Hz.

y  = randn(1000,1);

f1 = fsdata(y)

Construct a FSDATA object from a data vector and frequency vector

creates a frequency-series object with the given (x,y)-data. The sample rate is then set as 2*x(end).

fs = 10;
x  = linspace(0, fs/2, 1000);
y  = randn(1000,1);

f1 = fsdata(x,y)

Construct a FSDATA object from a data vector and the corresponding frequency

creates a frequency-series object with the given y-data and sample rate. The frequency vector is grown assuming the first y sample corresponds to 0Hz and the last sample corresponds to the Nyquist frequency.

y = randn(1000,1);
fs = 100;

f1 = fsdata(y,fs)

Construct a FSDATA object from a data vector, frequency vector and the corresponding frequency

creates a frequency-series object with the given x,y-data and sample rate.

fs = 10;
x  = linspace(0, fs/2, 1000);
y  = randn(1000,1);

f1 = fsdata(x,y,fs);




©LTP Team