Steve Hardy wrote: > > Using a pseudo random pattern will give better results with the > > correlation though. > > > > This will mean that you can get away without the A/D, and that you > > should be able to lock onto the carrier phase itself. Using the > > longest code you can given your 10Mhz clockrate, the correlation > > should reject most noise sources. > > > > If you decide to give it a try, please let us know how it turned out. > > This may work with other transducer types, however these units strongly > resonate at 40KHz and nothing else. Their bandwidth is very limited > (+/- 100Hz) and thus it would be very difficult to make use of any > finer level modulation of the signal, since the 200Hz bandwidth translates > to a very poor distance resolution. Also, the Tx is very close to the > Rx owing to physical constrains - the Rx picks up the initial transmission > which is much higher intensity than the reflected pulse. This would > tend to swamp the desired signal (unless an appropriate delay line and > subtractor was used to cancel this source). > > I have actually used something similar to your suggestion, but in the > field of IR communication. In this case the transmitter sent out a > 32-bit pattern (4 of the bits being '1', the rest zero) repetitively. > The receiver could tune into the pattern being transmitted, even if other > transmitters were in the vicinity (so long as the other transmitters > used a different 32-bit code). > > Regards, > SJH > Canberra, Australia Hello Steve . I think there are another solution to measure distance with ultrasonic Tx/Rx and PIC . Define ACF ( AutoCorrellation Function ) as: --- M-1 Bn(X1,X2)=Sum X[i]*X[i-n] ; i=0 where M size of X vector , n is delay(shift distance) , X1[0..M-1] , X2[0..M-1] , X1[i=>M] always =0 , X2[i=>M] always =0 too . --- Let X[]= (0,0,0,1,1,1,0,0,0) ; M=9 n=0 , B0 = 0*0 + 0*0 + 0*0 + 1*1 + 1*1 + 1*1 + 0*0 + 0*0 + 0*0 = 3 ; n=1 , B1 = 0*0 + 0*0 + 0*1 + 1*1 + 1*1 + 1*0 + 0*0 + 0*0 + 0*0 = 2 ; n=2 , B2 = 1 ; n=3 , B3 = 0 ; n>3 , Bn = 0 ; At 50 .. 60 years Barker codes was discovered . I've hear only about Barker codes with following positions quantity: 2,3,4,5,7,11,13 2: It's trivial case ;) 3: (1,1,-1) ACF=(3,0,-1) 4: (1,1,1,-1) or (1,1,-1,1) ACF=(4,1,0,-1) or (4,-1,0,1) 5: (1,1,1,-1,1) ACF=(5,0,1,0,1) 7: (1,1,1,-1,-1,1,-1) ACF=(7,0,-1,0,-1,0,-1) 11:(1,1,1,-1,-1,-1,1,-1,-1,1,-1) ACF=(11,0,-1,0,-1,0,-1,0,-1,0,-1) 13:(1,1,1,1,1,-1,-1,1,1,-1,1,-1,1) ACF=(13,0,1,0,1,0,1,0,1,0,1,0,1) Size of Burker code result to measure precision. Send_Packet(Barker[k],0,0,0,0,0,...) Recv_Packet(x,x,x,...,x,x,Barker[k]) So you send/receive signal with Barker modulation and search maximum of ACF(Send_Packet,Recv_Packet). If you know n (in Bn ACF function) you can measure distance . WBR Dmitry. P.S. Any additional information see at textbook about radiolocation .