LinearFrequencyRamp#
- class LinearFrequencyRamp(options)#
Bases:
WaveformLinearFrequencyRampgenerates sine waves with linearly varying frequency.Creates sine wave signals where the frequency changes linearly from a start frequency to a stop frequency over the duration. Useful for frequency sweep applications and chirp signals. Inherits from
Waveform.Example1:
% Create a frequency sweep from 100 Hz to 1000 Hz ramp = LinearFrequencyRamp(startFrequency = 100, stopFrequency = 1000, ... amplitude = 1.0, duration = 0.01); ramp.plot();
Example2:
% Create a downward frequency sweep ramp = LinearFrequencyRamp(startFrequency = 1000, stopFrequency = 100, ... amplitude = 2.0, duration = 0.01); ramp.plot();
- Constructor Summary
- LinearFrequencyRamp(options)#
Construct a LinearFrequencyRamp object.
- Parameters:
samplingRate (
double, optional) – Sampling rate in Hz (default: [])startTime (
double, optional) – Start time in seconds (default: 0)duration (
double, optional) – Duration in seconds (default: [])offset (
double, optional) – DC offset (default: 0)amplitude (
double, optional) – Peak-to-peak amplitude (default: 0)phase (
double, optional) – Initial phase in radians (default: 0)startFrequency (
double, optional) – Starting frequency in Hz (default: 1)stopFrequency (
double, optional) – Ending frequency in Hz (default: 2)
- Property Summary
- Amplitude double = 0#
Peak-to-peak amplitude, usually in Volts.
- Offset double = 0#
Offset, usually in Volts.
- Phase double = 0#
Initial phase in radians.
- StartFrequency double {mustBePositive} = 10#
Linear frequency in Hz - Starting frequency.
- StopFrequency double {mustBePositive} = 100#
Linear frequency in Hz - Ending frequency.
- Method Summary
- TimeFunc()#
Get the time function for the linear frequency ramp.
Creates a function handle that generates sine wave values with linearly varying frequency from
StartFrequencytoStopFrequency. Implements the abstractTimeFunc()method fromWaveform.- Returns:
Function that takes time array and returns frequency ramp values
- Return type:
function_handle