|
SBB Host
Host communication with the self balancing bike.
|
A namespace providing wrappers for FFTW library. More...
Functions | |
| std::vector< double > | abs (std::vector< fftw_complex > vals) |
| Compute the magnitute. More... | |
| std::vector< double > | abs2 (std::vector< fftw_complex > vals) |
| Compute the magnitute squared. More... | |
| std::vector< double > | arg (std::vector< fftw_complex > vals) |
| Compute the phase in radiants. More... | |
| std::vector< double > | argd (std::vector< fftw_complex > vals) |
| Compute the phase in degrees. More... | |
| void | polar (std::vector< fftw_complex > vals, std::vector< double > *mag, std::vector< double > *phase) |
| Compute the polar coordinates. More... | |
| void | polard (std::vector< fftw_complex > vals, std::vector< double > *mag, std::vector< double > *phase) |
| Compute the polar coordinates. More... | |
| void | bode (std::vector< fftw_complex > vals, std::vector< double > *mag, std::vector< double > *phase) |
| Compute the bode coordinates. More... | |
| void | boded (std::vector< fftw_complex > vals, std::vector< double > *mag, std::vector< double > *phase) |
| Compute the bode coordinates. More... | |
| std::vector< double > | frequency (size_t size, double fmax=0.5) |
| Compute the frequency vector. More... | |
| std::vector< fftw_complex > | fft (std::vector< double > vals) |
| Compute the spectra. More... | |
| std::vector< double > | psd (std::vector< double > vals) |
| Compute the power-spectra-density. More... | |
Variables | |
| constexpr int | REAL = 0 |
| Position of the real part in fftw_complex type. More... | |
| constexpr int | IMAG = 1 |
| Position of the imag part in fftw_complex type. More... | |
A namespace providing wrappers for FFTW library.
Namespace providing wrapper function and utilities for spectral analysis using the FFTW library and the std::vector library.
| std::vector< double > spectra::abs | ( | std::vector< fftw_complex > | vals | ) |
Compute the magnitute.
Function to compute the magnitude of a complex vector.
| vals | A std::vector<fftw_complex> used to compute the magnitude. |
| std::vector< double > spectra::abs2 | ( | std::vector< fftw_complex > | vals | ) |
Compute the magnitute squared.
Function to compute the magnitude of a complex vector.
| vals | A std::vector<fftw_complex> used to compute the magnitude squared. |
| std::vector< double > spectra::arg | ( | std::vector< fftw_complex > | vals | ) |
Compute the phase in radiants.
Function to compute the phase in radiants of a complex vector.
| vals | A std::vector<fftw_complex> used to compute the phase. |
| std::vector< double > spectra::argd | ( | std::vector< fftw_complex > | vals | ) |
Compute the phase in degrees.
Function to compute the phase in degrees of a complex vector.
| vals | A std::vector<fftw_complex> used to compute the phase. |
| void spectra::bode | ( | std::vector< fftw_complex > | vals, |
| std::vector< double > * | mag, | ||
| std::vector< double > * | phase | ||
| ) |
Compute the bode coordinates.
Function to compute the bode coordinates (decibel and phase in radians) of a complex vector.
| vals | A std::vector<fftw_complex> used to compute the phase. |
| mag | A pointer to a std::vector<double> to store the computed decibel. |
| phase | A pointer to a std::vector<double> to store the computed phase (in radians). |
| void spectra::boded | ( | std::vector< fftw_complex > | vals, |
| std::vector< double > * | mag, | ||
| std::vector< double > * | phase | ||
| ) |
Compute the bode coordinates.
Function to compute the bode coordinates (decibel and phase in degrees) of a complex vector.
| vals | A std::vector<fftw_complex> used to compute the phase. |
| mag | A pointer to a std::vector<double> to store the computed decibel. |
| phase | A pointer to a std::vector<double> to store the computed phase (in degrees). |
| std::vector< fftw_complex > spectra::fft | ( | std::vector< double > | vals | ) |
Compute the spectra.
Function to compute the complex spectra of a real signal using the discrete-fourier-transform with the FFTW library.
| vals | A std::vector<double> containing the values of the signal. |
| std::vector< double > spectra::frequency | ( | size_t | size, |
| double | fmax = 0.5 |
||
| ) |
Compute the frequency vector.
Function to compute the frequency vector with given size and maximum frequency.
| size | The size of the resulting vector. |
| fmax | The maximum frequency. |
size frequency from 0 to fmax. | void spectra::polar | ( | std::vector< fftw_complex > | vals, |
| std::vector< double > * | mag, | ||
| std::vector< double > * | phase | ||
| ) |
Compute the polar coordinates.
Function to compute the polar coordinates (magnitude and phase in radians) of a complex vector.
| vals | A std::vector<fftw_complex> used to compute the phase. |
| mag | A pointer to a std::vector<double> to store the computed magnitude. |
| phase | A pointer to a std::vector<double> to store the computed phase (in radians). |
| void spectra::polard | ( | std::vector< fftw_complex > | vals, |
| std::vector< double > * | mag, | ||
| std::vector< double > * | phase | ||
| ) |
Compute the polar coordinates.
Function to compute the polar coordinates (magnitude and phase in degrees) of a complex vector.
| vals | A std::vector<fftw_complex> used to compute the phase. |
| mag | A pointer to a std::vector<double> to store the computed magnitude. |
| phase | A pointer to a std::vector<double> to store the computed phase (in degrees). |
| std::vector< double > spectra::psd | ( | std::vector< double > | vals | ) |
Compute the power-spectra-density.
Function to compute the power-spectra-density of a real signal using the discrete-fourier-transform with the FFTW library.
| vals | A std::vector<double> containing the values of the signal. |
|
constexpr |
Position of the imag part in fftw_complex type.
|
constexpr |
Position of the real part in fftw_complex type.