Jump to content

I have a slight dilemma...


Recommended Posts

Ok, so I am having major issues. I have spent several hours attempting this, seemingly simple problem...

This is what I am trying to do:

I am trying to create a program that receives a square wave synch input at 40khz. From here, I am trying to detect the beginnning of the positive flat portion of the square wave. From here, I need a for loop that recognizes the beginning of the positive flat portion, then outputs a short pulse at this point.

However, there is a trick.... I need the first output pulse to be right at the beginning, then the second output pulse to be output at about 1/4 of the way through the positive portion of the square wave, then the third to be about 1/2 way through... and so on and so on.

Any help would be great. I know there is something that I missing big time. Because I really should be able to do this in about 10 minutes.

Link to comment
Please upload the code you've already tried so we have something to comment on.

the only code I have thus far, is the signal generator and the signal analysis. The rest is kaput so I deleted it to attempt a different way. Is what I was doing, was send this signal through a peak detector and send it to my loop. This is where I am having the most trouble I can't seem to output the short pulse. And I also am having troubles jumping through the segments of each square wave.

Link to comment
I'd still like to see the code - and also a data file with your signal in it, if that's at all possible.

Alright, here is a really rough sketch of what I am trying to accomplish... I have that INPUT sync, and I am trying to create that output signal. I will post my code in the morning. Its on a different computer.

Thanks so much!

post-7441-1168123845.jpg?width=400

Link to comment
I am using a PCI slot DAQ and just then standard TI switch board interface card to talk to the DAQ for the inputs and outputs.

Hi Snowman,

It looks you are playing on both forums. Was your dilemma deciding which forum to post to? :shifty:

Your diagram now gives us some ideas but now it is time for details.

What is teh freq of the sync signal?

How fast are you sampling the sync?

According to one of your posting you mentioned 40Khz. Is that the sample rate or sync pulse rate?

After the timing seq you showed, does you output continues to skew relative to the sync?

From what little I know about your app, I am thinking that this would be

simple using cRIO

Challenging in LV RT

Possible under Windows if this can be implemented in hardware.

Here is a link to the NI Exchange discusion

http://forums.ni.com/ni/board/message?boar...=222937#M222937

Ben

Link to comment
Ha, ya I am trying to get as many ideas as I can. The sync is at 40 khz. I believe I am sampling at 1M. And yes, the output does continue to skew relative to the sync.

Ok here's a link to an example (ahem) from the NI web-site that shows a Phase Locked Loop (PLL).

http://zone.ni.com/devzone/cda/epd/p/id/5153

I have hacked the example (ahem) to see if this is what you are after.

post-29-1168191680.png?width=400

Ben

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.