16.5 Noise waveforms
Noise waveform is a randomly generated signal. Points get randomized between –Amplitude and +Amplitude.
Noise waveform with the following settings
produces a signal like the following
Figure 16-6. Noise waveform signal.
16.6 Frequency sweeps
Frequency sine sweep runs from frequency 1 to frequency 2 in given time period, with constant amplitude. Use Amplitude to set the constant amplitude, FrequencyFrom to set start frequency, FrequencyTo to set end frequency and DurationMs to set the duration in milliseconds.
Figure 16-7. Frequency sweep.
Amplitude sine sweep runs from amplitude 1 to amplitude 2 in given time period, with constant frequency. Use Frequency to set the constant frequency, AmplitudeFrom to set start amplitude, AmplitudeTo to set end amplitude and DurationMs to set the duration in milliseconds.Figure 16-8. Amplitude sweep.
16.8 Starting and stopping
Start the generator by pressing Start button or calling Start method. Stop the generator by pressing Stop button or calling StopRequest method. Stopped event will fire when stopping is complete.
16.9 Multi-channel generator with master-slave configuration
Several SignalGenerator components can be connected together to produce a synchronized, multi- channel output.
Master generator controls sampling frequency, start, stop and output of all generators. Master generator produces the first channel in the output data stream.
Slave generator is connected to master generator by assigning its MasterGenerator property. Define the signal waveforms freely. Slave generator is started and stopped by the master generator. Slave generator gets output data stream channel index in connection order. The slave generators must be connected before starting the master generator.
The output is a two-dimensional array, obtained with a NewSignalPointsGenerated event handler. The event is raised approximately after every Output interval.
The event handler obtains reference to samples array, and the time stamp for first samples bundle of received this round. First dimension of samples array represents channels and second dimensions samples for each channel. All channels have equal sample count.
The event raised is like the following:
private void m_signalGenerator_DataGenerated(DataGeneratedEventArgs args) To investigate the channel count of the data stream, get the length of first dimension channelCount = args.Samples.Length;
To get the sample count for channels
sampleBundleCount = args.Samples[0].Length;
To forward this data directly to SampleDataSeries list of LightningChart, and update real-time monitoring scroll position, use code like the following:
private void m_signalGenerator_DataGenerated(DataGeneratedEventArgs args)
{
chart.BeginUpdate();
int channelIndex = 0;
int sampleBundleCount = args.Samples[0].Length;
foreach (SampleDataSeries series in chart.ViewXY.SampleDataSeries)
{
series.AddSamples(args.Samples[channelIndex++], false);
}
//Set latest scroll position x
newestX = args.FirstSampleTimeStamp + (double)(sampleBundleCount - 1) /
generatorSamplingFrequency;
chart.ViewXY.XAxes[0].ScrollPosition = newestX;
chart.EndUpdate();
}
Note that with args.Samples[0] you can access the master generator’s data. args.Samples[1] gives access to first slave generator data, args.Samples[2] to second slave etc.
© Copyright 2000-2023 COGITO SOFTWARE CO.,LTD. All rights reserved