필터 지우기
필터 지우기

How to do time delay in PN sequence

조회 수: 6 (최근 30일)
vaishali  passi
vaishali passi 2013년 6월 27일
My project is based on audio watermarking with time spread echo method. For this I have generated PN sequence and for encoding the following formula is applied h(n)= d(n)+ alpha*p(n-delta)
where d(n)= dirac delta function, alpha= amplitude of PN sequence, p(n)= PN sequence, delta= time delay.
here I know that p(n) is an array of PN sequence. I have done the coding for dirac delta function and also generated PN sequence but i am unable to write code for p(n-delta) as mentioned in above formula. I tried the following code: delta=0.001; for x=1:1023 temporary = PN1(1,x); new_index =(x-delta); PN1(1,new_index) = temporary; end disp(PN1); f=alpha*(PN1-delta);
but by this i always get the error mentioning that 'Attempted to access PN1(1,0.999); index must be a positive integer or logical'.
So i request to plz help me out to do time shifting in PN sequence. Plz provide code of the above mentioned formula.
  댓글 수: 1
vaishali  passi
vaishali passi 2013년 6월 28일
m not able to shift PN sequence by delta; so plz help me .........

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

채택된 답변

Muthu Annamalai
Muthu Annamalai 2013년 6월 27일
If you understand that p(n-k) in DSP terms is nothing but the same signal p but time-shifted by the amount k then it resolves everything here.
Also I think you want the kronecker delta in a discrete system. You will have to prefix your array PN by zeros, and use the index, so that MATLAB will not complain about out of bounds. Also avoiding dirac delta, i.e. use an IF condition to set the index offset to 0 or 1, should eliminate your error 'Index must be logical'.
HTH
  댓글 수: 1
vaishali  passi
vaishali passi 2013년 6월 27일
thanks for the answer but can u plz help me out with some code if possible

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Signal Generation and Preprocessing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by