필터 지우기
필터 지우기

I tried implementing a matched filter to improve sensing SNR using the code below, but I did not get good results. If anyone knows a better way, please help.

조회 수: 22 (최근 30일)
s_t = (EdeltaS*(lamda^2)/(64*(pi^3)*(r_max^2)))...
*(HBR'*(wc*wc'+ws*ws')*(a_RIS_tem*a_RIS_tem')*diag(ome)*diag(ome')*HBR*HBR'*(a_RIS_tem*a_RIS_tem')*diag(ome)*diag(ome')*HBR*(wrx_in*wrx_in')*sin(theta_tem));
s_t_vec = s_t(:); % reshape s_t into a coloumn vector
% Add AWGN to the transmitted signal
r_target = awgn(s_t_vec, 10^(-9));
% Apply the matched filter
template = conj(s_t_vec(end:-1:1));
filtered_signal = conv(r_target, template, 'same');
% Compute SNR of the filitered signal
SNR = abs(filtered_signal).^2 ./ (var(r_target) + var(filtered_signal));

채택된 답변

Yash
Yash 2023년 6월 23일
There's no need of a completely new approach according to me, you can just make some improvements in your code for better functionality.
1) Change the SNR value used in the awgn function. A value of 10^(-9) may result in an extremely high SNR, leading to unrealistic noise levels. Adjust the SNR value based on your signal characteristics and desired noise level.
2) Instead of converting the s_t matrix into a column vector and then applying the matched filter using conv, you can directly perform matrix multiplication to improve memory efficiency. Refer to the following code.
template = conj(flipud(s_t));
filtered_signal = filter2(template, r_target, 'same');
3) Directly use the power expressions in the calculation of the SNR, instead of squared magnitudes expressions. Refer to the following code.
SNR = abs(filtered_signal).^2 / var(filtered_signal);
Hope this helps.
  댓글 수: 4
LoCi
LoCi 2023년 6월 23일
Thank you for clarification, one more question, my maximum transmit power is 30 dB , how to plot the SNR for each transmit power level?
Yash
Yash 2023년 6월 25일
To plot the SNR for each transmit power level, you can modify the code to loop over a range of transmit power levels, apply the matched filter for each power level, and plot the resulting SNR values. Refer to the following code for the same.
% Generate a longer training sequence
train_seq = repmat(s_t_vec, 10, 1);
% Define the range of transmit power levels
p_range = 0:2:30;
% Initialize the SNR vector
SNR = zeros(size(p_range));
% Loop over the transmit power levels
for i = 1:length(p_range)
% Set the transmit power level
p = 10^(0.1*p_range(i));
% Generate the transmitted signal
s_t = ... % code to generate the transmitted signal
% Add noise to the transmitted signal with a higher SNR threshold
r_target = awgn(s_t, 20);
% Apply the matched filter
template = conj(s_t(end:-1:1));
filtered_signal = conv(r_target, template, 'same');
% Compute the SNR of the filtered signal
SNR(i) = abs(filtered_signal).^2 ./ (var(r_target) + var(filtered_signal));
end
% Plot the SNR vs. transmit power
plot(p_range, SNR);
xlabel('Transmit Power (dB)');
ylabel('SNR');
title('SNR vs. Transmit Power');
Please keep in mind to change each parameter value to a value relevant to your model.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Digital Filtering에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by