09-11-2010 03:04 PM
Hello 2 all !
I have a signal aquired from a sonometer and i want to see the power spectrum.
The sonometer takes samples once / second, as can be seen from the attached txt.
First question: How do i attach a time stamp to my original array ?
Second question : How to analyze the signal and find the power spectrum ?
The attached vi shows the work i've done so far.
Can you please give me an advice ?
P.S. Using LabView 8.5.1 on windows Xp professional
Thank you very much.
09-11-2010 03:25 PM - edited 09-11-2010 03:27 PM
You already attaching a timestamp and taking the power spectrum. I don't have the svt toolkit so you will have to explain what it is you want.
p.s. get rid of the sequence structure and all local variables. It hides code and makes unnecessary data copies, Very bad style. That for loop should use a shift register to build a new array.
Edit-And you don't have the ok button inside the event case.
09-11-2010 04:27 PM
Why are you removing all zero elements? While this will typically not work anyway for DBL, you are potentially making the data no longer equally spaced in time and a power spectrum will no longer be possible with conventional methods.
(Or are you just using this as a kludge because you're not reading the file correctly in the first place?)
Listen to Dennis for the rest of the issues! 😄
09-12-2010 12:43 AM - edited 09-12-2010 12:52 AM
Hello guys !
I don't know why the zero values appear in the extracted data. I just know that there are no zero values in the measurement.
The instrument exports data as in the attached sample.txt.
I am sure that the the instrument takes samples every second so there shoud be 46 measured values.
The aim is to see the power spectrum for the aquired signal.
I am not seeing the expected result. The frequencies are too low.
I will try to modify my code and repost it.
Thank you very much for your patience!!!
09-12-2010 02:10 AM
Hello again !
I've managed to modify my code according to your useful sugestions.
The results i get are shown in the figure.
The aquired waveform is correct but the power spectrum is incorect. The frequencies are way too low.
How can i fix this ?
I've attached the vi and the sample.
I'm using LabView 8.5.1 on Windows XP profesional.
Thank you very much.
09-12-2010 09:36 AM
Hello guys !
I have made e few new modifications to my code but with little succes.
I've tried to artificially add more data points by interpolation.
What am i doing wrong ???
PLEASE TAKE A LOOK !!!
09-12-2010 11:45 AM
As I said, I don't have the toolkit. Does it expect inputs as db or is it expecting inputs in volts and it just seein a huge dc component?
09-12-2010 11:48 AM
I don't think anything is broken. You sample once per second (1.0 Hz!) for about 45 seconds so the highest frequency you can possibly measure is 0.5Hz and the lowest frequency is 0Hz (DC). This is exactly the range you get. Interpolations does not magically add more information to your data.
If you want to measure higher frequencies, you need to increase the sampling rate. Are you looking for a higher alias frequency instead?
If you think your sampling rate is incorrect, you can manually change dt.