04-11-2017 04:18 AM
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
04-11-2017 10:28 AM
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.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
04-11-2017 10:29 AM
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.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
04-11-2017 11:02 AM
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!
04-11-2017 11:13 AM
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.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
04-11-2017 11:47 AM
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!
04-11-2017 12:14 PM
Realized that it will probably be a little more tricky if I want to have a logarithmic sweep.
04-12-2017 04:06 AM
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
04-12-2017 05:45 AM
Here's one method. the middle section is only 490 samples instead of 49000, for clarity of picture.
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.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
04-12-2017 06:20 AM
Thanks a lot!
Will try it out in the lab in a sec. Really grateful for the help!
Best regards,
Oscar