Matlab get number of fullscale Values

2019-09-18 12:51发布

im trying to find out how much samples of an audio track are at the Fullscale Value (max and min Value). The Problem is, im new to matlab and dont know exactly the way to get my results.

The Problem is in the second line of my code. Is there a way to get the y value of a signal for every sample ? Or a method to get all the minimum and maximum values ? (findpeaks() dont't work because my signal is an audio file with two channels)

        unclipped = audioread(fileName);

        total= 0;
        values = YV(unclipped);
        for k = 1 : lenght(values)
            if values(k)== max(unclipped)
                total = total + 1;
            end    
                if values(k)== min(unclipped)
                total = total + 1;
            end    
        end 
        display (total);

标签: matlab max min
1条回答
Lonely孤独者°
2楼-- · 2019-09-18 13:26
sum(max(unclipped(:))==unclipped))

Get the maximum and count how often your data is equal to the maximum.

查看更多
登录 后发表回答