How to normalize a signal to zero mean and unit variance?

后端 未结 5 1089
鱼传尺愫
鱼传尺愫 2020-12-24 05:27

I am new to MATLAB and I am trying to built a voice morphing system using MATLAB.

So I would like to know how to normalize a signal to zero mean and unit variance us

5条回答
  •  余生分开走
    2020-12-24 06:03

    It seems like you are essentially looking into computing the z-score or standard score of your data, which is calculated through the formula: z = (x-mean(x))/std(x)

    This should work:

    %% Original data (Normal with mean 1 and standard deviation 2)
    x = 1 + 2*randn(100,1);
    mean(x)
    var(x)
    std(x)
    
    %% Normalized data with mean 0 and variance 1
    z = (x-mean(x))/std(x);
    mean(z)
    var(z)
    std(z)
    

提交回复
热议问题