Friday, April 5, 2019
Generalized Cross Correlation With Phase Transform Information Technology Essay
Generalized Cross Correlation With Phase render Information Technology EssayThe sanitary maneuver from a extraction is captured by a mate of microph atomic number 53s. The analog signal from the microphone must be amplified and converted into digital for further processing. consequently, an analog to digital converter external to the FPGA is utilise. After the analog signal is digitized, the signal is fed into FPGA for source localization. The digital signals atomic number 18 first saved into input buffer. In our case, we have used First in First by (FIFO) as a memory accountant. The signals in succession creation ar hence converted into relative absolute frequency domain by using Fast Fourier transmogrify (FFT).Generalized cross correlational statistics (GCC) is used for the regard of time difference of r distributively (TDOA) of the telephone set signals from the microphone p air travel. After TDOA is estimated, we then calculate the direction from which the t oilsome signal is arriving which we refer to as direction of arrival (DOA). The discriminate degree is used by the high stepping labor go controller module which controls the rotation and speed of the stepper push. The signal from stepper motor controller module is fed into stepper motor findr circuit which is responsible in energizing the appropriate coils of the stepper motor in particular sequence so as to rotate the stepper motor to the direction of the sound source.4.2 Time difference of arrival (TDOA) estimationConsider a sound source and a pair of microphones located at some distance from the source. As sound travels finished air with constant speed, it takes time to arrive from source to the microphone location. The farther a microphone is located from the sound source, the longer it willing take for the sound to reach the microphone. Two microphones located at disparate prep bes will receive the same sound (plus noise) at a different time. The TDOA method takes a dvantage of this waitinged arrival to estimate the location of the source. ref mediatech4For a source signal s(t) propagated through a noisy and reverberant environment, the demodulator signals of ii spatially separated microphones and and trick be expressed as(4.1)(4.2)where is the attenuation factor, and ar the time frustrates, and the additive terminal includes the channel noise in the microphone transcription as well as any ambient noise for the sensor. This noise is assumed to be uncorrelated with .The TDOA estimation calculates the relative stick of the time delays and of the ii recorded microphone signals and defined as ref 10.1.1.9.3680(4.3)Now formulae (4.1) and (4.2) house be compose as(4.4)(4.5)The Fourier transform of captured signal from microphones and is expressed as(4.6)(4.7)HELLO I am hereFourier TransformGCC-PHATInverse Fourier TransformMax value to give TDOAxi(t)xj(t)Fig 4.2 Block for estimating TDOACross correlation amongst the two signals is calcu lated to estimate the time difference of arrival.The cross correlation of signals and is(4.8)The cross correlation, reaches its maximum at the time delay (t).is the fourier transform of the cross correlation spectrum and is obtained from the individual spectra of and (4.9)where is the Fourier transform of and is the complex conjugate of the Fourier transform of .And may be expanded using equation (4.6)(4.10)It is assumed that the average energy of the captured signals is signifi digesttly great than the interfering noise, such that(4.11)The last three terms of equation (4.10) are negligible compared to first term based on the in a higher place assumption. Expression (4.10) now reduces to(4.12)The can be found by evaluating(4.13)where IFT stands for inverse Fourier transformGeneralized Cross Correlation with Phase Transform (GCC-PHAT)A major limitation of the come is that it is exceedingly influenced by noise and reverberation. To minimize its influence on TDOA estimation, we nee d to whiten the cross correlation by using Generalized Cross Correlation with Phase Transform (GCC-PHAT)(4.14)And its time domain loveseat is(4.15)Where FT stands for Fourier transform and IFT stands for inverse Fourier transformThe output of the GCCPHAT function is delta equivalent with peak at .The above analysis is based on analog signals and stationary . For digital processing, the are sampled and become discrete sequences . overly the are not stationary as the source of sound is liable to change location. For analysis, finite frames are besides required due to computational constraints. Hence the usual windowing techniques are use and the sampled signals are illogical into analysis frames. 10.1.1.43.5850After conversion into the discrete finite sequence domain, equation (4.15) becomes(4.16) acception of arrival (DOA) estimationIt is possible to compute the position of the source through geometrical calculation once TDOA is estimated. We consider a simple manakin based on far field assumption.microphone iMicrophone jsource direction externalize 4.3 Computing source direction from TDOAConsider the Figure 4.3, which illustrates the case of 2 microphone array with a source in the far field. Using cosine law, we state that(4.16)where is a unit vector daubing in the direction of the source and is the vector that goes from microphone i to microphone j. It can also be stated that(4.17)where c is the velocity of sound.Taking microphone i as reference, we place stepper motor in the position of microphone i. The angle of sound signal arrival is precondition by (90-) as shown in Figure 4.4. Also, from the figure, (90-) = .stepper motor position90-Microphone iMicrophone jsource directionFigure 4.4 Stepper motor position and estimation of direction of sound source.Fast Fourier TransformFrequency analysis of discrete time signals is usually and most suitably performed on a digital signal processor, which may be a specially designed digital ironware or a general purpose digital computer. We convert the time-domain sequence to an equivalent frequency domain representation to perform frequency analysis on a discrete-time signal xn.We consider the representation of a sequence xn by samples of its spectrum X(). Such a frequency domain representation leads to the trenchant Fourier Transform (DFT), which is a powerful computational tool for performing frequency analysis of discrete time signals.In the spatial relation of the importance of the DFT in various digital signal processing applications, such as correlation analysis, running(a) filtering, spectrum analysis, its efficient computation is a topic that has received considerable attention by many mathematicians, engineers, and apply scientists .The number of complex multiplication and addition operations required by the simple forms both the Discrete Fourier Transform (DFT) and Inverse Discrete Fourier Transform (IDFT) is of order N2 as there are N entropy points to calculate, each of w hich requires N complex arithmetic operations.For continuance n input vector x, the DFT is a length n vector X, with n elements(4.18)Basically, DFT computes the sequence X(k) of N complex valued numbers given some other sequence of data x(n) of length N, according to the formula(4.19)Where,Similarly, Inverse Discrete Fourier Transform (IDFT) is given by,(4.20)The DFT and IDFT view essentially the same type of computations. Therefore, efficient computational algorithms for the DFT also apply to the efficient computation of the IDFT.Direct computation of X(k) involves N complex multiplications or each value of k, 4N real multiplications and N-1 complex additions (4N-2 real additions). Hence to compute all N values of the DFT requires N2 complex multiplications and N2-N complex additions. We may say they have algorithmic complexity O(N2) and hence is not a real efficient method. Hence, DFT will not be very useful for the majority of practical DSP applications if we cant do any bet ter than this.However, there are a number of different Fast Fourier Transform (FFT) algorithms that enable the calculation the Fourier transform of a signal a lot faster than a DFT. FFT exploits the symmetry and periodicity properties of the phase factor WN. In particular these two properties areSymmetry property(4.21)Periodicity property(4.22)As the name suggests, FFTs are algorithms for quick calculation of discrete Fourier transform of a data vector. The FFT is a DFT algorithm which reduces the number of computations needed for N points from O(N 2) to O(N log2 N). The response of an FFT looks like a sinc function (sinx) / x, if the function to be transformed is not harmonically related to the sampling frequency, al-Qaeda 2 algorithmIt is one of the commonly used FFT algorithms. The Radix 2 algorithms are useful if N is a regular power of 2 (N=2p). If we assume that algorithmic complexity proposes a direct green screen of execution time and that the relevant logarithm base is 2 then as shown in skirt 4.1, ratio of execution times for the (DFT) vs. (Radix 2 FFT) (denoted as speeding Improvement Factor) increases tremendously with increase in N. fft.pdfNumber of points,NComplex multiplications in direct computationN2Complex multiplications in FFT algorithm(N/2)log2NSpeed improvement factor41644.0864125.316256328.03210248012.864409619221.31281638444836.625665536102464.05122621442304113.8102410485765120204.8Table 4.1 Comparison of execution times, DFT and Radix -2 FFTThere are two different home 2 algorithms, Decimation in Time (DIT) and Decimation in frequency (DIF) algorithm. They both rely on the recursive decomposition of an N point transform into 2 (N/2) point transforms. This decomposition process can be applied to any composite (non prime) N. The method is particularly simple if N is divisible by 2 and if N is a regular power of 2, the decomposition can be applied repeatedly until the trivial 1 point transform is reached.Divide and conquer method is used to obtain the radix -2 decimation in frequency FFT. Figure 4.5 shows the first stage of the 8 point DIF algorithm. The decimation causes shuffling in data.-1-1-1-1x0x1x2x4x3x5x6x7X0X1X2X3X5X4X6X7N/2 Point DFTN/2 Point DFTg0g2g1g3h0h1h2h3WN0WN1WN2WN3Figure 4.5 First stage of 8 point Decimation in Frequency AlgorithmThe entire process involves v = log2N stages of decimation, where each stage involves N/2 butterflies of the type shown in the Figure 4.6. Here is the Twiddle factor.abA=a+bB=(a-b)WNWNFigure 4.6 Butterfly schemeConsequently, the computation of N-point DFT via this algorithm requires (N/2) log2N complex multiplications. For illustrative purposes, the eight-point decimation-in frequency algorithm is shown in the Figure 4.7 below. We observe that the output sequence occurs in bit-reversed order with respect to the input.X0X1X2X3X4X5X6X7-1-1-1-1-1-1-1-1-1-1-1-1WN0WN0WN0WN0WN0WN2WN0WN2WN0WN1WN2WN3x0x1x2x3x4x5x6x7Figure 4.7 8 point decimation in frequency algorithmMatlab S imulationFigure 4.8 Simulink model for verification of TDOA algorithmSimulink model is used to verify the algorithm for calculating the time difference of arrival (TDOA). Samples of audio signal is infer from a wave file hello_8000.wav at 8kHz Windowing is done to take certain number of samples of the signal each time for further processing in order to estimate the TDOA . Audio signals are taken through two channels, where each channel assumes to be the signal from each microphone with certain delay samples added to one channel. From Figure 4.8 we can observe that 25 delay samples have been considered.Noise has been added externally using Gaussian Noise Generator block to check the electric resistance of the system against ambient noise. Our system showes good resistance to noise after analyzing with different noise conditions added to two channels.Figure 4.9 Plot of samples of time delay as viewed in scopeThe plot for samples of time delay obtained for simulation time of 20 sec i s shown in figure 4.9. We see that a straight line is obtained at delay sample of 25. But, we can also see variations in between, with maximum value of delay samples shooting to 128. But the maximum probability we obtained is of 25 delay samples.Figure 4.10 Plot of time delay (secs) as viewed in scopeCorresponding to the delay samples, we then calculate the time delay in scraps between the signals in the two channels. For 25 delay samples, we obtain the time delay as 0.003125 sec. The plot for the time delay obtained is shown in figure 4.10.Figure 4.11 Stepper motor demand modelFigure 4.11 shows a Simulink model of stepper motor drive using 2 phase hybrid stepper motor. The motor phases are fed by two H-bridge MOSFET PWM converters. 28 V DC voltage source provides the voltage required for the driver module. The movement of stepper motor drive is controlled by the feeling and DIR signals generated from the Signal Builder block. Square-wave genuine references are generated using t he current amplitude and the step frequency parameters specified in the dialog window of the Signal Builder block.The tincture signal from the Signal Builder block controls the movement of the stepper motor. A positive value of measuring signal will rotate the motor whereas a zero value will stop the rotation. The DIR signal controls the direction in which the motor rotates. A positive value of DIR rotates the motor is one direction succession a negative value will impose the reverse direction.Consider simulation time of 0.25 sec. The STEP and DIR input is shown in figure 4.12. The resulting waveforms are given in figure 4.13. The stepper motor rotates in positive direction for 0.1 sec, stops for 0.05 sec and then rotates in the opposite direction for 0.05 sec and then stops.Figure 4.12 Signal Builder for generating the STEP and DIR signalsFigure 4.13 Waveforms as viewed in the scopeSTEPPER goA stepper motor is an electromechanical device which converts electrical pulses into di screte mechanical movements. The shaft or spindle of a stepper motor rotates in discrete step increments when electrical command pulses are applied to it in the proper sequence. The motors rotation has several direct relationships to these applied input pulses. The sequence of the applied pulses is directly related to the direction of motor shafts rotation. The speed of the motor shafts rotation is directly related to the frequency of the input pulses and the length of rotation is directly related to the number of input pulses applied. motorbas.pdfFigure 3.13 Stepper motorWhenever controlled movement is required, stepper motor can be a good choice. They are effective in applications where you need to control rotation angle, position, speed and synchronism. Stepper motors have found their place in different applications like printers, plotters, medical equipment, hard disk drives, automotive and many more. One of the most important advantages of a stepper motor is that it can be accu rately controlled in an open gyrate system. Open loop control means no feedback information about position is needed. The position is known simply back tracking the input step pulses. Hence, taking into account these advantages, we have used a stepper motor for pointing to the direction of a sound source.A magnetized flux is developed in the stator when a phase winding of a stepper motor is energized with current. The direction of this flux is determined by the amend hand rule. Consider figure , when phase B is energized with winding current in the direction shown, rotor aligns itself to minimize the flux opposition. In this case the motor would rotate clockwise so that its southward gat aligns with the north pole of the stator B at position 2 and its north pole aligns with the south pole of stator B at position 6. Hence, in order to rotate the motor, we must provide a sequence of energizing the stator windings providing a rotating magnetic flux which the rotor follows due to m agnetic attraction. motorbas.pdfFigure 3.14 Stator and rotor of stepper motor showing the current directionWe have used a stepper motor with half step drive stepping mode has. In this case, every second step only one phase is energized and during the other steps, one phase on each stator is energized. The stator is energized according to the sequenceand the rotor steps from positionTable Excitation sequences for different drive modesStepper motor driver circuitQ1+R2R3D3D5D2Q2D1D4B1R4D6GND2GND1R1Stepper CoilFigure. Driver Circuit for stepper motor coilComponentsResistorsR1=330 R2=2.2 kR3=2.2 kR4=2.2 kQ1 is optoisolator, PC 817Diodes D1, D4 are 1N 4007Diodes D2, D3 are 15 volt zener semiconductor diodeDiodes D5 and D6 are LEDsQ2 is IRF540N n-channel MOSFETB1 is 12 V supply for motorGND1 is FPGA groundGND2 is motor supply ground subprogramThe MOSFET generally remains off due to the pull down of the gate voltage by the serial connection of the resistor R3 and LED D5. When the input fr om FPGA is of high logic the diode of the optoisolator is turned on biasing the transistor, increase the gate voltage which turns the MOSFET on. This way the winding of the stepper motor is energized. When the input from the FPGA is of low logic, the MOSFET is turned off, which de-energizes the winding.MOSFET is highly sensitive to high voltage and gets damaged if the gate to source voltage exceeds 20V. Hence, for bulwark 15V zener diode is used. The protection for high reverse voltage is obtained by using diodes D1 and D4.MULTIPLIERFigureThe Multiplier centre can be configured in either parallel architecture or constant-coefficient architecture. In parallel architecture, the multiplier accepts inputs on buses A and B and generates the product of these two values. While in constant-coefficient architecture, the multiplier accepts the data on the A input bus and multiplies it by a user defined constant value.The multiplier core generates fixed point parallel multipliers and constan t coefficient multipliers for twos complement signed or unsigned data. It supports input ranging from 1 to 64 bits wide and outputs ranging from 1 to 128 bits wide.Input signalA170 A operand input bus, 18 bits wideB170 B operand input bus, 18 bits wide (parallel multipliers only)CLK Rising edge clock inputOutput signalP350 point of intersection output bit 35 downto bit 06. EPILOGUE6.1 System RequiredTo deploy any system, both supporting hardware and software system must be good enough to make the system work properly. The major requirements in our system are mainly FPGA, microphones, audio amplifiers, stepper motor, MOSFETs and the necessary software for VHDL coding and simulation.HardwareMicrophonesAudio amplifiersConnectors and cablesProto boardResistors, capacitorsMOSFETsPower supplySoftwareXilinx ISEModelsimMatlabProteusWindows XP, purviewCOST INCURREDWe have presented here, the cost incurred during the undertaking of the project.Input sectionS.No.ComponentQuantityRate (NR s) terms (NRs)1Microphone210202ADC (0808 CCN)14504503Buffer (HEF4050BP)2501004Audio Amplifier (LM 386)225505Resistor1 mob50506Capacitor1 pack2002007Miscellaneous400 descend1,270Output sectionS.No.ComponentQuantityRate (NRs)Cost (NRs)1Stepper motor1500500212 V battery110001,1003Optoisolator (PC 817)4251004MOSFET (IRF540N)445180515 V zener diode85406Resistor1 pack50507Diode201208Miscellaneous250Total2,240TOTAL COST (NRs) = 3,510NoteSpartan 3E starter kit was provided by the Department of Electronics and Computer Engineering. conversation and transportation cost has not been included.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.