02-22-2019 04:49 AM
Dear Forum Members,
I'm trying to generate half of a sine wave but I need only the first wave. So I multiplied a sine wave with a square wave generator. I get a very good signal as follows...
Problem:
I want only the first wave and the rest zeros. Something like below,
I tried using a ramp function and the unit step function. But the problem is, I want to generate for 6-10 Hz and they become less and less accurate for times, lesser than 1s.
Could you please help me? Maybe an easier method to work this out.. My vi is attached(.vi +.jpg).
Thanks have a nice day 🙂
Best,
Shane.
Solved! Go to Solution.
02-22-2019 04:53 AM
02-22-2019 06:59 AM
@GerdW :
Yes. That is my intention but how to create a square wave with just one pulse? Do you mean to get them to the array and after some time, append every element to zero? Or is there an easier vi to generate a square wave with just one pulse. (which works in the ms range)
Thanks in advance GerdW
02-22-2019 07:40 AM - edited 02-22-2019 07:40 AM
02-22-2019 07:53 AM
Let me see if I understand the problem:
Sometimes you just create a function. Here is "Half-sine":
Half-Sine
(the False case of the State is 0, of course). And here is a generation of the first 100 points of a Half-Sine having a period of 50 (which should be a half-sine from 0 to 25 and zero everywhere else):
Generate Half-Sine
If you need something a little more complicated, your Generating Function would be a little more complicated ...
Bob Schor
02-22-2019 09:24 AM - edited 02-22-2019 09:25 AM
Hi Gred, Thanks it works. A small question, The Sinus wave now only plots upto 1s. this becomes a Problem when going to lower frequencies. Can this be resolved using a viewing option enabled? or what am i doing wrong here?
02-22-2019 10:20 AM
02-22-2019 11:47 AM
Yes, but as i understand it has nothing to do relative display or absolute and it depends on the fs and sr....
02-22-2019 12:57 PM
Hi @GerdW
Thank you for the first stone for solving the problem. But that was only true when the fs=#s. so changing the properties of the front panel doesn't help. (As I know but correct me if I'm wrong). Did a few modifications based on your guidance on your code so that now always you get one pulse.Thank you. have a nice..
I'm just posting the following code for future references for the NI.
evening...