Matlab get number of fullscale Values

狂风中的少年 提交于 2019-12-13 21:03:53

问题


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);

回答1:


sum(max(unclipped(:))==unclipped))

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



来源:https://stackoverflow.com/questions/31534983/matlab-get-number-of-fullscale-values

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!