I have several points that make a sinusoid, but I want to do two more sinusoids offset 120 degrees from the first. My problem is I only have the amplitude values at each instant of time, as can offset the 3 waves?
How many points? Do you know freq.? More details?
My crystal ball tells me that your Arduino DUE only has two analogue outputs.
I don't know what that means.
I'll try my ouija board.
Leo..
Magician:
How many points? Do you know freq.? More details?
A freq is 50hz, the points y don't kwon .. arduino made it automatically
If you are streaming data somewhere else., to PWM or DAC, than simply use delay for 1/3 of a period.
Magician:
If you are streaming data somewhere else., to PWM or DAC, than simply use delay for 1/3 of a period.
Sorry , i don't understand , i just have this values :
3,23
3,22
3,19
3,12
3,04
2,92
2,8
2,65
2,49
2,32
2,14
1,96
1,79
1,63
1,48
1,34
1,23
1,14
1,07
1,04
1,03
1,05
1,09
1,17
1,28
1,39
1,53
1,69
1,86
2,03
2,21
2,38
2,55
2,71
2,84
2,97
3,07
3,15
3,21
3,23
So with this values i want to make 2 more wave offset 120 degrees...
start from here:
http://interface.khm.de/index.php/lab/interfaces-advanced/arduino-realtime-audio-processing/
Concept of ring buffer, you have to learn, setting offset to 1/3 of the buffer (if size is adjusted for 1 period, or 20 milliseconds in your case) provides 120 degree phase shift or delay
So with this values i want to make 2 more wave offset 120 degrees...
Those values can only represent a waveform if there is a time (or angle) associated with each value. Without timing, it's just a list of numbers.
That list appears to be one cycle (360 degrees). 180 degrees is half way down the list, and 120 degrees is 1/3rd of the way down the list. Another 120 degrees is 2/3rds down.
Or, I count 39 steps (not counting 3.23 repeated at the end). So, that's 9.23 degrees per step.
As you may know, this is an offset or biased sine wave (assuming it's a sine wave). A true sine wave crosses through zero and goes negative. But, the Arduino can't put-out negative voltages. If you want to find the offset, take the average over one cycle.
P.S.
An easy way to do this would be to make two more lists/arrays, each offset by one third (about 10 counts). But, that would be inelegant... Experienced programmers would ridicule you, and if it was homework you wouldn't get a very good grade!
P.P.S.
If you want to be more elegant, make a table for 90 degrees and use subtraction & inversion to get the other 3 quadrants.
DVDdoug:
An easy way to do this would be to make two more lists/arrays, each offset by one third (about 10 counts). But, that would be inelegant... Experienced programmers would ridicule you, and if it was homework you wouldn't get a very good grade!
Nah - experienced programmers would look at the domain of the problem, and the possible solutions to the problem - then, given that information plus the knowledge of the platform being deployed to, a decision as to the memory vs speed tradeoff would be made in regards to the needs, domain, and solution(s).
In other words, using more memory for extra arrays may be the right choice, depending on what problem is being solved.
...this isn't one of those cases, though.
Thank you all for the help but I still can not get the results he wanted. I can not be read in real time the amplitude value of a wave and through that create value other two offset waves 120 degrees.
the main problem is that i want to do all of this is real time!