matlab 求信噪比
clear all;clc;% 实信号求信噪比% X= sqrt(2)*sin(0:pi/1000000:6*pi); %产生正弦信号% Y = awgn(X,14,'measured'); %加入信噪比为10db的噪声,加入前预估信号的功率(强度)% sigPower = sum(abs(X).^2)/length(X) %求出信号功率% noisePower=sum(abs(Y-X).^2)/leng