信号处理(五)Echo cancellation and Estimating the distance 回声消除和距离估计

Connect your headphones to the sound card output of your PC and listen to this signal. You must correct the echo that is present on the signal. For this you will need to analyze the autocorrelation function of the signal. You can calculate it through - the Inverse Fourier Transform of the PSD of the signal (PSD given by the square of the modulus of the signal FFT), - the use the Matlab function xcorr.

Then you need to build a theoretical model for the signal (It’s up to you to propose a model):

x(n) = …

You deduce what should be the theoretical autocorrelation function of the signal. By then analyzing the measured autocorrelation function, you can identify the parameters of the echo signal and try correcting it.

X (t) is a random process, a (t) = EX (t) is the expectation, then the relevant function is defined as: B (s, t) = E (X (s) -a (t)) (X (t) -a (t)). If X (t) = Y (t) + i * Z (t), Y and Z are real processes, then X (t) is called a complex random process, and the relevant function is defined as: B (s, t) = E ( X (s) -a (t)) (X (t) -a (t)) (the latter bracket takes the conjugate).

1.Signal Acquisition

[x, fs] = audioread ('Pa11.wav');% Read signal
figure (1);% new window
subplot (3,1,1);% 3 row and 1 column arrangement
plot (x (1: 4000));% draw the signal
title ('Original signal');% Drawing area title
y = fft (x);% do FFT (fast discrete Fourier transform)
subplot (3,1,2);% 3 rows and 1 column arrange the second plot
plot (abs (y));% draw abs (y)
title ('Amplitude');% Drawing area title
subplot (3,1,3)% 3 rows and 1 column arrange the third plot
plot (angle (y));% Draw angle (y)
title ('Phase');% Drawing area title
Sound (x, fs);% matrix converted into sound signal

在这里插入图片描述

2.Echo cancellation

b = 1;
a = zeros (1,1800);
a (1) = 1;
a (601) = 0.7;
a (1001) = 0.4;
z1 = filter (b, a, y);
z2 = fft (z1,4000);
figure (3);
subplot (3,1,1);% 3 rows and 1 column arrange the first graph
plot (abs (z2));% draw abs (z2)
title ('Filtering amplitude');% Drawing area title
subplot (3,1,2);% 3 rows and 1 column arrange the second plot
plot (angle (z2));% draw angle (z2)
title ('Filter phase');% Drawing area title
subplot (3,1,3);% 3 rows and 1 column arrange the third plot
plot (z1 (1: 1024));% draw z1
title ('Filtered signal');% Drawing area title

在这里插入图片描述

3.Estimating the distance of reflectors from sound signals with echoes

h = xcorr (y);
figure (4);% Create a figure window
subplot (4,1,1)% 4 row 1 column first graph
plot (abs (h));% draw abs (h)
title ('Most value');% Drawing area title
h1 = h (5600: 6000);% h1 matrix
[r1, t1] = max (h1');% max
t1 = t1 + 5600;
subplot (4,1,2);% 4 row 1 column 2nd plot
plot (h1)% draw h1
title ('point 1');% Drawing area title
h2 = h (6200: 6600);% h2 matrix
[r2, t2] = max (h2);% max
t2 = t2 + 6200-t1;
subplot (4,1,3);% 4 row 1 column 3rd plot
plot (h2);% draw h3
title ('point 2');% drawing area title
h3 = h (6800: 7200);% h3 matrix
[r3, t3] = max (h3);% max
t3 = t3 + 6800-t1;
subplot (4,1,4);% 4 row 1 column 4th plot
plot (h3);% draw h3
title ('point 3');% drawing area title
t=[t1,t2,t3];

在这里插入图片描述
t1=5801 t2=600 t3=1000

If we get the number of delay sampling points as n, then we can use t = n / fs to calculate the delay time, and then use L = v * t to calculate the distance, that is, L = v * n / fs, Finally, the distance between the reflector and the sound source can be determined according to the relative positions of the reflector, sound source, and receiver in practice.
The audio signal selected for this design is fs = 22050Hz, so the distance between the sound source and the two reflectors is:

   L1 = 340 * 5801/22050/2 = 44.72m
   L2 = 340 * 600/22050/2 = 4.63m
   L3 = 340 * 1000/22050/2 = 7.71m
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
PHY echo cancellation是指物理层回声消除技术。回声消除的目标是消除通信中产生的回声,以便保证语音或数据的质量。回声产生的原因是传输路径中的信号被反射回来,造成与原始信号重叠的回声信号。回声消除通过识别回声信号并将其从接收信号中减掉,从而恢复原始信号。 在PHY层,回声消除通常使用算法来计算回声路径的延迟,并将延迟后的回声信号与接收信号进行相消。这样可以减少回声信号的影响,使接收到的信号更加清晰。 需要注意的是,PHY echo cancellation的具体实现可能会因不同的通信系统、硬件设备和算法而有所不同。因此,具体的实现策略和算法可能会根据不同的应用而有所差异。总的来说,PHY echo cancellation是一种用于减少通信中回声影响的技术,可以提高通信的质量和可靠性。<span class="em">1</span><span class="em">2</span> #### 引用[.reference_title] - *1* [回声消除Echo Cancellation)理解](https://blog.csdn.net/weixin_43704402/article/details/115250279)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *2* [FBMC and GFDM Interference Cancellation Schemes for FDR PHY Design](https://download.csdn.net/download/weixin_43870101/12399523)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值