From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Signal generation with multiple frequencies in time

Solved!
Go to solution

Hello everyone,
I am trying to generate a sinusoidal signal that changes frequency every 3 seconds. The frequencies to be scanned are previously provided by the user in a table that will be read step by step.
My problem comes from the graph which displays the curves with a too fast scrolling, where the units of the X axis are not in second.
Unfortunately, I don't have an oscilloscope to check the output, I want to rely on the graph display for now.
Do you have a solution for me, or another method to do this signal generation

Thanks in advance, for your time,

 

0 Kudos
Message 1 of 3
(944 Views)
Solution
Accepted by topic author seb.buchy

You have 2 (3?) main problems with your VI:

  1. The Simulate Signal node is set to "Run as fast as possible" - you should change this to "Simulate acquisition timing"
    1. I also adjusted the number of samples to 100 and the samples per second to 1000, you can choose these as you like, but with the setting above ("simulated acquisition timing") this node will take as long as it should for Num Samples / Freq (so with 100 and 1000, 0.1 seconds per iteration)
  2. Your stopping and restarting is more complicated than required - you can replace this with just "Time has Elapsed" going to the Stop condition, and "Auto Reset" constant true.
  3. You're using Express VIs (Simulate Signal, Elapsed Time) - if you used more simple nodes, it would be easier to see what was wrong and you might have not had these problems 🙂

Générateur et analyseur de fréquences.png


GCentral
Message 2 of 3
(934 Views)

Here's a possibly simpler version, using only non-Express nodes:

Générateur et analyseur de fréquences.png

 

I chose 0.1s blocks to update the graph, and used a Property Node to change some aspects of the graph - in particular, I set the "X-Scale Multiplier" to the dt value (so that the x scale would show time in seconds, instead of the index of the plot) and the "History" to an empty array (you can delete this part and see the difference, if you like).

 

The input to the Sine node is 2*pi*f*t, and the output of that node is multiplied by the amplitude to give Y = A*sin(wt).


GCentral
Message 3 of 3
(930 Views)