LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Signal generate

Hi, I have a problem. I have to generate this signal witch I post, but I dont know how. Can anybody help me pls?

 

Using the following sample signal x(t)that is composed of a set of four sinusoidal waveforms joined together in sequence. Each waveform is only composed of one of four frequencies (10, 25, 50, 100 Hz). The definition of x(t)is:

x(t)={\begin{cases}\cos(2\pi 10t)&0\,\mathrm {s} \leq t<5\,\mathrm {s} \\\cos(2\pi 25t)&5\,\mathrm {s} \leq t<10\,\mathrm {s} \\\cos(2\pi 50t)&10\,\mathrm {s} \leq t<15\,\mathrm {s} \\\cos(2\pi 100t)&15\,\mathrm {s} \leq t<20\,\mathrm {s} \\\end{cases}}

0 Kudos
Message 1 of 5
(2,810 Views)

Hi num,

 

composed of a set of four sinusoidal waveforms joined together in sequence

You should do exactly this!

Create 4 waveforms using the same sample rate. Then simply append them…

 

What exactly is your problem? Where are you stuck?

We will not solve your homework by presenting ready-to-use solutions - please show your attempts first!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(2,805 Views)

I stuk in numbers of samples ... I need to create samples form 5 to 10 on the graph ... but when a choose a constant number in samples number it start to count from zero ..

0 Kudos
Message 3 of 5
(2,787 Views)

Hi num,

 

you need to create 4 waveforms, each of them for a time range of 5s.

Once you got your 4 waveforms: append them to get a single waveform of 20s duration!

 

Example with just 2 waveforms:

check.png

 

I stuk in numbers of samples ..

What exactly is your problem?

Each waveform represents a duration of 5s: "number of samples := samplerate * 5s"…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 5
(2,783 Views)

Hi,
I really think we shouldn't do you homework instead of you but here could be the possible way how to do it more scalable. Basically you can generate and concatenate signal segment for each item in the Signal Definition array. Sample rate will be just another input parameter of your signal generator.

 

Code Snippet.png

 

.. and the result can look like this:

Results.png

Good luck!

 

Ondřej K.

NIEE AE

CLA, CTA, CLED
Message 5 of 5
(2,761 Views)