LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Acquire signal with constant phase in daqmx with external source


@பூபதிராஜா wrote:

Hello mcduff

 

Sorry, I am into any kind of response curve. You are into different tracks which I am not looking exactly. 

 

I am not using any frequency Sweep.

 

I have not noticed any DC offset as you mentioned from my DUT.

 

The guess the link which you have shared might be useful. Let you once thought-out completely. 

 

- Boopathy Raja S


So what does modulation depth mean here? Is your signal amplitude/frequency modulated? Are you trying to demodulate a signal? There are examples of this is the example finder.

 

Maybe if you describe the end result you want we can offer better suggestions. Why do you need constant phase, what type of curve do you want?

 

mcduff

mcduff

0 Kudos
Message 21 of 28
(1,277 Views)

Thanks Kelvin

 

1. I have gone through an idea. I'll follow in my future programming. 

2. I'll enable Retriggerable Analog Start Trigger.

3. Yes, my loop iteration time is the default with 10Seconds.

4. Exactly, the same is what I want. Stopping and staring are actually inside the loop. There is no such activities are planned. 

5. Time consumption is more in reading a fewer sample (let us 10k) with high sampling rates (10M). With this rate and samples, my loop should run in 1ms speed. But due to start, stop, read and extract tone functions which don't allow my loop to iterate exactly in a time which I mentioned as more time consumption. The application will not run for every 1 sec. It should run as much as fast. 

6. Sure I'll remove the property node "Read Most Recent Samples".

7. This I"ll try updating the program

 

- Boopathy Raja S

 

0 Kudos
Message 22 of 28
(1,269 Views)

Hello mcduff

 

Yes, my DUT signal amplitude and frequency are modulated. I know to demodulate the signal and extract the parameters. 

 

Generate a signal (continuous sampling) with 10kHz of frequency, wired to DUT. Get the result (using AI channels) as a modulated signal from DUT, then demodulate the signal. Extract the signal parameters, there will be a change in frequency and phase from DUT comparing input. 

Now the frequency which I have received from my DUT will be processed with input signal parameters through PLL/PID logic. Now I have a constant phase and frequency (Input signal which I generated as output initially). My received signal from DUT will have a different phase and frequency. For each iteration, I can able to get constant frequency though frequency is not the same as input (i.e., Its actual behavior of DUT). But the phase of my signal varies +/- 360deg and there is no repeating pattern. 


So, I raised queries asking the solution to acquire the signal with a constant phase. 

 

This is my exact application. 

0 Kudos
Message 23 of 28
(1,265 Views)

I have good news (hopefully).

 

I tried a quick experiment on a device I had access to based on small mods to a shipping example.  I made a retriggerable finite sampling AI task set for 1 MHz sampling and 100k samples.  In my case, I used a digital edge trigger b/c that's what I could experiment with quickly.

 

The trigger source was the device's internal 100 kHz timebase.  So whenever any one finite acquisition ended, another trigger signal would arrive within 10 microsec or less.

 

This ran for a few minutes without giving me any of the buffer overflow errors I worried about.  I'm honestly not sure how DAQmx managed to do this, but it did.  That gives me optimism that your app could also avoid such errors while retriggering on an analog edge.  

 

The remaining question is whether your DUT signal has the kind of shape to support this.  You'd need the triggering criteria to happen once and only once per period of the DUT signal so you know the AI capture always starts at the same relative phase.

 

Remember, the # samples you define in the call to DAQmx Timing will be important.  Under retriggering, the task will buffer that # samples before rearming the trigger for the next capture.  For your app, this should also be the same # samples you read each iteration.

 

An approach like this with hardware-driven retriggering gives you the best possible chance at the fastest iteration rate.  I don't know if you can achieve a 1 msec loop time though.

 

If the signal shape from the DUT doesn't happen to have a characteristic you can trigger on once and only once per period, there's pretty much much no other choice than to capture continuously and invent some special algorithm in software that can reliably identify a specific phase point.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 24 of 28
(1,251 Views)

@பூபதிராஜா wrote:

Hello mcduff

 

