LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Create a sweep signal with a taper

Hello!

 

I'm relatively new in Labview and I would really like some help with a project I'm working on. 

 

My goal is to create a logarithmic sweep/chirp signal, starting from 20Hz up to 500Hz, with a taper of 10% both in the start and at the end. Sample rate at 50kHZ,5000 samples, going on for 10 seconds. Thus, the frequency should rise for 100ms in the start, and then decay down to 20Hz again in the end. 

 

Because you can not fix the frequency in the chirp pattern.vi, just set f1 and f2, i've chosen to work with the sine signal instead. I try to use a cosines angular velocity, from 0 to 90 degrees, as the frequency for the sine signal during the first 100ms, and then from 90 to 0 degrees for the last 100ms. But I don't really know how to implement it in my program. 

 

If someone has a better idea or any suggestions on how this can be done, I would be forever grateful!

 

Best regards, Oscar

0 Kudos
Message 1 of 18
(4,884 Views)

Sample rate at 50kHZ, 5000 samples, going on for 10 seconds.

 

I don't understand that.  5000 samples at 50 kHz is 0.1 sec.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 2 of 18
(4,821 Views)

Thus, the frequency should rise for 100ms in the start, and then decay down to 20Hz again in the end. 

 

I don't understand what it's supposed to do in the middle.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 3 of 18
(4,819 Views)

Thanks for the reply!

 

Oh, sorry! I meant a sample rate at 5kHz and 50k samples. 

 

In the middle the signal is supposed to stay at 500Hz. 

 

Sorry if my description was vague!

0 Kudos
Message 4 of 18
(4,815 Views)

Then what you want is basically three separate signals.

 

make a sweep, at 5000 Hz for 500 Samples, from F1=20 to F2 = 500

Make a sine wave, at 500 Hz, for 49000 samples (9.8 sec)

Make another sweep at 5000 Hz for 500 samples, from F1 = 500, to F2 = 20

 

use BUILD ARRAY to get a single signal of 50000 samples.

 

You might have a glitch problem at the  "seams".  If that's a problem, then there's another way.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 5 of 18
(4,812 Views)

Thanks a lot! Will try it out tomorow in the lab and test it with my equipment. I'll get back to you. So gratefull for the quick reply!

0 Kudos
Message 6 of 18
(4,808 Views)

Realized that it will probably be a little more tricky if I want to have a logarithmic sweep.

0 Kudos
Message 7 of 18
(4,804 Views)

Hey again!

 

Tried out the build array but it didn't work out. It just ploted the arrays seperately in the graph. I've attached one solution I came up with, but here the graph differ a bit in amplitude and I don't really know why. 

 

Tried out some solutions to make the sweep logarithmic but got stuck. Are there any smart solutions for that? 

 

Regards, Oscar

0 Kudos
Message 8 of 18
(4,789 Views)

Here's one method.  the middle section is only 490 samples instead of 49000, for clarity of picture.

 

 

Sweep Snippet.png

 

Sweep1.PNG

 

 

this has a problem though - because of the changing frequency.  Generating by 2*pi*f*t comes out awkward because that uses the time since 0.  It recalculates each step at time "t" as if it had been generating freq f since t0, which is incorrect.

 

Anyway, it gets your taper correct.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 9 of 18
(4,777 Views)

Thanks a lot!

 

Will try it out in the lab in a sec. Really grateful for the help! 

 

Best regards, 

Oscar

0 Kudos
Message 10 of 18
(4,772 Views)