Products & Services Solutions Academia Support User Community Company

Learn more about Simulink Control Design   

frest.Sinestream - Package: frest

Signal containing series of sine waves

Syntax

input = frest.Sinestream(sys)
input = frest.Sinestream('OptionName',OptionValue)

Description

input = frest.Sinestream(sys) creates a signal with a series of sinusoids based on the dynamics of a linear system sys.

input = frest.Sinestream('OptionName',OptionValue) creates a signal with a series of sinusoids, where each sinusoid frequency lasts for a specified number of periods, using the options specified by comma-separated name/value pairs.

To view a plot of your input signal, type plot(input). To obtain a timeseries for your input signal, use the generateTimeseries command.

Inputs

sys

Linear system for creating a sinestream signal that matches the dynamic characteristics of this system. You can specify the linear system based on known dynamics using tf, zpk, or ss. You can also obtain the linear system by linearizing a nonlinear system.

The resulting sinestream signal automatically sets these options based on the linear system:

  • 'Frequency' are the frequencies at which the linear system has interesting dynamics.

  • 'SettlingPeriods' is the number of periods it takes the system to reach steady state at each frequency in 'Frequency'.

  • 'NumPeriods' is (3 + SettlingPeriods) to ensure that each frequency excites the system at maximum amplitude for at least three periods.

  • For discrete systems only, 'SamplesPerPeriod' is set such that all frequencies have the same sample time as the linear system.

Other sinestream options have default values.

'OptionName',OptionValue

Signal characteristics, specified as comma-separated pairs of option name string and the option value.

Option NameOption Value
'Frequency'Signal frequencies, specified as either a scalar or a vector of frequency values.

Default: logspace(1,3,50)
'Amplitude'Signal amplitude at each frequency, specified as either:
  • Scalar when all frequencies have the same value

  • Vector of values when the value is different across frequencies


Default: 1e-5

'SamplesPerPeriod'Number of samples for each period for each signal frequency, specified as either:
  • Scalar when all frequencies have the same value

  • Vector of values when the value is different for each frequency


Default: 40

'FreqUnits'Frequency units:
  • 'rad/s'—Radians per second

  • 'Hz'— Hertz

Changing frequency units does not impact frequency response estimation.

Default: 'rad/s'

'RampPeriods'Number of periods for ramping up the amplitude of each sine wave to its maximum value, specified as either:
  • Scalar when all frequencies have the same value

  • Vector of values when the value is different for each frequency


Default: 0

'NumPeriods'Number of periods each sine wave is at maximum amplitude, specified as either:
  • Scalar when all frequencies have the same value

  • Vector of values when the value is different for each frequency

Use this option to ensure a smooth response when your input amplitude changes.

Default: max(3–RampPeriods+SettlingPeriods,, 2)

'SettlingPeriods'Number of periods corresponding to the transient portion of the simulated response at a specific frequency, before the system reaches steady state, specified as either:
  • Scalar when all frequencies have the same value

  • Vector of values when the value is different for each frequency

Before performing the estimation, frestimate discards this number of periods from the output signals.

Default: 1

'ApplyFilteringInFRESTIMATE'Frequency-selective FIR filtering of the input signal before estimating the frequency response using frestimate.
  • 'on' (default)

  • 'off'

For more information, see the frestimate algorithm.

'SimulationOrder'When frequency response estimation occurs relative to output simulation at specified input frequencies.
  • 'Sequential' (default)—Simulates output at all input frequencies before estimating the frequency response.

  • 'OneAtATime'—Simulates the output and estimates the frequency response for each input frequency, on at a time. Use this option when your Simulink model has a fixed-step solver.

Examples

Create a sinstream signal at different frequencies, amplitudes, and ramp-up periods:

% Create the input signal
input = frest.Sinestream('Frequency',[1 2.5 5],...
                      'Amplitude',[1 2 1.5],...
                      'NumPeriods',[4 6 12],...
                      'RampPeriods',[0 2 6]);

% Plot the input signal
plot(input)

 

Create a sinusoidal input signal with the following characteristics:

% Create the input signal
input = frest.Sinestream('Amplitude',1e-3,'Frequency',logspace(1,3,50),...
'SamplesPerPeriod',10,'FreqUnits','Hz');

See Also

frest.Chirp | frest.createFixedTsSinestream | frest.Random | frestimate | generateTimeseries

How To

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS