Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Rising and falling time of square wave

Solved!
Go to solution

Hello Everyone,
I am generating 2 square waves of different frequencies and duty-cycle and when I multiply that 2 waveforms then the rising and falling time gave me peaks. Actually, I want to reduce the rise and falling time of the square wave. How I can do this kindly suggest me any solution to this.
Thanks

0 Kudos
Message 1 of 11
(3,909 Views)

Square waves will by definition (if digitaly created) have the steepest possible rise and falling edge. How are these square waves generated? Do they come from outside Labview? Depending on your timing and scope settings, the edges may appear smooth, due to interpolating lines appearing between the acquisition points, while they may be actually very steep.



0 Kudos
Message 2 of 11
(3,894 Views)

Thank you Lysandros,

I generated these square wave by using LabVIEW coding and I just want to reduce the rising and falling time of the square wave. So is this possible to do or not. And the waveform generated by using function generator function.

Thanks for considering.

0 Kudos
Message 3 of 11
(3,892 Views)

You're probably just seeing a visual artifact.  By default, the graph draws between defined sample points to connect them.

 

Show the plot legend, then *in* the legend right click the plot and choose a different style of interpolation.  Some of them will draw horizontal lines between known sample points with pure vertical transitions at the sample points.   I sometimes choose one of these styles when showing DAQ data because it seems suitable considering the way the A/D and D/A converters work.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 4 of 11
(3,886 Views)

Dear Kevin,
Thanks for the reply, I try interpolation and then I got the attached graph, but the issue remains the same, I think maybe the duty-cycle or frequency problem, maybe if I can set the appropriate duty-cycle then the alignment or the peaks removed.
Or some other issue.
Thanks for your consideration.

0 Kudos
Message 5 of 11
(3,884 Views)

I guess I don't understand what the "issue" is then.  The graphs certainly don't look the same.  They visually show instantaneous-looking transitions, which is what I thought you wanted to see.

 

Apparently, you still have some problem related to the underlying data.  To help with *that*, we would need:

1. A very clear description of what you want or expect

2. The actual data you are using to illustrate the problem

3. The code you use to manipulate the data and create these graphs

4. Further description of why you think the results you get aren't right

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 6 of 11
(3,881 Views)

Dear Kevin,

Thanks again for your interest,
Actually, first I generate 2 square wave names are TRIG and RST, then I want to reverse my RST signal then I want to multiply my TRIG and reverse RST signal and the output is my result.
I attached the timing diagram of my signals, I hope now you can understand after seeing the diagram.

And Also suggest me how I can reverse my RST signal, I do it by using rotate 1D array function, but not show the perfect results.
Thanks

0 Kudos
Message 7 of 11
(3,878 Views)

@Shesha12345 wrote:

Actually, first I generate 2 square wave names are TRIG and RST, then I want to reverse my RST signal then I want to multiply my TRIG and reverse RST signal and the output is my result.
I attached the timing diagram of my signals, I hope now you can understand after seeing the diagram.

And Also suggest me how I can reverse my RST signal, I do it by using rotate 1D array function, but not show the perfect results.


A few things:

  1. You're generating your signals in a sampled (quantized) domain in software. The graphs show these subsequent points connected with lines that are just a software construct.  (Right now, there's one point at -25 and the next is at 25, and the graph just connects these with a straight line.  The dt is what is going to determine how vertical that line looks on the graph.)  I want to be clear that no matter how your signals render on the plots, the rise/fall times are NOT an accurate indication of how these transitions will appear when you generate them on an actual analog output or function generator and scope the line.  The way they appear in the analog domain will be a function of the slew rate, bandwidth, filtering, impedance, etc. of the DAC, trace, and acquisition device.  It appears that your time scales are extremely long, so I imagine that your edges will "look" sharp when you scope them.  If you're asking whether a certain rise/fall time is actually possible, you'd have to provide that number and the hardware you're using to know if that's possible.  Basically, I wouldn't worry about how the rise/fall times appear on the graph if what you actually care about is what they'll look like when you generate them.  The two are unrelated.
  2. You're using the term "reverse", but what you really mean based on your drawing is "invert".  There is a LabVIEW function called "negate", which will multiply your signals by -1, which is what you're looking for (assuming they're all centered around 0 as they are in the graphs you shared).
0 Kudos
Message 8 of 11
(3,858 Views)

Dear croohcifer,
Thank you so much for your suggestion, actually my 2nd problem is solved now I want actually the same invert signal after the use of " Negate" function and for rising and falling time I can understand your point and sorry for reverse and invert, I am new in LABVIEW so sorry and thank you for your help.

Thanks 

0 Kudos
Message 9 of 11
(3,856 Views)
Solution
Accepted by topic author Shesha12345

[Worked on a reply & example intermittently, then noticed additional activity just before posting.  I think I'm mostly addressing a different aspect of things, hopefully something below is helpful.]

 

[And then when trying to post, I found that my connection had timed out hours ago and I lost most of what I wrote up.  I'll at least post the example and try to summarize.]

 

Closer to clarity, but still kinda confusing.  Your msg #1 picture attachment shows waveforms that vary between +/-25 and +/-5 respectively.  Your msg #7 shows something much more straightforward with digital signals that vary between (logical) 1 and 0.

 

You speak of *multiplying* your square waves, which works out to be the same as a logical AND when you work with signals as they are shown in msg #7.   You should deal with the signals in *logical* form as much as possible.  If you need to scale to +/-5 or whatever, wait and do that as a very last step.

 

Attached is a pretty simple example that generates a pattern like you showed in the msg #7 timing diagram.  Some of the constants have a mathematical relationship to one another and in real code, some should be calculated based on the others.

 

The vast majority of the code has to do with (1) generating the square waves and (2) converting them into a format that lets me display them in a digital waveform graph.  The actual logical combination part is pretty much trivial.

 

 

-Kevin P

 

square wave logic - front panel.pngsquare wave logic.png

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
Download All
Message 10 of 11
(3,841 Views)