Efficient way to reduce noise from load cell data DAQ?

Dear all,
I use DAQ to get data from Loadcell. However, the signal wave have many unnecessary waves (picture 1). I want to reduce those waves, just keep the peak wave (it show the load from the hammer) look like picture 2. I has tried to use filter function, but not working. What should I do to solve it.
Thank you very much.

 Accepted Answer

The easiest way would be to use a low-pass filter, band-pass filter (if you want to remove a d-c offset), or a notch filter to filter out the high-frequency noise. There are many ways to design filters in MATLAB, including designfilt, firls, and others. My usual procedure for IIR filters is here: How to design a lowpass filter for ocean wave data in Matlab?
If you provide a sample of your data, I may be able to help you design your filter. I will need a vector of sample times as well as your signal vector.

4 Comments

Dear Mr Star Strider,
This is my sample data. Could you please to show me the way to process it.
Thank you very much for helping me.
My pleasure.
You have 60 Hz mains frequency interference (consider using a shielded cable with a grounded shield). The MATLAB documentation already has a solution for this: Remove the 60 Hz Hum from a Signal, so I used that design (with a few modifications), giving ‘LC_filt’ as the filtered load-cell signal:
fidi = fopen('Dynamic1.txt','r');
d = textscan(fidi, '%f%f%f', 'CollectOutput',1);
tv = d{1}(:,1); % Time Vector
LC = d{1}(:,2); % Load Cell Signal Vector
figure(1)
plot(tv, LC) % Plot Unfiltered Signal
grid
Ts = mean(diff(tv)); % Sampling Interval (sec)
Fs = 1/Ts; % Sampling Frequency (Hz)
Fn = Fs/2; % Nyquist Frequency (Hz)
L = size(tv,1); % Signal Length (samples)
FTLC = fft(LC)/L; % Normalised Fourier Transform
Fv = linspace(0, 1, fix(L/2)+1)*Fn; % Frequency Vector
Iv = 1:length(Fv); % Index Vector
figure(2)
plot(Fv, abs(FTLC(Iv)))
grid
axis([0 500 ylim])
df = designfilt('bandstopiir','FilterOrder',2, ...
'HalfPowerFrequency1',55,'HalfPowerFrequency2',65, ...
'DesignMethod','butter','SampleRate',Fs); % Notch Filter 60 Hz
dh = designfilt('bandstopiir','FilterOrder',2, ...
'HalfPowerFrequency1',115,'HalfPowerFrequency2',125, ...
'DesignMethod','butter','SampleRate',Fs); % Notch Filter 120 Hz
LC_filt = filtfilt(df,LC);
LC_filt = filtfilt(dh,LC_filt); % Cascade Filters
figure(3)
plot(tv, LC_filt) % Plot Filtered Signal
grid
This is as clean as I can get it. You may want to experiment with the filters to see if you can get a better design. Note that the Fourier transform plot indicates that you have part of your load-cell signal at 60 Hz, so consider that in your filter design.
Oh, The result is very very good, much more better than I expected. Do you think that it will be better if insert this 2 line in the last result that you gave me.
[b,a]=butter(2,0.01);
Lc_last=filter(b,a,LC_filt);
Thank you very much.
God bless you.
My pleasure.
I am not certain what result you want, so experiment with the filters to isolate your frequencies of interest. That code designs a low-pass filter with a cutoff of about 51 Hz. Looking at the Fourier transform plot, it would seem to me to eliminate part of your signal, probably eliminating the high-frequency transients.
I would use filtfilt rather than filter, because filtfilt has a maximally flat phase response, and will eliminate phase distortion in the filtered signal.
The third column of your data appears to be an impact record (input), so if you want to get an input-output transfer function of your system, you would have to filter the input signal with the same low-pass filter. (You can estimate your system transfer function from the two time-domain signals with the invfreqz function in the Signal Processing Toolbox. As with everything else in signal processing, you will have to experiment with it to get the result you want.)
Thank you. I wish you the same.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!