k-Wave Toolbox |
![]() ![]() |
Compute the single sided amplitude and phase spectrums
[f func_as] = aspect(func, Fs) [f func_as] = aspect(func, Fs, ...) [f func_as func_ps] = aspect(func, Fs) [f func_as func_ps] = aspect(func, Fs, ...)
filterTimeSeries
computes the single sided amplitude and phase spectrums of an abritrary one-dimensional input signal. For example, running the commands
Fs = 10e6; % [Hz] dt = 1/Fs; % [s] t = 0:dt:1000*dt; % [s] signal = 10*sin(0.5e6*2*pi*t) + 5*sin(1e6*2*pi*t) + 2*sin(2.5e6*2*pi*t); spectrum(signal, Fs, 'Plot', [true false]);
will produce the following amplitude spectrum.
|
signal to analyse |
|
sampling frequency [Hz] |
Optional 'string', value pairs that may be used to modify the default computational settings.
Input | Valid Settings | Default | Description |
---|---|---|---|
|
(boolean scalar) |
|
Boolean controlling whether the FFT length is forced to be the next highest power of 2. |
|
(boolean scalar or two element vector) |
|
Boolean controlling whether the amplitude and phase spectrums are plotted. Can be given as a two element array to control the display of the amplitude and phase spectrums, respectively. |
|
(boolean scalar) |
|
Boolean controlling whether the phase spectum is unwrapped. |
|
(boolean scalar) |
|
Boolean controlling the internal use of a Hanning window before the FFT is taken. |
|
frequency array |
|
single sided amplitude spectrum |
|
single sided phase spectrum |
smooth
, filterTimeSeries
![]() |
smooth | speedSoundWater | ![]() |
© 2009, 2010 Bradley Treeby and Ben Cox.