Yes, my DUT signal amplitude and frequency are modulated. I know to demodulate the signal and extract the parameters. 

 

Generate a signal (continuous sampling) with 10kHz of frequency, wired to DUT. Get the result (using AI channels) as a modulated signal from DUT, then demodulate the signal. Extract the signal parameters, there will be a change in frequency and phase from DUT comparing input. 

Now the frequency which I have received from my DUT will be processed with input signal parameters through PLL/PID logic. Now I have a constant phase and frequency (Input signal which I generated as output initially). My received signal from DUT will have a different phase and frequency. For each iteration, I can able to get constant frequency though frequency is not the same as input (i.e., Its actual behavior of DUT). But the phase of my signal varies +/- 360deg and there is no repeating pattern. 


So, I raised queries asking the solution to acquire the signal with a constant phase. 

 

This is my exact application. 


My advice to you is to follow Kevin's advice. Honestly, at this point I am not sure what you need. Sorry I cannot help.

 

You have a frequency and amplitude modulated signal. So I assume the CARRIER frequency is 10kHz and the SIGNAL you are interested in is less than 10kHz. Analogous to a radio, the carrier frequency is 100MHz, and the signal for audio is up to 20kHz.

 

For a FM signal the phase is constantly changing, why, because the frequency is changing. To demodulate a FM signal, you are basically doing a phase unwrapping of the signal. For an AM signal you are basically rectifying the modulated waveform to get the envelope of the modulation.

 

You are going through a PLL (Phase locked loop) which gives your demodulated signal. Is this your 10kHz signal that you now want to know the phase of? If so all you need are more PLLs; that is basically what a lock-in is.

 

mcduff

0 Kudos
Message 25 of 28
(1,243 Views)

Hello Kevin,

 

Thanks for your reply.

 

The DAQ module which I am using for this application does not support the Rereiggerable option. As mentioned in this document.

 

- Boopathy Raja S

0 Kudos
Message 26 of 28
(1,229 Views)

That's unfortunate -- I'm pretty sure the vast majority of the X-series 63xx devices do support it.

 

So now there are 2 options.  One is to use your repeated single-triggering approach in a loop, after one special pre-loop step that'll let you get through your Stop & Re-Start operations faster.   It's based on the DAQmx Task State Model (see also some additional info and a benchmark here).

   As seen in the 2nd link, the key is to do a one-time call to DAQmx Control Task to "commit" the task before getting into your iterating Start-Read-Stop loop.

 

The 2nd option will be more complicated to configure, but stands a chance of getting you back to a hardware-based approach to do retriggering.   I can only outline a few of the key ideas and give you a few links to follow up.  (The links each help explain or various *parts* of the approach, but none of them are an exact fit.)

 

Key Idea 1 - Your device's counters *can* generate a retriggerable finite pulse train.  And your AI task can use that pulse train output as its sample clock.

 

Key Idea 2 - There's an internal digital signal known as the "Analog Comparison Event".  It'll be available after you start an AI task configured to use an analog trigger.  Then you can use this internal signal as a Start Trigger for your retriggerable finite pulse train.

 

Key Idea 3 - The AI task should now be configured as a Continuous task.  Supposing your finite pulse train generates 1000 pulses at 1 MHz per trigger, you should read 1000 samples (or better yet, an integer multiple of 1000 samples) per loop iteration.

   This can be an even more powerful approach than native retriggered AI because you could now read, say, 100k samples per iteration of the loop.  Instead of trying to iterate your loop and calling DAQmx Read every 1 msec, you can read more samples at a time only every 100 msec.  And then you can split those samples up into groups of 1000 from each triggering event.

 

You can find more info too.  Those threads are all ones I was in because I can judge relevance quicker from my own old threads than ones I've never checked out.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
Message 27 of 28
(1,223 Views)

Hi Kevin,

 

Thanks for your suggestions by sharing your knowledge related to my query. I'll come back here if I need some more help from you. 

 

Then if I found a solution, I'll share my program here for others.

 

- Boopathy Raja S

0 Kudos
Message 28 of 28
(1,214 Views)