From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

get waveform subset vi lagging

Hello all,

 

I'm running into an issue with a Get Waveform Subset.vi taking an awfully long time to run (~15s). I'm working with a large-ish data set (5431296 data points). I double checked with the Performance and Memory tool and it's defiantly something with this VI.

 

The program is suppose to grab a new subset from the waveform and look for a trigger, record where the event happens, then move onto the next subset and repeat. 

 

Am I doing something wrong with the VI to make it lag so much? Or better yet, is there a better way to do what I'm trying to accomplish? 

 

 

 

0 Kudos
Message 1 of 9
(3,000 Views)

What values are you using for Start samples and Duration? Do you get any errors? How many iterations does it run?

 

It is very difficult to troubleshoot an image, especially with the wires running behind other objects and not entering the terminals in straight left to right wiring.  Please post your VI with typical data saved as default.

 

Get out of the habit of using local variables as shown in your image. Just run a wire from the source to the three divides.

 

I created a VI which creates a waveform with the 5M samples and it takes about 146 ms for Get Waveform Subset.vi to extract a small subset. It goes up to about 162 ms for a subset of ~1.2M samples. So, if you are taking ~ 100 subsets, then 15 s may be about right.

 

Lynn

0 Kudos
Message 2 of 9
(2,970 Views)

Hi Lynn,

 

What values are you using for Start samples and Duration?


Start:
333131 initially then it increments depending on where the triggered edge is 

Duration: 55 samples

 

Do you get any errors?

None that I could see. The Get Waveform Subset vi rounded my duration and start sample values which I was fine with.

 

How many iterations does it run. 

The current code runs ~800 - 900 iteration. 

 

So since it last posted, I removed the Get Waveform Subset vi and replaced it with a ArraySubset thinking it would speed things up. Turns out the Get Waveform Subset vi is fairly optimized already...go figure.I also decimated my waveform using the Resample Waveform vi to reduce the number of samples in each subset. By playing with my re sampling interval, I was able to reduce the run time to ~ 3 seconds.

 

 

So here's what I'm actually trying to do and for full disclosure, yes, it is for a school assignment.

 

I have a signal from a NOAA satellite that I'm trying to convert into a image. The data is sent using APT format and is not real time, rather just an audio file. I have managed to demodulate the signal and removed the carrier wave and filtered the signal appropriately. What I'm having issues with is detecting synchronization pulses in my signal. Right now, my sync pulse detection scheme involves running a FIR bandpass filter at the sync pulse frequency and then using trigger detection to find where my sync pulses start.

 

Am I going about this the wrong way? Is there a more efficient method I should be looking at. 

 

Honson

 

0 Kudos
Message 3 of 9
(2,960 Views)

Honson,

 

It does not surprise me that the Get Waveform Subset.vi performs well.  NI is pretty good about getting performance from the VIs in vi.lib.

 

A filter is probably the wrong way to get the sync pulses. First, the filter removes the harmonics which eliminates the sharp edge normally associated with a sync pulse. Next, the filter adds phase shift and delay so even if you find the sync pulses, you will not know exactly when they occurred.

 

From the APT link it appears that the sync pulses are nominally square waves at 91% of full scale amplitude.  I will have to think about what it means to amplitude modulate a 2400 Hz carrier with a 1040 Hz square wave.  The modulation cannot be phase synchronous with the carrier, so there must be some strange waveforms produced.  With your ~11 kHz sampling you only get the fundamental and two harmonics of the square wave.

 

I think I would look at time domain signal processing rather than frquency domain processing for finding the sync pulses.

 

Can you post short segments of the waveform which contain the Sync A and Sync B signals?

 

Lynn

0 Kudos
Message 4 of 9
(2,948 Views)

Attached a image of the Sync A and B Pulses as requested. Sync A starts at 41.71s and is followed by Sync B at 43.97. I also attached a image of Sync A.

 

The filter was my quick and dirty way, and as I totally understand, the incorrect way to find my sync pulses. I figured that since my Sync A pulse would be the only component in my signal that produces a constant 1040Hz wave, a bandpass filter would able to at least tell me where I can start looking.  

 

I demodulated the original signal by multiplying it with two sinusoidal waves that were 90 degrees out of phase with a frequency of 2400Hz to knock out the carrier. A low pass filter was then used to pick out my baseband signal as it only occupy a frequency space from 0-1600Hz.

 

I've been tempted to do the same thing with the signal I have now...multiply a Sync A square pulse with my signal in the time domain to 'demodulate' one more time the signal to find out where the Sync A pulse starts.

 

I'll see where I get with time domain DSP for these sync pulses.

 

 

 

Download All
0 Kudos
Message 5 of 9
(2,944 Views)

As expeted, trying to 'demodulate' the Sync A pulse to find where it is does not work. Silly me. 

0 Kudos
Message 6 of 9
(2,926 Views)

After reviewing my demodulated waveform (see attachment)..I've come to the conclusion that I can just use the basic trigger level vi to detect the start of my Sync A pulse if I use a level of 0.525 and a hysterisis of 0.4.

 

Will report back. 

0 Kudos
Message 7 of 9
(2,920 Views)

Part of the reason may be that the frequency may not be exactly 1040. I think I recall seeing something in the Wikipedia article about the rate possibly varying somewhat.

 

Are the low voltage segments before and after the sync bursts part of the specification or just blank areas in the images?

 

Can you post some of the actual data - not an image? I would like to see the carrier data in the time shown by the Sync A image.

 

Lynn

0 Kudos
Message 8 of 9
(2,919 Views)

There's a phase difference that's added to the signal as the satellite moves relative to the receiving station. Not looking forwarded to the phase lock loop that needs to be implemented either. 

 

The low voltage after and before the signal burst should be either a part of the telemetry data or just a space/minute marker. 

I've attached the original signal. I can upload my demodulated signal as well if needed. 

 

 

 

 

0 Kudos
Message 9 of 9
(2,910 Views)