麦克风声学延迟
clear;
N=1024; %长度
Fs=500; %采样频率
n=0:N-1;
t=n/Fs; %时间序列
a1=1; %信号幅度
a2=1;
d=-20; %延迟点数
x1=a1*cos(2*pi*10*n/Fs); %信号1
% x1=x1+randn(size(x1))/max(randn(size(x1))); %加噪声
x2=a2*cos(2*pi*10*(n+d)/Fs); %信号2
% x2=x2+randn(size(x2));
% -------------------
% input number is below 1, and Prec_F is the (N-1)bit for N bit transform
Prec_F = 23;
% -------------------
input = x1;
for ii =1:length(input)
if input(ii) == 1
data_out(ii) = input(ii)*pow2(Prec_F)-1;
else
data_out(ii) = input(ii)*pow2(Prec_F);
end
end
data_out = round(data_out);
for ii = 1:length(input)
if data_out(ii) < 0
data_out(ii) = data_out(ii) + pow2(Prec_F+1);
end
data_out_Hex1(ii,:) = dec2hex(data_out(ii),(Prec_F+1)/
频域互相关延迟估计
最新推荐文章于 2024-05-09 14:32:29 发布