필터 지우기
필터 지우기

For loop Problem in MATLAB Code sample

조회 수: 4 (최근 30일)
Ahmad Bilal
Ahmad Bilal 2018년 1월 29일
Hello to all: I have came across one MATLAB code that calculates Direction of Arrival for microphone pair with help of LMS Algorithm. In the beginning of code i am facing one problem in for loop. Code snipet is as follows:
*fs=44100; % Sampling frequency (Hz) d_micro=0.1; % Distance between microphones (m) c=340; % Speed of sound (m/s) Nmax =ceil(d_micro*fs/c); % Maximum number of samples Nmax
DESP=ceil(Nmax*1.5); %Delay we insert in the micro 2 % We leave 50% of margin of error
lengData=44100*0.5; % Number of samples in which the voice is processed
signal1=audioread('90.wav')'; % Importing the file to process.
length(signal1); % Now for loop
for k=lengData:lengData:length(signal1)
signal=signal1(1,k-(lengData-1):k); % Signal in MIC B d=signal1(2,k-(lengData-1):k); % Signal in MIC A
I have question that how this for loop works as lengData comes out to be 22050 and length(signal1) is 8272.
this means for k =22050:22050:8272 how is that possible? can anybody help me regarding this?? Thank you

답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by