Tsunami
Randall_McRee
—
2015-08-24T03:23:09Z —
#1
Hi there, I'm hoping to use the tsunami for frequncy generation in a circuit which currently has two inputs
1) a triangle or sine wave
2) a square wave of the same frequency (clock)
BUT, the sine wave must be 90 degrees out of phase with the clock. Can I program the tsunami to do this? Seems like the DDS has the capability but I don't see this in the tsunami documentation.
Thanks in advance,
Randy
Randall_McRee
—
2015-09-10T22:46:38Z —
#2
Would still be nice to know the answer to this--but I have changed my design to create 90 degree phases from the incoming waveform, so no worries.
nickjohnson
—
2015-09-11T06:32:49Z —
#3
Tsunami can certainly do this, but there aren't yet setPhase methods in the Arduino library. I've opened a bug to remedy this.
The main reason I haven't added them yet is because I was uncertain about the interface. Floating point phase between 0 and 1 is most straightforward for the programmer, but floating point code is slow. Integer phase between 0 and 2^n is efficient, but harder for new users. Providing two overloads is a bad idea because the two options have different domains.
What would be most useful for you? Any thoughts?
Randall_McRee
—
2015-09-11T17:26:32Z —
#4
I like the integer-based method.
Floating point is ugly. For one thing the programmer will be unsure of any round-off error and how the device might interpret it. Worst case you ask for phase n+epsilon and get n+1 or n-1.
In either case documentation is key.