LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FFT and analyse problem

Hallo!
 
I´m working on a project where I measure movements of the eye.
I would now like to sample (in about 10k Hz ) and analyse (in Labview) the frequency of my signal who goes from my circuit through a A/D-converter (PIC18F452) to the computer and in Labview. The frequency from my signal can be from 0-100 Hz but it usually lies around 70-80 Hz, and I would like to discern it from the noise who comes from the power network (this frequency is exactly 50 respecive 100 Hz) I . How can I do this? I´ve tried to put in the "spectral measurements" (FFT) block in my code in Labview, but I´ve failed. I dont know if this is the right thing to do and I´m really fresh with Labview so any suggestions are welcome.
 
Thanks!
 
Fadde
0 Kudos
Message 1 of 16
(4,934 Views)

Hi

It's always wise to use a transformer that isolates the data acquisition system from the Electric grid. You are probably working with 220V (I assume this from the 50Hz frequency) so you will need a 220V-220V isolating transformer. This is from the hardware side of things.

There is no magic trick you can use here. If the noise is in the same frequency range as your signal then you need to get rid of the noise before it enters the system (Isolating transformer).

From the software side, you can use a filter of some sort (Maybe a band pass to transfer only the 60-90 Hz). By the way, why do you use such a high sampling rate? According to nyquist you only need 2 times your Highest measured frequency (that will be 200 Hz in your case). You can save a lot of calculating power if you use a slower sampling rate.

I realize my answer is a bit general, but I hope it gets you started.

Amiram

0 Kudos
Message 2 of 16
(4,907 Views)
Hello!
 

Amiram had several good ideas to get you up and running. Try to filter the signals in HW if possible to get rid of the components from power network. Some nice examples showing filter functionality in SW include 'Online Filtering.VI' for an example.

Also please check out these links:

How Do I Select the Correct Filter in LabVIEW for My Application?
http://digital.ni.com/public.nsf/websearch/B5C159262A4976DD86256C2F005EAB94?OpenDocument

What Type of Software Filter Can I Use to Eliminate 60 Hz Noise?
http://digital.ni.com/public.nsf/websearch/3692D0D932C3BCFC8625658B00827162?OpenDocument

Regards,

Jimmie A.

Applications Engineer, National Instruments

 

Regards,
Jimmie Adolph
Systems Engineering Manager, National Instruments Northern European Region

0 Kudos
Message 3 of 16
(4,884 Views)
Hi!
 
Thanks for the tips but unfortunately we cant get rid of the noise. This is because our apparatur is based on reflection, and the human body absorbes the noise from the power network, and this adds to our signal. That´s why we would like to analyse the signal with help of FFT, so that we could discern the "real" signal from the noise. we have to use such a high sampling (10k Hz, 100 times more than our signal) because of to get so exact result as possible. I would also like to know how to sample a signal, if this is possible in Labview?
 
Another problem that I have is that when I run the signal through my home-made A/D-converter (8-bit), I sometimes get spikes/peaks even when there is nothing in front of the device and sensor. the spikes/peaks varies, but often it´s full or more than full resolution. The A/D converter (PIC18F452) can handle a voltage between 0-5 V, and our maximum deflection is from 1-4 V. So that shouldn´t be a problem.
 
I dont have the oppuronity until first before the 2:nd of januari (monday) to try your advise of example. But I will be in touch and perhaps ask for more help.
 
Thanks for having patience with a beginner in Labview guys!
Happy new year and see you next year! 🙂
0 Kudos
Message 4 of 16
(4,857 Views)
I guess you are trying to make an EOG. Most of the noise actually comes from your poor amplifier design. The CMRR of the first stage of your amplifier which connects to the electrodes must be very high (greater than 100 dB) in order to minimize the 50Hz noise, where CMRR stands for common mode rejection ratio.
Try AD620 from Analog Devices (www.analog.com) as your first stage amplifier or instrumentation amplifier, it eliminates most of the noise and makes life easier for you.

When it comes to LabVIEW and software programming, trying to extract signal by FFT anylysis is not even an option, it leads you to the middle of nowhere!
The best way is using built-in filter in LabVIEW like a butterworth band-stop filter to reduce the level of 50Hz noise.
By the way you shall reduce the sampling rate from 10K to 1K to get a better result and another tip is to forget the built-in A/D converter of the PIC microcontroller and using an external high resolution A/D.

