SpHr_SignalSweep [ Flags ] fs, F1, F2 [ , destWaveName ]
Generates a frequency sweep (single dimension).
Parameters
fs Sampling frequency (Hz)
F1 Starting frequency (Hz)
F2 Ending frequency (Hz)
destWaveName Name of generated wave. The wave is single precision and always overwritten. destWaveName can be omitted if the /Inv flag is used while generating a logarithmic sweep.
Flags
/Type = { typeStr [, refHzLimit ] }
typeStr = "log" (or "ln" or “exp”) logarithmic sweep. destWaveName= A*sin(((2*pi*F1*T)/ln(F2/F1))*(exp( (ln(F2/F1)*x)/T)-1)); /// A = amplitude, T = duration (s)
typeStr = "linear" (or “lin”) linear sweep. destWaveName= A*sin(2*pi*(F1*x+((k/2)*x^2))); where A = amplitude, T = duration (s), and k=(F2-F1)/T
typeStr = "linear 1/f" (or combination of "linear”, "lin" "1/f", and "pink”) linear sweep with 1/frequency amplitude spectrum.
refHzLimit Reference frequency (Hz) for low frequency amplitude limit. refHzLimit is used only used when generating a linear sweep with 1/frequency amplitude spectrum (typeStr = "linear 1/f"). Frequencies below refHzLimit are limited in amplitude if they exceed the specified sweep amplitude. Low values can cause all amplitudes to decrease, especially when generating short sweeps.
/Inv = inverseFilterWaveName
inverseFilterWaveName is the inverse logarithmic filter calculated by reversing destWaveName and scaling each value by: exp((ln(F2/F1)*x)/T). This flag is ignored if a logarithmic sweep is not being generated.
/Rows = rows
Length in number of rows. Same as /Pnts flag. Do not use with /Sec or /ms.
/Pnts = pnts
Length in number of points. Same as /Rows flag. Do not use with /Sec or /ms.
/Sec = seconds
Length in seconds (do not use with /Rows, /Pnts, or /ms flags).
/ms = ms
Length milliseconds (do not use with /Rows, /Pnts, or /Sec flags).
/dB = db
Amplitude (RMS re: 20µPa) in decibels (dB = 20*log[Pa/2e-05]).
/Pa = pa
Amplitude (RMS) in Pascals. Overrides /dB flag.
/A = amplitude
Amplitude in Pascals (peak to peak). This flag overrides both the /dB and /Pa flags.
/Sum [ = sum ]
Option to sum an existing wave, specified by destWaveName, with the newly generated wave.
sum = 0, destWaveName will be overwritten, same as no /Sum flag.
sum = 1, If destWaveName already exists, new values will be summed with destWaveName. Same as /Sum flag alone.
/Buff = { front_ms [, back_ms ] }
front_ms, length of zero buffer, in milliseconds, added prior to the noise's onset.
back_ms, length of zero buffer, in milliseconds, added after to the noise's offset. If not specified, a buffer equal in length to front_ms is used.
/Ramp = { onset_ms [, offset_ms ] }
onset_ms, length of Hanning onset ramp, in milliseconds. The ramp adds no length to the signal.
offset_ms, length of Hanning onset ramp, in milliseconds. The ramp adds no length to the signal. If not specified, a ramp equal in length to onset_ms is used.
Example
Function SpHr_SignalSweep_Example()
variable fs = 48000
variable F1 = 20
variable F2 = 20000
SpHr_SignalSweep/sec=1/A=1/Inv=InvFilter fs, F1, F2, Sweep
Display/K=1 Sweep
Label left "amplitude (\\U)"
Label bottom "time (\\U)"
End