Hi I am trying to measure the amount of clipped Samples in audio files with matlab. That means i want to get the number of all Samples that are at the Fullscale Value (at min and max). But it should just count them when there are at least two following samples at this Value.
My code so far:
for i = 1 :20
fileName = ['Elektro',num2str(i) '.wav'];
unclipped = audioread(fileName);
summeMax = sum(1 ==unclipped);
summeMin = sum(-1==unclipped);
summe = summeMin +summeMax;
str=sprintf('%d ',summe);
disp(str);
end
As you see its counting every sample and I would need a loop and if statements to detect if there are more than one sample at the fullscale Value.
I tried this it with a loop from j = 1 : length(unclipped) but it takes to long with this Method.
Anyone have suggestions how i could do this?