Low pass filter or envelope detector in Excel

In summary, you are playing with some accelerometer data and need to filter out the noisy output. You tried averaging the data, but it didn't work well because the data is spiky. You also tried a low pass filter, an envelope detector, and Fourier filtering, but none of them worked well because the data is discontinuous.
  • #1
likephysics
636
2
I am playing with some accelerometer data and need to filter out the noisy output.
How do I implement a Low pass filter in excel?
I tried avg, rolling avg. They all smooth out the data but not what I want (averaged accn is finite when it is actually zero!)
If I can create an envelope detector in excel that would be awesome. Any help?
 
Engineering news on Phys.org
  • #2
Just off hand, I would square the data before averaging. Otherwise you get zeroafter subtracting gravity, you know.
 
  • #3
Square the data, average it and then take the sqrt?

Zero after subtracting gravity? how? I am measuring accn along x axis.
 
  • #4
Low pass filters are often defined by insertion loss in the passband, cutoff frequency and slope. Could you give us an idea of what you're looking for?

How do you distinguish between noise and signal, by frequency?

Perhaps you could post some sample data for and identify what signal you are trying to extract.

"One experiment is worth a thousand expert opinioins."
 
  • #5
likephysics said:
Square the data, average it and then take the sqrt?
Zero after subtracting gravity? how? I am measuring accn along x axis.

Oh dear. I think I misunderstood. You're not measuring vibration amplitude, are you?
 
  • #6
Phrak, no I am measuring position using accn.

skeptic2, I've attached the excel file. A plot would give you a better idea of what I am talking. Basically the data is a bit spiky. Ideally I would prefer to use a envelope detector to get a nice acceleration curve.
 

Attachments

  • accn on the road 01192009 053128PM datasm.xls
    75.5 KB · Views: 508
  • #7
I can see why a rolling average didn't work well. The data isn't clocked in at a constant rate according to column A.
 
  • #8
likephysics said:
Phrak, no I am measuring position using accn.

skeptic2, I've attached the excel file. A plot would give you a better idea of what I am talking. Basically the data is a bit spiky. Ideally I would prefer to use a envelope detector to get a nice acceleration curve.

I did some DSP worksheets in Excel back when I was working through "Designing Digital Filters" by Williams. They really helped illustrate the DSP concepts. That was probably 10 years ago, though, so let me look back through some old backups to see if I can find them...
 
  • #9
likephysics,

An envelope detector, at least in radio, detects the peak values of the waveform. I don't think that's what you want. I took your spreadsheet and experimented with three different types of detectors but when I wanted to send it back to you I discovered there is a 100k limit on attachment size and the spreadsheet had grown to 462k. I did send you a private message about what I found.

Briefly, I tried a rolling average but in order to avoid phase shifting the result, I averaged a few points before the current point together with a few points after. This would be the best solution IF the points were evenly spaced.

To address the unevenly spaced points issue, I tried a Butterworth implementation. The resultant curve rises or falls exponentially the same way as a charging capacitor depending on the difference between successive points with respect to amplitude and time. Although with a single instance (pole) it had more noise than the rolling average, by stacking or using the output of one as the input of another the noise can be eliminated and the output looked as good as with the rolling average.

I also tried Fourier filtering but that wasn't satisfactory due to the discontinuities at the beginning and end of the data series.
 
  • #10
your biggest problem appears to be that you can't measure a signal with resolution greater than 0.0323, and your max signal is .3871, for a ratio of ~12. most of the "noise" there is discretization noise. you really need either a bigger signal, higher resolution, or a more sensitive instrument that designed for this signal range.
 

1. What is a low pass filter or envelope detector in Excel?

A low pass filter is an electronic circuit that allows low frequency signals to pass through while attenuating high frequency signals. An envelope detector is a circuit used for rectifying and smoothing an amplitude modulated signal. In Excel, these functions can be replicated using formulas and data analysis tools.

2. How do I create a low pass filter in Excel?

To create a low pass filter in Excel, you can use the "Data Analysis" tool and select the "Low Pass Filter" option. This will prompt you to input the data range and cutoff frequency for the filter. Alternatively, you can use the "FILTER" function in Excel to create a custom low pass filter.

3. Can I apply a low pass filter to a specific set of data in Excel?

Yes, you can apply a low pass filter to a specific set of data in Excel by using the "FILTER" function and specifying the data range and cutoff frequency. This will only filter the selected data, leaving the rest of the data unaffected.

4. How do I use an envelope detector in Excel?

To use an envelope detector in Excel, you can use the "MAX" and "MIN" functions to find the highest and lowest values in a data set. Then, subtract the lowest value from the highest value to get the envelope, or the amplitude modulated signal. You can also use the "SLOPE" function to find the slope of the envelope and determine the modulation depth.

5. Can I visualize the effects of a low pass filter or envelope detector in Excel?

Yes, you can visualize the effects of a low pass filter or envelope detector in Excel by creating a line graph or scatter plot of the original data and the filtered data. This will show the attenuation of high frequency signals and the smoothing of the amplitude modulated signal. You can also use chart formatting tools to enhance the visualization of the filtered data.

Similar threads

  • Electrical Engineering
Replies
6
Views
1K
  • Electrical Engineering
Replies
6
Views
851
Replies
7
Views
3K
  • Electrical Engineering
Replies
7
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
16
Views
962
  • Electrical Engineering
Replies
1
Views
2K
  • Electrical Engineering
Replies
1
Views
2K
  • Electrical Engineering
Replies
7
Views
2K
  • Electrical Engineering
Replies
6
Views
2K
Replies
14
Views
5K
Back
Top