Kasra
0 Kudos
Message 5 of 16
(4,840 Views)
Hi! thanks for the advice. I´m trying to measure the movemnets of the eye with the help of IR-sensor (Infra Red). I think I´ve done whatever I could with the hardware, and that it´s now the software I´ll have to work with to finsih my task. I´m not sure that I can filter the 50 Hz noise (which reflects with the body and in to the sensor), because I want to know the frequency of the eye movements (which can be from 0-100 Hz but it usually lies around 70-80 Hz) and this can also be 50 Hz for some people.  Why should I only sample in 1k Hz and do you think a high resolution A/D is necessary?
 
Fadde
0 Kudos
Message 6 of 16
(4,837 Views)
The normal approach to measure the angle or rate or frequency of the human eye movement is EOG ( Electro oculo gram) which doable with placing electrodes on the skin near eye in some predefined places.
When you are using an IR sensor which mean it has no physical and electrical contact to the body, what do you mean noise reflects from body to sensor?
It sounds so meaningless!
The noise actually comes from electromagnetic fields generates from the power cords and inducts trough your sensor's wires and because the signal level of your IR sensors are very low the inducted 50Hz noise is high in comparison to the sensor's output.
The only and only solution will be using an instrumentation amplifier in the first stage to eliminates the noise which is inducted in both wires of an IR sensor and you don't have any better solution than that.
Trying to filter the signal in software helps but not much!
By reducing the sampling rate to 1KHz you will reduce so many high frequency noises and by increasing the resolution you will reduce the digitization noise generating by LSB error and etc...

I'd like to add that EOG is a proven method and it has been used even in pilot helmets in fighter planes to help the jet fighter free his hands by controlling some functions of the plane by his eyes' movements.

Kasra
0 Kudos
Message 7 of 16
(4,815 Views)

OK. We´re using a IR as a transmitter and a photodiode as a reciever.  When you put somethong in front of this, in our case the human eye, and the eye moves it recievs a different reflection, which indicates in a different voltage which indicates in a movement. This is what we want to see, and we see this. And I thought it was because of the human body is reflecting (and absorbing a bit) for an example the light from lamps, (which is "noise" from the power network) it reflects on the body and in to the sensor and this is adding to our signal. But you dont think so? maybe you are right. If it´s just like you said you gave me I nice solution! I´ll be in touch with you and discuss this with you later (if it´s ok?)

Got to sleep now... God night and thanks!

Fadde

0 Kudos
Message 8 of 16
(4,806 Views)

Hi, Fadde,

          First of All you are working on a wonderful project,

          Now, tell me how u r tsking the input signals into the LabVIEW? is it through any of the cards, or any other way, you can use the isolated PCI cards to eliminate the noise, we also have taken the analog signal to do the FFT at 100 Hz frequency, and i am attaching an image of that to you.

Thanks,

Nishant

Message 9 of 16
(4,795 Views)
Hi Nishant!
 
Ok. let me give you a brief of what we´ve  done..We want to register the frequency of the eye movements, and different people have different frequencies. And this is what we want to achieve. We have built a device (which contains different things). But when the light from the lamps is turned on, we see in our real oscilloscope, only the regular noise from the lamps and other noise from the power network. But when the light from the lamps is turned off, we see in our real oscilloscope, that the noise is reduced a lot (but not enough). And it´s with help of Labview we wantto discern our real signal from the "noise" with help of FFT or something in a similar way.
 
To get our signal in the computer and to analyse it with help of Labview we builded our own home-made A/D-converter which contains of a PIC18F452 with some other components(we also want to see our signal in Labview and not in our "real" oscilloscope). This is a 8 bit resolution converter and the maximum sampling is 50k Hz. And we have succeded to show our signal in to Labview, and when we move someting in front of the sensor this is showing both in our real oscilloscope and in our graph in Labview. So it works fine, but still...as a mentioned earlier...I would like to analyze this with FFT, but I dont know how to do this, Any advise?
 
What is a isolated PCI, and where could I get it.?
 
It seems that you done almoust the same thing, it would be nice of you if you would like to tell me what you have done and how you´ve solved it. And maybe you could attach your code to me:)
 
Thanks
 
Fadde
0 Kudos
Message 10 of 16
(4,787 Views)