Forums

FFT Questions

Started by Maria March 31, 2004
Maria wrote:

> Hi, > > I am using Matlab to do ffts for some data collected in the lab of > electrophysiology recordings. When I plot the power spectrums, I get > huge peaks from 0-1 Hz. Are these peaks representative of the data or > artifacts carried over/created from the fft? > > Any help would be appreciated. > > Thanks.
Take a careful look at your experimental setup. Back in the 60's I was a student tech supporting research evaluating signals generated by 1 ( or few ) neurons. I personally destroyed usefulness of some data by not accounting for poor common mode noise rejection of the set up. [ Actually the data was so bad they threw it all out.] In another case, the data was corrupted by dandruff included in potting compound of an amplifier.
ok, so here's what's happening.  My data, is at a baseline of ~ -60mV,
which I've subtracted to get rid of the DC component.  I'm looking at
spontaneous activity in the slices and my data is highly fluctuating. 
Also my data may deviate from the baseline at most 10mV (usually 1-5).
 So my amplitude is very small and if I were to window, I don't want
to lose the amplitude. Also, the data is very noisy.  So from what
I've read from all the great suggestions, I'm thinking of taking
larger time intervals (the recordings go from 30-100s) and windowing.
Any other suggestions?

Also, i'm interested in the 0 - 20 Hz range, and even after getting
rid of the DC bias and windowing, I get huge spikes in my spectrum
from 0-1 Hz.  Is it just noise I can't get rid of; is there anything
else I can do?  I'm getting the 'grassy' white noise look, and not
alot of signal coming through.


All suggestions are much appreciated. THANKS.


