12-12-2013 11:49 AM
I need to plot a resulting newWaveform from these two waveforms A and B as follows :
newWfm = a*WfmA + b*WfmB
where b is a constant (for example '5')
'a' varies from 0 to 20 with a step of 1
I will have 20 newWaveforms (for each value of 'a')
Do you have any idea how to vary 'a' and plot the 20 Waveforms properly ?
Thank you !
12-12-2013 12:12 PM - edited 12-12-2013 12:12 PM
Use a for loop.
12-12-2013 12:34 PM - edited 12-12-2013 12:36 PM
.
12-12-2013 12:36 PM
Thank you very much for your answers.
Can we increment 'a' of more than 1 ?
The exact variation I am looking for is : 'a' varies from 0 to 1000 with a step of 50
12-12-2013 12:45 PM
Sure. Instead of wiring to the iteration terminal, use a shift register. It can be initialized to anything you want and instead of the Increment function, use an Add function with a control for the step size. You can also use the Ramp Function with the type set to Ramp by Delta. This creates an array that you wire into the for loop. Then you don't connect anything to the 'N' terminal. Give both a try and see how far you get.
12-12-2013 01:28 PM - edited 12-12-2013 01:28 PM
I removed the wiring from the iteration terminal and I added a shift register.
However, I can't find neither the "Add function with a control for step size" (for the 1st method), nor the "Ramp Function" (for the 2nd method).
Could you please just help me with the palettes or the forms ?
Thank you !
12-12-2013 01:33 PM
Add is on the Numeric palette. Ramp Pattern is on the Signal Processing>Signal Generation palette.
On your function palette, there is a button called Search. It would have found the functions quicker than posting here.
12-12-2013 02:13 PM
Sorry, I was looking for the Signal Processing palette that wasn't in my functions.
Please, find attached one of the input channels with the Ramp Function.
It should be well connected right ? what it the Ramp Pattern in the gray window ? It was on 0 so I adjusted it to 1 and then I marked 21 Samples (I am not sure if I need it).
Thank you !
12-12-2013 02:28 PM
No, it is not at all 'well connected'. The output called Ramp Pattern is the array of steps and that is what you should be wiring to the for loop. With a delta of 50, an end of 1000, and a start of 0, you will have exactly 21 samples in the array.
12-12-2013 02:59 PM
Thanks for having fun of my english !
I still have an error after the 'add' on the wires: the Time record 8 shows an error after the FOR loop.
Do I need to connect it to the output of the shift regiter ?