Why does my matlab code cannot detect the number of periods in a specific time range
I have developed a matlab code which imports pNRF Files that contain a measurement signal of light distance of a wheel surface in order to detect the number of cracks on that surface. There are in the file 3 signals, 2 rotary encoder signals and one light distance signal.
The Code does mostly what I want it to do:
It can import the Data accurately and successfully.
It can plot all the 3 signals
It can detect the cracks automatically using a threshold
One thing thats important and that the code is doing wrong, is that it detects the wrong number of the periods in the time range where a crack is being detected. (See the following picture, the back rectangles are the Cracks detected).
Now what I would like to do is to calculate the number of the Periods on the Signal Ch B1 (increment Encoder A) in the time where a crack is being detected. In this example the number of the periods is about 5,2 Periods of the first Crack and about nearly 1 Period of the second crack.
This is a substract of the 200line Code that i have to determine how many cracks I have:
% Zusammenfassung der Risse anzeigen
disp(‘Anzahl der detektierten Risse:’);
disp(numCracks);
disp(‘Breite der detektierten Risse in Inkrementen und Mikrometern:’);
for i = 1:numCracks
rissIndizes = risseGruppen.PixelIdxList{i};
Crackstart = min(rissIndizes);
Crackstart = max(rissIndizes);
Periods_Yellow_Signal = locs_gelb(locs_gelb >= Crackstart & locs_gelb <= Crackend);
CracksthicknessinPeriods = length(Periods_Yellow_Signal);
rissBreiteMicrometer = CracksthicknessinPeriods * INC_TO_MICROMETER;
fprintf(‘Crack %d: Thickness = %d Periods, %.2f Micrometer (Signal: Ch B1_A)n’, i, rissBreiteInkrement, rissBreiteMicrometer);
fprintf(‘Number of Periods: %dn’, rissBreiteInkrement);
end
What am I doing wrong here?
I would so thankful for any help! Thanks a lot in advance.I have developed a matlab code which imports pNRF Files that contain a measurement signal of light distance of a wheel surface in order to detect the number of cracks on that surface. There are in the file 3 signals, 2 rotary encoder signals and one light distance signal.
The Code does mostly what I want it to do:
It can import the Data accurately and successfully.
It can plot all the 3 signals
It can detect the cracks automatically using a threshold
One thing thats important and that the code is doing wrong, is that it detects the wrong number of the periods in the time range where a crack is being detected. (See the following picture, the back rectangles are the Cracks detected).
Now what I would like to do is to calculate the number of the Periods on the Signal Ch B1 (increment Encoder A) in the time where a crack is being detected. In this example the number of the periods is about 5,2 Periods of the first Crack and about nearly 1 Period of the second crack.
This is a substract of the 200line Code that i have to determine how many cracks I have:
% Zusammenfassung der Risse anzeigen
disp(‘Anzahl der detektierten Risse:’);
disp(numCracks);
disp(‘Breite der detektierten Risse in Inkrementen und Mikrometern:’);
for i = 1:numCracks
rissIndizes = risseGruppen.PixelIdxList{i};
Crackstart = min(rissIndizes);
Crackstart = max(rissIndizes);
Periods_Yellow_Signal = locs_gelb(locs_gelb >= Crackstart & locs_gelb <= Crackend);
CracksthicknessinPeriods = length(Periods_Yellow_Signal);
rissBreiteMicrometer = CracksthicknessinPeriods * INC_TO_MICROMETER;
fprintf(‘Crack %d: Thickness = %d Periods, %.2f Micrometer (Signal: Ch B1_A)n’, i, rissBreiteInkrement, rissBreiteMicrometer);
fprintf(‘Number of Periods: %dn’, rissBreiteInkrement);
end
What am I doing wrong here?
I would so thankful for any help! Thanks a lot in advance. I have developed a matlab code which imports pNRF Files that contain a measurement signal of light distance of a wheel surface in order to detect the number of cracks on that surface. There are in the file 3 signals, 2 rotary encoder signals and one light distance signal.
The Code does mostly what I want it to do:
It can import the Data accurately and successfully.
It can plot all the 3 signals
It can detect the cracks automatically using a threshold
One thing thats important and that the code is doing wrong, is that it detects the wrong number of the periods in the time range where a crack is being detected. (See the following picture, the back rectangles are the Cracks detected).
Now what I would like to do is to calculate the number of the Periods on the Signal Ch B1 (increment Encoder A) in the time where a crack is being detected. In this example the number of the periods is about 5,2 Periods of the first Crack and about nearly 1 Period of the second crack.
This is a substract of the 200line Code that i have to determine how many cracks I have:
% Zusammenfassung der Risse anzeigen
disp(‘Anzahl der detektierten Risse:’);
disp(numCracks);
disp(‘Breite der detektierten Risse in Inkrementen und Mikrometern:’);
for i = 1:numCracks
rissIndizes = risseGruppen.PixelIdxList{i};
Crackstart = min(rissIndizes);
Crackstart = max(rissIndizes);
Periods_Yellow_Signal = locs_gelb(locs_gelb >= Crackstart & locs_gelb <= Crackend);
CracksthicknessinPeriods = length(Periods_Yellow_Signal);
rissBreiteMicrometer = CracksthicknessinPeriods * INC_TO_MICROMETER;
fprintf(‘Crack %d: Thickness = %d Periods, %.2f Micrometer (Signal: Ch B1_A)n’, i, rissBreiteInkrement, rissBreiteMicrometer);
fprintf(‘Number of Periods: %dn’, rissBreiteInkrement);
end
What am I doing wrong here?
I would so thankful for any help! Thanks a lot in advance. periods, frequency, signal, signal processing, cracks, thickness MATLAB Answers — New Questions