필터 지우기
필터 지우기

How to change the dimension of a signal from 1000x1 to 1x1?

조회 수: 4 (최근 30일)
dabe
dabe 2023년 7월 12일
댓글: dabe 2023년 7월 26일
Hello together,
I have built a Voice Activity Detector which works relatively well. In the scope I can derive the envelope and the resulting on/off decision.
Unfortunately the dimension of the binary signal does not match the adapt input of the NLMS block.
How can I change the dimension of the signal without changing the behavior?
What I have tried:
- Switch Threshold with Constant 1 and 0 (Dimensions stays the same).
- Logic Decision (Dimension stays the same)
- Logic AND with 1 (Dimension stays the same)
Thanks in advance!
Best regards
Daniel

채택된 답변

Sai Gokul
Sai Gokul 2023년 7월 12일
Hi Dabe,
I understand that you want to change the dimension of a binary signal from 1000X1 to 1X1
Here is an approach you can follow:
  • Add a MATLAB Function block to your SIMULINK model.
  • Double-click on the MATLAB Function block to open the MATLAB editor.
  • In the MATLAB editor, define the function as follows:
function y = changeDimension(u)
y = sum(u);
end
This function takes the input signal u and sums all its elements, effectively changing the dimension from 1000X1 to 1X1.
  • Save the MATLAB Function block and close the MATLAB editor.
  • Connect the output of your Voice Activity Detector to the input of the MATLAB Function block.
  • Connect the output of the MATLAB Function block to the adapt input of the NLMS block.
You can refer to the documentation below to understand more about the MATLAB Function block :
Hope this helps!
  댓글 수: 1
dabe
dabe 2023년 7월 26일
Hi Sai Gokul,
thank you for your answer and excuse my late response.
I tried your suggestion and it works with a little change. Due to the fact that the sum will create a amplitude of 1000 it had to be multiplied by 0.001.
function y = changeDimension(u)
y = 0.001*sum(u);
end
Thank your very much!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Block Libraries에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by