r.lyons@_BOGUS_ieee.org (Rick Lyons) wrote in message news:<406cbcd4.109334125@news.sf.sbcglobal.net>...
> On 31 Mar 2004 15:26:06 -0800, marija616@hotmail.com (Maria) wrote: > > >Hi, > > > >I am using Matlab to do ffts for some data collected in the lab of > >electrophysiology recordings. When I plot the power spectrums, I get > >huge peaks from 0-1 Hz. Are these peaks representative of the data or > >artifacts carried over/created from the fft? > > > >Any help would be appreciated. > > > >Thanks. > > Hi Maria, > > No, those peaks at low frequencies are *not* an artifact > of of the FFT algorithm. They indicate that your > time-domain sequence is riding on a DC bias (that is, > it means your FFT-ed sequence's average is not zero). > > You should subtract the sequence's average (a single > value) from each sample in the sequence giving you a > new sequence. Now take the FFT of that new sequence. > > As for which window to use, that's a tougher > question. Windowing is generally used to reduce > the spectral leakage that causes a strong (high > amplitude) signal's spectral magnitude to cover over > (swamp out) the spectral components of nearby > weak signals. If a weak signal (in which you're > interested) is 3-4 FFT frequency bins away from a strong > signal's center frequency, use the Hamming window. > > If the weak signal (in which you're > interested) is more than, say, 6 FFT frequency bins > away from a strong signal's center frequency, use the > Hanning window. > > Ah, there's much to learn about window functions, > particularly the Kaiser and Chebyshev windows, > which give you some control over their > spectral leakage cahracteristics. > > Keep asking questions here Maria, > > Regards, > [-Rick-]
Maria wrote:

> ... my amplitude is very small and if I were to window, I don't want > to lose the amplitude. Also, the data is very noisy. So from what > I've read from all the great suggestions, I'm thinking of taking > larger time intervals (the recordings go from 30-100s) and windowing. > Any other suggestions?
The amplitude lost by windowing can be recovered by multiplying by a number less than two. Don't worry about it. Remember: the amplitude of the noise is reduced too.
> Also, i'm interested in the 0 - 20 Hz range, and even after getting > rid of the DC bias and windowing, I get huge spikes in my spectrum > from 0-1 Hz. Is it just noise I can't get rid of; is there anything > else I can do? I'm getting the 'grassy' white noise look, and not > alot of signal coming through.
It's from not windowing, I think.
> All suggestions are much appreciated. THANKS.
... Jerry -- Engineering is the art of making what you want from things you can get. &#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;&#2013266095;
On 3 Apr 2004 10:16:43 -0800, marija616@hotmail.com (Maria) wrote:

>ok, so here's what's happening.
UH oh! here we go.
>My data, is at a baseline of ~ -60mV, >which I've subtracted to get rid of the DC component.
Was that subtraction before or after A-D conversion?
>I'm looking at >spontaneous activity in the slices and my data is highly fluctuating.
Please know that I don't know what "slices" means. By "highly fluctuating" I'm guessing you mean the signal contains much high frequency energy.
>Also my data may deviate from the baseline at most 10mV (usually 1-5).
What number format are you using in the digital domain? How many bits is your A-D converter. Over what bit range does your digital time samples fluctuate? Can you tell us the "signal to quantization noise" ratio of your time samples?
> So my amplitude is very small and if I were to window, I don't want >to lose the amplitude.
Amplitude loss won't be much of a problem with windowing, but the broadening (widening) of narrow spectral components may be a problem.
>Also, the data is very noisy. So from what >I've read from all the great suggestions, I'm thinking of taking >larger time intervals (the recordings go from 30-100s) and windowing. >Any other suggestions?
Yes. Try different-length FFTs and try using no windowing and then try a hanning window. Compare your results. What effect does the small/large FFT size have, what effect does windowing have?
>Also, i'm interested in the 0 - 20 Hz range,
Ah yes, unless I missed it, what is your sampling rate? Are you satisfying the Nyquist sampling criterion?
>and even after getting >rid of the DC bias and windowing, I get huge spikes in my spectrum >from 0-1 Hz.
My next questions are: "Are you sure you're reducing the DC component as much as possible? What's the average value of the sequences of which you're performing your FFTs? If you really are minimizing the DC component as much as possible, my guess is that the 0-1 Hz spikes are actually in your signal.
>Is it just noise I can't get rid of; is there anything >else I can do? I'm getting the 'grassy' white noise look, and not >alot of signal coming through.
Sounds like you're working with a signal of very low signal-to-noise ratio. Spectral averaging may help you with that. Are you merely trying to detect the presence of low-level spectral components? Is that your goal? Please provide some answers and keep asking questions here Maria, Regards, [-Rick-]
"Maria" <marija616@hotmail.com> wrote in message
news:38a072b0.0404031016.289b11d9@posting.google.com...
> ok, so here's what's happening. My data, is at a baseline of ~ -60mV, > which I've subtracted to get rid of the DC component. I'm looking at > spontaneous activity in the slices and my data is highly fluctuating. > Also my data may deviate from the baseline at most 10mV (usually 1-5). > So my amplitude is very small and if I were to window, I don't want > to lose the amplitude. Also, the data is very noisy. So from what > I've read from all the great suggestions, I'm thinking of taking > larger time intervals (the recordings go from 30-100s) and windowing. > Any other suggestions? > > Also, i'm interested in the 0 - 20 Hz range, and even after getting > rid of the DC bias and windowing, I get huge spikes in my spectrum > from 0-1 Hz. Is it just noise I can't get rid of; is there anything > else I can do? I'm getting the 'grassy' white noise look, and not > alot of signal coming through.
Maria, You say the data is at a baseline of -60mV, which you have subtracted to get rid of the dc component....... Could there be a misunderstanding here? I might call the "baseline" the more or less lowest level one sees in noisy data - in the time domain. As on a chart recorder or oscilloscope. If that's what you mean, then that's *not* the dc component. To remove the dc component, you need to remove the mean of the whole signal. This means - compute the mean of the samples. The sum of the samples divided by N, the number of samples. - subtract that mean value from every sample of the signal. Now you have zero mean and no dc component. So, can you confirm that this is what you've done? Then we'll get onto the next things you might do to get better results. Fred
Hi,

My recordings are coming from rat brain slices.  During recording, the
aim is to maintain 'clamp' the cell membrane voltage to -60mV (typical
cell membrane voltage).  However, due to spontaneous activity in the
cell, this membrane voltage will fluctuate.  So, I guess when I say
baseline, I mean the voltages recorded fluctuate about this value
(-60mV).  So, in order to adjust my signal as was suggested, the
program that I'm using to record allows me to 'adjust' the entire
trace or recording by subtracting the mean of the trace.  THat's what
I've done, so that now my recordings fluctuate about 0mV.  Is this
right?

Maria




"Fred Marshall" <fmarshallx@remove_the_x.acm.org> wrote in message news:<uMGdnawd37Ytpu3dRVn-vg@centurytel.net>...
> "Maria" <marija616@hotmail.com> wrote in message > news:38a072b0.0404031016.289b11d9@posting.google.com... > > ok, so here's what's happening. My data, is at a baseline of ~ -60mV, > > which I've subtracted to get rid of the DC component. I'm looking at > > spontaneous activity in the slices and my data is highly fluctuating. > > Also my data may deviate from the baseline at most 10mV (usually 1-5). > > So my amplitude is very small and if I were to window, I don't want > > to lose the amplitude. Also, the data is very noisy. So from what > > I've read from all the great suggestions, I'm thinking of taking > > larger time intervals (the recordings go from 30-100s) and windowing. > > Any other suggestions? > > > > Also, i'm interested in the 0 - 20 Hz range, and even after getting > > rid of the DC bias and windowing, I get huge spikes in my spectrum > > from 0-1 Hz. Is it just noise I can't get rid of; is there anything > > else I can do? I'm getting the 'grassy' white noise look, and not > > alot of signal coming through. > > Maria, > > You say the data is at a baseline of -60mV, which you have subtracted to get > rid of the dc component....... > > Could there be a misunderstanding here? > I might call the "baseline" the more or less lowest level one sees in noisy > data - in the time domain. As on a chart recorder or oscilloscope. > If that's what you mean, then that's *not* the dc component. > > To remove the dc component, you need to remove the mean of the whole signal. > This means > - compute the mean of the samples. The sum of the samples divided by N, the > number of samples. > - subtract that mean value from every sample of the signal. > Now you have zero mean and no dc component. > > So, can you confirm that this is what you've done? Then we'll get onto the > next things you might do to get better results. > > Fred
Hi,

I'm recording the spontaneous activity in rat brain slices, in a
control setting, followed by perfusion with certain drugs.  I'm hoping
to see how the drugs affect the activity of the cell (i.e. cell
membrane voltage).  Without exciting the cell (i.e. cell at rest), the
dominant frequencies should lie around 0-20 Hz.  When I say highly
fluctuating, I guess I mean that the cell itself possess a lot of
intrinsic noise, so it's not very stable at all, the membrane voltage
is constantly falling and rising.

My goal is to determine the effect of the drugs on cellular activity
-> a decrease or increase, so I'm looking at the dominant frequencies
before and after the drugs are applied.  However, my signal has a very
low SNR (singal to noise ratio), so it's difficult to determine what
part is the signal.

I'm analyzing the data, I did not perform the experiments, so all I
know is that it was recorded, filtered at 5kHz and digitized at 10-20
kHz using a Digidata 1200 A/D board. The data has been downsampled to
2000Hz.

Maria 



r.lyons@_BOGUS_ieee.org (Rick Lyons) wrote in message news:<40703389.336331515@news.sf.sbcglobal.net>...
> On 3 Apr 2004 10:16:43 -0800, marija616@hotmail.com (Maria) wrote: > > >ok, so here's what's happening. > > UH oh! here we go. > > >My data, is at a baseline of ~ -60mV, > >which I've subtracted to get rid of the DC component. > > Was that subtraction before or after > A-D conversion? > > >I'm looking at > >spontaneous activity in the slices and my data is highly fluctuating. > > Please know that I don't know what "slices" > means. By "highly fluctuating" I'm guessing > you mean the signal contains much high frequency > energy. > > >Also my data may deviate from the baseline at most 10mV (usually 1-5). > > What number format are you using in the > digital domain? How many bits is your > A-D converter. Over what bit range does > your digital time samples fluctuate? > Can you tell us the "signal to quantization > noise" ratio of your time samples? > > > So my amplitude is very small and if I were to window, I don't want > >to lose the amplitude. > > Amplitude loss won't be much of a problem with > windowing, but the broadening (widening) of narrow > spectral components may be a problem. > > >Also, the data is very noisy. So from what > >I've read from all the great suggestions, I'm thinking of taking > >larger time intervals (the recordings go from 30-100s) and windowing. > >Any other suggestions? > > Yes. Try different-length FFTs and try using > no windowing and then try a hanning window. > Compare your results. What effect does the small/large FFT size have, > what effect does windowing have? > > >Also, i'm interested in the 0 - 20 Hz range, > > Ah yes, unless I missed it, what is your sampling rate? > Are you satisfying the Nyquist sampling > criterion? > > >and even after getting > >rid of the DC bias and windowing, I get huge spikes in my spectrum > >from 0-1 Hz. > > My next questions are: "Are you sure you're reducing > the DC component as much as possible? > What's the average value of the sequences of which > you're performing your FFTs? > > If you really are minimizing the DC component as much > as possible, my guess is that the 0-1 Hz spikes are > actually in your signal. > > >Is it just noise I can't get rid of; is there anything > >else I can do? I'm getting the 'grassy' white noise look, and not > >alot of signal coming through. > > Sounds like you're working with a signal > of very low signal-to-noise ratio. > Spectral averaging may help you with that. > > Are you merely trying to detect the presence of > low-level spectral components? Is that your > goal? > > Please provide some answers and keep asking > questions here Maria, > > Regards, > [-Rick-]
Rick, I hope you don't mind my jumping in here. 

marija616@hotmail.com (Maria) writes:
> [...] > However, my signal has a very low SNR (singal to noise ratio),
Is that before or after the A/D conversion? If after, then you may not have the converter's input range matched properly to the input signal range. That is, you may be degrading the SNR unecessarily due to the quantization noise of the converter. Is there a programmable gain stage in analog front-end of your data acquisition system? If so, you might try increasing the gain as long as you don't digitally clip the input. Sorry if this is rehashing something already covered. -- % Randy Yates % "Watching all the days go by... %% Fuquay-Varina, NC % Who are you and who am I?" %%% 919-577-9882 % 'Mission (A World Record)', %%%% <yates@ieee.org> % *A New World Record*, ELO http://home.earthlink.net/~yatescr
"Maria" <marija616@hotmail.com> wrote in message
news:38a072b0.0404041541.7034916a@posting.google.com...
> Hi, > > My recordings are coming from rat brain slices. During recording, the > aim is to maintain 'clamp' the cell membrane voltage to -60mV (typical > cell membrane voltage). However, due to spontaneous activity in the > cell, this membrane voltage will fluctuate. So, I guess when I say > baseline, I mean the voltages recorded fluctuate about this value > (-60mV). So, in order to adjust my signal as was suggested, the > program that I'm using to record allows me to 'adjust' the entire > trace or recording by subtracting the mean of the trace. THat's what > I've done, so that now my recordings fluctuate about 0mV. Is this > right?
Yes, that would be the right thing to do if that's indeed what it's doing. One way to know for sure is to look at the zero frequency result in the FFT - it has to be zero if the record has zero mean. I thought you were using Matlab? So, "the program I'm using"???? I would rather trust Matlab to remove the mean before you FFT. In fact, what could that hurt just to make sure there's no residual dc component coming out of that other program? I would do it - i.e. remove the mean (again) using Matlab before doing the FFT with Matlab. *****************next subject If you want to look at data from 1 to 20Hz, then the amount of data you have will surely yield good enough resolution to split this region up into 100 cells (5 seconds of data) or more (10-100 seconds of data). How many data points do you need to get in the spectrum between 0 and 20Hz? Now, there will be a transient at the first sample above zero in the spectrum if the ends of the data values are very dissimilar. So, if you taper the ends of the time data this will be alleviated. Most windowing is just a more drastic type of tapering of the ends. With all the data you have, the energy in this transient is probably small but a bit of tapering or even full windowing won't hurt anything. I would definitely do this. See below about selecting the length of time records. Very important! *************************next subject I've brought this up before but I'm not sure I got it across: If you have 100 seconds of data and you analyze all 100 seconds at once using an FFT, then you won't be able to observe any changes in the data that occur during that 100 second period. You can only observe the existence of periodic components. So, if there's a periodic component that lasts for 4 seconds and then another, at a different frequency, that lasts for 7 seconds, these will be obscured in a 100 second record / FFT unless they have high SNR. In that case it would be better to analyze 10 second epochs separately. What is the nature of the variation in the signal of interest? Are you only looking for periodic components that last for 100 seconds or nearly so? This is a critical element in the design of the analytical approach. I hope this helps Maria! Fred
On Mon, 05 Apr 2004 03:14:22 GMT, Randy Yates <yates@ieee.org> wrote:

>Rick, I hope you don't mind my jumping in here. >
Hi, Randy, no, you're your ideas are sure welcome.
>marija616@hotmail.com (Maria) writes: >> [...] >> However, my signal has a very low SNR (singal to noise ratio), > >Is that before or after the A/D conversion? If after, then you >may not have the converter's input range matched properly to the >input signal range. That is, you may be degrading the SNR >unecessarily due to the quantization noise of the converter. > >Is there a programmable gain stage in analog front-end of your >data acquisition system? If so, you might try increasing the >gain as long as you don't digitally clip the input. > >Sorry if this is rehashing something already covered.
No, I don't think it was covered. It sounds like Maria's signal jumps all over the place in terms of its analog rms voltage. I hope she's driving the A/D converter sufficiently hard. She said. "I'm analyzing the data, I did not perform the experiments, ... That's a little "spooky" to me because so many steps must be performed properly to maximize the "usefulness" of the signal before she gets it. She also said: "so all I know is that it was recorded, filtered at 5kHz and digitized at 10-20 kHz using a Digidata 1200 A/D board. The data has been downsampled to 2000Hz." That's sounds like lowpass analog filtering with a cutoff freq of 5 kHz. I wonder how sharp are the filter's skirts. Then the "digitized at 10-20 kHz" phrase was also kinda "scary" because the sample rate needs to be well-known and fixed for FFT results to have meaning in terms of spectral components' frequencies. I didn't know what her phrase "downsampled to 2000Hz" meant. Wonder if that meant some sort of frequency translation, or could it have meant, "decimated to a sample rate of 2000 Hz"? Her problem sure sounds interesting and one that can be solved. I'll bet this is a university research project. If she's in North Carolina Randy, you could pay her a visit. If she's in Northern California, I could stop by and look at her test hardware. Sure sounds like any interesting project to me. [-Rick-]