Jump to content
  • 0

Sine Sweep Waveform Generation in Python


Saeed Zohoori

Question

Hello,

I am a new user of DIGILENT Analaog Discovery 2, and I need a python script to generate a sine sweep signal (for example from 10Hz to 20Hz in 2 seconds) after a certain amount of time (1 second) and runs continuously as shown in the image below.

image.thumb.png.d8c6c162d122aac306b385fcdc619111.png

Is this possible with the device I have? If that is possible, I would truly appreciate it if you could please guide me in this regard.

Thanks,

Saeed

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Dear Attila,

Thanks for your response. I could generate a sine sweep, but still I have a problem.

When I generate a sine sweep at low frequencies, for example from 2Hz to 10Hz, and plot the periods of the signal, I can see that the period is changing continuously as showed in the figure below.

image.thumb.png.5587c9f3531ebe50c96db1ac71450a3d.png

But when I do the same for higher frequencies like 50Hz to 500Hz, the frequency is not changing continuously anymore as showd in the figure below.

image.thumb.png.cb154cb7f58b94eb3bb9c2e094d4293d.png

I even tried with the WaveForms software to see if the problem is with my code or not, but the result was the same. Is there any limitation in generating sine sweep signals with Analog Discovery 2?

I would like to thank you in advance for your kind support.

Thanks,

Saeed

Link to comment
Share on other sites

  • 0

Hi @Saeed Zohoori

The AM/FM buffer on AD1,2 is 2k sample 9bit and newer devices AD3,ADP3X50,ADP2230 is 2k-16k sample 16bit
The deeper and higher resolution gives smoother AM/FM but even the AD2 should be much better than your plot.
Even with 9bit the frequency step for 50-500Hz should be ~0.8789Hz = (500Hz-50Hz)/512, like it is measured here:

image.png

image.png

image.png

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...