# Harmonics in Lockin Amplifier

**URL:** <https://forum.liquidinstruments.com/t/harmonics-in-lockin-amplifier/537>\
**Category:** New Features, Requests, and Feedback\
**Created:** [June 6, 2022, 3:19pm UTC](https://forum.liquidinstruments.com/t/harmonics-in-lockin-amplifier/537 "2022-06-06T15:19:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![alaaeldin](https://avatars.discourse-cdn.com/v4/letter/a/f05b48/32.png) [@alaaeldin](https://forum.liquidinstruments.com/u/alaaeldin)\
**Post date:** [June 6, 2022, 3:19pm UTC](https://forum.liquidinstruments.com/t/harmonics-in-lockin-amplifier/537/1 "2022-06-06T15:19:42Z")

</div>

I am requesting a feature to be able to lock on a harmonic and excite at fundamental similar to what you have in the Freq. Response Analyzer. To better illustrate, I am attaching an image.  
Also, if this can be done using Python, please let me know how as I cannot wait long enough for the feature to be available.

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/liquidinstruments/original/1X/2042d86af43a09d178ccc4b772cda72dd0061808.jpeg)

---

<div class="post-metadata">

**Author:** ![bnizette](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.liquidinstruments.com/bnizette/32/72_2.png) [@bnizette](https://forum.liquidinstruments.com/u/bnizette)\
**Post date:** [June 7, 2022, 3:59am UTC](https://forum.liquidinstruments.com/t/harmonics-in-lockin-amplifier/537/2 "2022-06-07T03:59:12Z")

</div>

Hi Alaaeldin, welcome to the LI forum! The best way to modulate and demodulate at different frequencies at the moment is to use the “Aux Oscillator” output option as below. The caveat is that the LO and AUX oscillators don’t have a well-defined phase relationship (each one starts when it’s turned on, they don’t start together). Depending on your measurement, you may need to tune the LO’s phase manually to bring it in line with the AUX phase, or compensate for the offset in some other way.

The Aux oscillator is enabled in Python using `set_output(aux='Aux')` and its settings are configured using `set_aux_output(...)`. If the phase relationship is important to you, you can enable monitors on the “Demod” and “Aux” probe points to monitor the phase relationship, then use `set_demodulation` to bring them in to phase.

Even with the above workaround this is a good feature request and something we’re currently looking in to. Thanks!

Ben.

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/liquidinstruments/original/1X/fec557fddf002aacda32c8f1d22a7c2eb0d817b9.jpeg)

---

<div class="post-metadata">

**Author:** ![alaaeldin](https://avatars.discourse-cdn.com/v4/letter/a/f05b48/32.png) [@alaaeldin](https://forum.liquidinstruments.com/u/alaaeldin)\
**Post date:** [June 9, 2022, 1:01am UTC](https://forum.liquidinstruments.com/t/harmonics-in-lockin-amplifier/537/3 "2022-06-09T01:01:46Z")

</div>

> [@bnizette](#):
>
> n with the above workaround this i

Thanks for the reply. If you are considering this as a future option, I recommend you add an ability to sweep the oscillators as well.

---

<div class="post-metadata">

**Author:** ![bnizette](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.liquidinstruments.com/bnizette/32/72_2.png) [@bnizette](https://forum.liquidinstruments.com/u/bnizette)\
**Post date:** [June 9, 2022, 1:18am UTC](https://forum.liquidinstruments.com/t/harmonics-in-lockin-amplifier/537/4 "2022-06-09T01:18:19Z")

</div>

Thanks, yes, good idea!

At the moment we recommend that you use Multi-instrument mode to accomplish this, it provides a lot of flexibility. You can put a Waveform Generator instrument (or even an AWG) in one slot and use it as the demodulation source for a Lock-In in an adjacent slot. You can then generate frequency sweeps (or any other waveform you like) and feed that downstream. The drawback in your application is that we currently don’t support MiM through our APIs, that’s coming soon.

API issues notwithstanding, this configuration would work well for your original problem too. In MiM, you can use a WG with two outputs, one at the fundamental and one at the harmonic. One of these is routed to an output to modulate, the other to the LIA to demodulate. The reason this is better than using the Aux oscillator is that the WG has a “sync phase” button that gives you a well-defined phase relationship between the two waveforms.
