Helper class for generating test waveforms.
More...
#include <TestWaveformSource.h>
|
| TestWaveformSource (std::minstd_rand &rng) |
|
| TestWaveformSource (const TestWaveformSource &)=delete |
|
TestWaveformSource & | operator= (const TestWaveformSource &)=delete |
|
WaveformBase * | GenerateNoisySinewave (float amplitude, float startphase, float period, int64_t sampleperiod, size_t depth, float noise_stdev=0.01, std::function< void(float)> downloadCallback=nullptr) |
| Generates a sinewave with AWGN added. More...
|
|
WaveformBase * | GenerateNoisySinewaveSum (float amplitude, float startphase1, float startphase2, float period1, float period2, int64_t sampleperiod, size_t depth, float noise_stdev=0.01, std::function< void(float)> downloadCallback=nullptr) |
| Generates a sum of two sinewaves with AWGN added. More...
|
|
WaveformBase * | GeneratePRBS31 (vk::raii::CommandBuffer &cmdBuf, std::shared_ptr< QueueHandle > queue, float amplitude, float period, int64_t sampleperiod, size_t depth, bool lpf=true, float noise_stdev=0.01, std::function< void(float)> downloadCallback=nullptr) |
| Generates a PRBS-31 waveform through a lossy channel with AWGN. More...
|
|
WaveformBase * | Generate8b10b (vk::raii::CommandBuffer &cmdBuf, std::shared_ptr< QueueHandle > queue, float amplitude, float period, int64_t sampleperiod, size_t depth, bool lpf=true, float noise_stdev=0.01, std::function< void(float)> downloadCallback=nullptr) |
| Generates a K28.5 D16.2 (1000base-X / SGMII idle) waveform through a lossy channel with AWGN. More...
|
|
WaveformBase * | GenerateStep (float vlo, float vhi, int64_t sampleperiod, size_t depth) |
| Generates a step waveform. More...
|
|
void | DegradeSerialData (UniformAnalogWaveform *cap, int64_t sampleperiod, size_t depth, bool lpf, float noise_stdev, vk::raii::CommandBuffer &cmdBuf, std::shared_ptr< QueueHandle > queue) |
| Takes an idealized serial data stream and turns it into something less pretty. More...
|
|
|
std::minstd_rand & | m_rng |
| Random number generator.
|
|
AcceleratorBuffer< float > | m_forwardInBuf |
| Input buffer for FFTs.
|
|
AcceleratorBuffer< float > | m_forwardOutBuf |
| Output buffer for FFTs.
|
|
AcceleratorBuffer< float > | m_reverseOutBuf |
| Output buffer for IFFTs.
|
|
std::unique_ptr< VulkanFFTPlan > | m_vkForwardPlan |
| FFT plan.
|
|
std::unique_ptr< VulkanFFTPlan > | m_vkReversePlan |
| Inverse FFT plan.
|
|
double | m_cachedBinSize |
| FFT bin size, in Hz.
|
|
AcceleratorBuffer< float > | m_resampledSparamSines |
| Serial channel S-parameter real part.
|
|
AcceleratorBuffer< float > | m_resampledSparamCosines |
| Serial channel S-parameter imaginary part.
|
|
ComputePipeline | m_rectangularComputePipeline |
| Compute pipeline for our window function.
|
|
ComputePipeline | m_channelEmulationComputePipeline |
| Compute pipeline for channel emulation.
|
|
SParameters | m_sparams |
| S-parameters of the channel.
|
|
size_t | m_cachedNumPoints |
| FFT point count as of last cache update.
|
|
size_t | m_cachedRawSize |
| Input size of FFT as of last cache update.
|
|
Helper class for generating test waveforms.
Used by DemoOscilloscope as well as various unit tests
◆ DegradeSerialData()
void TestWaveformSource::DegradeSerialData |
( |
UniformAnalogWaveform * |
cap, |
|
|
int64_t |
sampleperiod, |
|
|
size_t |
depth, |
|
|
bool |
lpf, |
|
|
float |
noise_stdev, |
|
|
vk::raii::CommandBuffer & |
cmdBuf, |
|
|
std::shared_ptr< QueueHandle > |
queue |
|
) |
| |
Takes an idealized serial data stream and turns it into something less pretty.
The channel is a combination of a lossy S-parameter channel (approximately 300mm of microstrip on Shengyi S1000-2M) and AWGN with configurable standard deviation
- Parameters
-
cap | Waveform to degrade |
sampleperiod | Period of the input waveform |
depth | Number of points in the input waveform |
lpf | True to perform channel emulation, false to only add noise |
noise_stdev | Standard deviation of the AWGN, in volts |
cmdBuf | Vulkan command buffer to use for channel emulation |
queue | Vulkan queue to use for channel emulation |
◆ Generate8b10b()
WaveformBase * TestWaveformSource::Generate8b10b |
( |
vk::raii::CommandBuffer & |
cmdBuf, |
|
|
std::shared_ptr< QueueHandle > |
queue, |
|
|
float |
amplitude, |
|
|
float |
period, |
|
|
int64_t |
sampleperiod, |
|
|
size_t |
depth, |
|
|
bool |
lpf = true , |
|
|
float |
noise_stdev = 0.01 , |
|
|
std::function< void(float)> |
downloadCallback = nullptr |
|
) |
| |
Generates a K28.5 D16.2 (1000base-X / SGMII idle) waveform through a lossy channel with AWGN.
- Parameters
-
cmdBuf | Vulkan command buffer to use for channel emulation |
queue | Vulkan queue to use for channel emulation |
amplitude | P-P amplitude of the waveform in volts |
period | Unit interval, in femtoseconds |
sampleperiod | Interval between samples, in femtoseconds |
depth | Total number of samples to generate |
lpf | Emulate a lossy channel if true, no channel emulation if false |
noise_stdev | Standard deviation of the AWGN in volts |
downloadCallback | Callback for download progress |
◆ GenerateNoisySinewave()
WaveformBase * TestWaveformSource::GenerateNoisySinewave |
( |
float |
amplitude, |
|
|
float |
startphase, |
|
|
float |
period, |
|
|
int64_t |
sampleperiod, |
|
|
size_t |
depth, |
|
|
float |
noise_stdev = 0.01 , |
|
|
std::function< void(float)> |
downloadCallback = nullptr |
|
) |
| |
Generates a sinewave with AWGN added.
- Parameters
-
amplitude | P-P amplitude of the waveform in volts |
startphase | Starting phase in radians |
period | Period of the sine, in femtoseconds |
sampleperiod | Interval between samples, in femtoseconds |
depth | Total number of samples to generate |
noise_stdev | Standard deviation of the AWGN in volts |
downloadCallback | Callback for download progress |
◆ GenerateNoisySinewaveSum()
WaveformBase * TestWaveformSource::GenerateNoisySinewaveSum |
( |
float |
amplitude, |
|
|
float |
startphase1, |
|
|
float |
startphase2, |
|
|
float |
period1, |
|
|
float |
period2, |
|
|
int64_t |
sampleperiod, |
|
|
size_t |
depth, |
|
|
float |
noise_stdev = 0.01 , |
|
|
std::function< void(float)> |
downloadCallback = nullptr |
|
) |
| |
Generates a sum of two sinewaves with AWGN added.
- Parameters
-
amplitude | P-P amplitude of the waveform in volts |
startphase1 | Starting phase of the first sine in radians |
startphase2 | Starting phase of the second sine in radians |
period1 | Period of the first sine, in femtoseconds |
period2 | Period of the second sine, in femtoseconds |
sampleperiod | Interval between samples, in femtoseconds |
depth | Total number of samples to generate |
noise_stdev | Standard deviation of the AWGN in volts |
downloadCallback | Callback for download progress |
◆ GeneratePRBS31()
WaveformBase * TestWaveformSource::GeneratePRBS31 |
( |
vk::raii::CommandBuffer & |
cmdBuf, |
|
|
std::shared_ptr< QueueHandle > |
queue, |
|
|
float |
amplitude, |
|
|
float |
period, |
|
|
int64_t |
sampleperiod, |
|
|
size_t |
depth, |
|
|
bool |
lpf = true , |
|
|
float |
noise_stdev = 0.01 , |
|
|
std::function< void(float)> |
downloadCallback = nullptr |
|
) |
| |
Generates a PRBS-31 waveform through a lossy channel with AWGN.
- Parameters
-
cmdBuf | Vulkan command buffer to use for channel emulation |
queue | Vulkan queue to use for channel emulation |
amplitude | P-P amplitude of the waveform in volts |
period | Unit interval, in femtoseconds |
sampleperiod | Interval between samples, in femtoseconds |
depth | Total number of samples to generate |
lpf | Emulate a lossy channel if true, no channel emulation if false |
noise_stdev | Standard deviation of the AWGN in volts |
downloadCallback | Callback for download progress |
◆ GenerateStep()
WaveformBase * TestWaveformSource::GenerateStep |
( |
float |
vlo, |
|
|
float |
vhi, |
|
|
int64_t |
sampleperiod, |
|
|
size_t |
depth |
|
) |
| |
Generates a step waveform.
The waveform starts at vlo for half of the total duration, the instantly transitions to vhi and remains at vhi for the remainder of the total length.
- Parameters
-
vlo | Starting voltage |
vhi | Ending voltage |
sampleperiod | Interval, in femtoseconds, between samples |
depth | Number of points in the waveform |
◆ InterpolateSparameters()
void TestWaveformSource::InterpolateSparameters |
( |
float |
bin_hz, |
|
|
size_t |
nouts |
|
) |
| |
|
protected |
Recalculate the cached S-parameters used for channel emulation.
- Parameters
-
bin_hz | Size of each FFT bin, in Hz |
nouts | Number of FFT bins |
The documentation for this class was generated from the following files: