Filter out misalignment of sensor signal
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
0 개 추천
Hi,
I have taken measurements with a lasersensor that moves along an axis and takes distance measurements to a wall for each position (1, 2, 3, ...). It seems that the axis that the sensor is mounted on is not perfectly parallel to the wall so that I can see a trend which you can see in the image below. The blue line is my acquired signal, the red lines describe the signal within a measurement position (X number of points for each measurement position).
How can I filter out the misaligned sensor axis and simulate a perfectly aligned axis that is parallel to the wall?
Thanks.

채택된 답변
Star Strider
2021년 7월 9일
1 개 추천
댓글 수: 8
Perfectly aligned axis means that I do not see the two peaks in my data. The signal should be flat where the data of the measured positions should be attached to each other without having the two peaks.
Try the filter approach.
To design the filters correctly, first do a Fourier transform (fft) on the signal to determine the appropriate bandpass or highpass frequencies. The highpass filter will elimiinate the baseline variation only, the bandpass filter will eliminate the baseline variation and high-frequency noise, if that is desiered.
Konvictus177
2021년 7월 9일
편집: Konvictus177
2021년 7월 10일
Thanks for the advice but filtering will change the amplitude of the signal a lot. I think that each time the sensor moves to the next measurement position there is a jump/step in the signals which results in the overall trend you can see in the figure above. How do I remove the jump/step for each measurement position? The length of the signal for each measurement position is actually way smaller than shown in the figure. This is only done for illustration purposes. The signal consists of multiple measurements which are attached to each other.

I will have to have a representative signal to experiment with, and a description of the result you want, in order to proceed.
The filtering approach will likely work, unless the signal itself has low-frequency components that cannot be successfully separated from the baseline variation frequency. Other approaches may work if filtering does not. I cannot determine at present how to solve this, or if a solution is possible.
.
Konvictus177
2021년 7월 10일
편집: Konvictus177
2021년 7월 10일
So I actually want to create a surface map of a laying cylindrical object. The data that is attached here is the Z-Height over the entire width for a specific angle (360° full angle).
You can notice the trend resulting from multiple measurements attached to each other. The signal should look more or less flat without steps. Each measured signal consists of 33 data points which are attached to each other to create the full width.
I am not certain how you calculated the values in the earlier plot image.
I developed this code for you to experiment with to see what works, since I have no idea what information you want in the filtered signal:
LD = load('DataZ.mat');
DataZ = LD.DataZ;
L = numel(DataZ);
x = linspace(0, L-1, L);
figure
plot(x, DataZ)
grid
Fs = 1/x(2);
Fn = Fs/2;
N = 2^nextpow2(L);
DataZm = DataZ-mean(DataZ);
FTDZ = fft(DataZm,N)/L;
Fv = linspace(0, 1, fix(numel(FTDZ)/2)-1)*Fn;
Iv = 1:numel(Fv);
figure
plot(Fv, abs(FTDZ(Iv))*2)
grid
xlim([0 0.025])
Flo = 6E-3; % Low Frequency Cutoff
Fhi = 1.5E-2; % High Frequency Cutoff
[DataZfilt,DF] = bandpass(DataZ, [Flo Fhi], Fs);
figure
plot(x, DataZfilt)
grid
Please experiment with this — specifically ‘Flo’ and ‘Fhi’ — to see if it produces the result you want (that I still do not have any idea about). It requires the Signal Processing Toolbox and MATLAB 2018a or later. (I can code an equivalent filter if you have an earlier version of the Toolbox.) The first figure is the original signal, the second is the Fourier transform (that can help guide the frequency values for the filter), and the third is the filtered signal.
.
Thanks, I will experiment with it a bit and yes, I do have the toolboxes.
As always, my pleasure!
Out of my own curiosity, I would like to see what the desired result looks like, and the filter frequencies used to derive it.
.
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Smoothing and Denoising에 대해 자세히 알아보기
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
