Waveform Generator (VCO)

Moku model: Moku Delta
Operating system: Windows 11
Software version: 4.1.1

Bug or support request description:

I am trying to operate the instruments from MATLAB. I always thought the Waveform Generator as VCO whose frequency is very prone to adjust. Vut it turns out that when I try to update its frequency in a MATLAB script it takes too much and unconsistent time (0.45 seconds)? Is there a faster and better way to update the waveform generator from API? The “codeword” that I am calculating to update my VCO frequency is something I have to calculate on PC. Therefore in my MATLAB API loop I wanna use it and update the frequency of Waveform Generator.

Thanks in advance.

Hello @alkmbozkurt ,

If you are trying to use the waveform generator as a VCO, do you have a tuning signal to adjust the frequency? Typically VCOs operate by using a time varying DC signal to adjust the frequency. If so, you can configure your waveform to have frequency modulation, and feed the tuning signal to the input. This will allow the waveform generator to behave as a VCO.

You can also use the API to dynamically adjust the frequency, but this may not adjust the frequency fast enough. I hope this helps!

-Dylan

Hey, Thank you for your help. I do have a tuning voltage signal, but that is being computed within my API. Thats where I have a problem.

Hello @alkmbozkurt ,

Thank you for getting back to me, could you please describe a bit about your setup? You mention that you have a tuning voltage signal, where is this signal coming from? Is it being sent to one of Moku’s inputs? What is the output of the Moku connected to? Could you share a bit about what your script is doing? Looking forward to hearing from you!

-Dylan

Hello Dylan,

Thanks for respose. So I am making a demodulation using lock-in amplifier and extracting real time X/Y values. I am doing this from MATLAB API. Then, I am feeding this X and Y values to a custom MATLAB function of mine. This custom MATLAB function yields a ‘number’ based on X and Y values. I am using the outcome of the of this function as a ‘codeword’ to update the frequency of the waveform generator. I am doing this in a MATLAB loop. What I observe is, every 5th or 6th ‘frequency update’ of voltage_generator, the update does not happen and loop lags. I was asking for is there any more efficient way to update the frequency of the VCO from MATLAB API.

Hello @alkmbozkurt ,

Thank you for the clarification! Just to be clear, you are demodulating a signal with the Lock-In Amplifier, collecting the corresponding X and Y values, and calculating a value that is used to tune the Waveform Generator? If this is the case, I would recommend to use Custom Instrument to do the signal processing in real time onboard Moku. Using the API to implement this type of feedback is going to be much too slow.

Instead of collecting the data from Moku and using MATLAB to calculate the tuning signal, you can implement the algorithm directly on the FPGA using Custom Instrument. In this set up, the X and Y values are fed to Custom Instrument, and you can create an algorithm in Verilog or VHDL that will generate a tuning signal on Output A of the Custom Instrument module. Here is a page that describes Custom Instrument and Moku Compile. I hope this is helpful!

-Dylan

Exactly, you get the operation correct. Well I considered implemeting a custom DSP block to do the signal processing but my custom function is pretty complicated, requires special libraries etc. I will definetly give a try to Custom Instrument. I have seen bunch of examples on different VHDL or Verilog codes of different custom instruments but is there a well defined documentation for how to make your own DSP block on Custom Instrument? And lastly, is it possible to use external VHDL libraries / IP cores inside a Custom Instrument VHDL block?

Thanks in advance!

@alkmbozkurt ,

This link is a good starting point for getting started with Custom Instrument and Moku Compile; we also have a lot of prewritten examples on our GitHub. It is possible to use external libraries and IP cores as well. We have a few precompiled IP cores which can be accessed here, and you also have the ability to import your own IP cores by uploading the .xci files, you can read more about that here. I hope this helps!

-Dylan