You are here

Best way to generate two sine waves, one with a 90 degree phase shift | Cypress Semiconductor

Best way to generate two sine waves, one with a 90 degree phase shift

Summary: 7 Replies, Latest post by Evan D on 14 Jul 2016 09:49 PM PDT
Verified Answers: 2
Last post
Log in to post new comments.
Evan D's picture
User
26 posts

Hi Guys,

First time developer here. I'm using PSoC 5LP. The documentation is great, there is a lot of information on generating  waveforms (AN69133, CE95402). I would like to generate two sine waves, one 90 degrees out of phase with the other for synchronous detection. What's the best/most accurate way to do this in PSoC? Do you use some kind of one shot timer to start the second sine wave? Is the WaveDAC8 component the best one to use?

user_342122993's picture
User
804 posts

Evan,

subject was discussed recently in this thread with several demo projects provided:

http://www.cypress.com/forum/psoc-5-architecture/generating-multiple-wav...

 

Other component (DDS24) which was designed for lock-in detection can be found here:

http://www.cypress.com/forum/psoc-community-components/dds24-24-bit-dds-...

 

 

Just wonder, how do you plan to use two sinusoids for lock-in detection?

Evan D's picture
User
26 posts

Thanks for the links. Regarding synchronous detection, I thought the reference signals (in phase and 90 degrees out of phase) were the same as the original (sine wave). I'm trying to calculate the magnitude and phase. Is that wrong? Or are you hinting the phase relationship is wrong?

user_342122993's picture
User
804 posts

My thought was that sometimes it is easier to have one excitation sine source, and two digital references, shifted by 90 deg. PSoC equipped with 2 analog modulators, which can be driven by those digital references. In case you can afford to measure X and Y data sequentially, you can use DelSig_ADC with Modulator input enabled.

Evan D's picture
User
26 posts

So using a PWM/DDS to generate a pulse at the same frequency would be better than a sine wave to generate X and Y?  I'm committed to using some non-PSoC analog IC's but it looks like the three waveforms could be generated by the DDS24 module using a single clock reference. Regarding the ADC - measuring X and Y wouldn't you want to sample them at the same time. When can you afford to sample them sequentially (bit off topic but really appreciate the feedback)? Thanks.

user_342122993's picture
User
804 posts

Sorry, I havn't read your message carefully. Surely there are good analog and digital ICs to implement lock-in (AD630, AD9953, etc.). PSoC also allows to implement complete analog lock-in inside a single chip. The quality of such lock-in most likely shall not be on par with dedicated components, but from personal experience, at the end of the day it may not matter much, but the speed of development, cost, size, power consumption also factors-in. I once compared performance of PSoC- based lock-in with digital one SR830, and in given setup it was about the same.      

user_342122993's picture
User
804 posts

I would refer to this article about two kinds of lock-ins: analog and digital

http://www.edn.com/design/analog/4437926/Use-synchronous-detection-to-ma...

As it described, digital lock-ins (which multiplies amplified signal to sin(t) and cos(t) in real-time and then calculates R=sqrt(X^2 + Y^2) and phase tg=X/Y), are better in terms of S/N. Unfortunately, PSoCs UDB resources are not enough to run it (but it can be done with CPU at low frequencies <100Hz).

Another is analog implementation of lock-in, which uses analog modulator (OPAMP with transfer coefficent being swithced between -1/+1 ). This can fit into PSoC. Several examples can be found on this forum.

PSoC5 has 2 such modulators, so theoretically both X and Y can be recorded simultaneously. There is some shortcut: if you rotate phase of the reference signal to the right angle, one of the signals (X or Y) can be made 0, and then you need to measure only one signal.

Sometimes, for example when you measure impedance of the static RC circuit (multimeter project), X and Y measurements can be taken sequentially to save resources.

 

Lastly, there are some examples of the lock-in project which may be useful:

http://www.cypress.com/forum/psoc-5-device-programming/need-demo-program...

 

Impedance meter (somewhat dated)

http://www.cypress.com/forum/psoc-community-components/psoc-today-impeda...

 

and snapshot from the project showing use of the mixer component for same goal

Evan D's picture
User
26 posts

I'll have to go through and digest all that. Thanks for the feedback. 

Log in to post new comments.