Wednesday, June 5, 2019

Generalized Cross Correlation With Phase Transform Information Technology Essay

Generalized Cross Correlation With Phase Transform Information Technology EssayThe start foreshadow from a source is captured by a pair of mikes. The elongate channelise from the microphone must be amplified and converted into digital for further processing. Hence, an linear to digital converter external to the FPGA is used. After the analog symptom is digitized, the signal is fed into FPGA for source localization. The digital signals are depression saved into input buffer. In our case, we attain used start-off in First out (FIFO) as a memory controller. The signals in era subject area are then converted into relative frequency domain by using debauched Fourier Transform (FFT).Generalized cross correlational statistics (GCC) is used for the estimation of season dispute of arrival (TDOA) of the sound signals from the microphone pair. After TDOA is estimated, we then calculate the watchfulness from which the sound signal is arriving which we refer to as callion of a rrival (DOA). The appropriate degree is used by the stepper ride controller module which controls the rotary motion and speed of the stepper motor. The signal from stepper motor controller module is fed into stepper motor driver circuit which is responsible in energize the appropriate coils of the stepper motor in particular rate 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 through 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 will take for the sound to r for each one the microphone. Two microphones located at different places will receive the same sound (plus noise) at a different time. The TDOA method takes advantage of this decelerate arrival to estimate the location of the sourc e. ref mediatech4For a source signal s(t) propagated through a noisy and reverberant environment, the sensor signals of two spatially separated microphones and and burn be expressed as(4.1)(4.2)w present is the attenuation factor, and are the time stick arounds, and the additive term includes the channel noise in the microphone system as rise up as any ambient noise for the sensor. This noise is assumed to be uncorrelated with .The TDOA estimation calculates the relative ensure of the time go overs and of the two recorded microphone signals and defined as ref 10.1.1.9.3680(4.3)Now formulae (4.1) and (4.2) can be written 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 evaluate to give TDOAxi(t)xj(t)Fig 4.2 Block for estimating TDOACross correlation between the two signals is calculated 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 coupled 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 lingoly greater than the interfering noise, such that(4.11)The last triplet terms of equation (4.10) are negligible compared to first term based on the above 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 approach is that it is highly influenced by noise and reverberation. To lessen its influence on TDOA estimation, we need to whiten the cross correlation by using Generalized Cross Correlation with Phase Transform (GC C-PHAT)(4.14)And its time domain counterpart is(4.15)Where FT stands for Fourier transform and IFT stands for inverse Fourier transformThe output of the GCCPHAT function is delta like with peak at .The above analysis is based on analog signals and stationary . For digital processing, the are sampled and become decided terms . Also the are not stationary as the source of sound is liable to change location. For analysis, limited frames are also required collect to computational constraints. Hence the usual windowing techniques are use and the sampled signals are broken into analysis frames. 10.1.1.43.5850After conversion into the discrete finite sequence domain, equation (4.15) becomes(4.16)Direction of arrival (DOA) estimationIt is possible to compute the position of the source through geometrical calculation once TDOA is estimated. We determine a simple model based on far field assumption.Microphone iMicrophone jsource direction fig 4.3 cipher source direction from TDOAConside r the Figure 4.3, which illustrates the case of 2 microphone array with a source in the far field. Using cosine law, we recite that(4.16)where is a unit vector pointing 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 prone by (90-) as shown in Figure 4.4. Also, from the guess, (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 fitly performed on a digital signal processor, which may be a specially designed digital hardware or a general direct digital computer. We convert the time-domain sequence to an equivalent frequency domain archetype to perform frequency a nalysis 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 Discrete Fourier Transform (DFT), which is a powerful computational tool for perform frequency analysis of discrete time signals.In the view of the importance of the DFT in various digital signal processing applications, such as correlation analysis, linear filtering, spectrum analysis, its efficient computation is a topic that has received considerable attention by many mathematicians, engineers, and applied scientists .The number of complex multiplication and rise to power 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 data points to calculate, each of which requires N complex arithmetic operations.For length n input vector x, the DFT is a length n vector X, with n elements(4.18)Basically, DFT computes t he sequence X(k) of N complex valued numbers given another 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 involve essentially the same type of computations. Therefore, efficient computational algorithmic ruleic programs 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 very efficient method. Hence, DFT will not be very useful for the majority of practical DSP applications if we cant do any better than this.However, there are a number of different Fast Fourier Transform (FFT) algorithms that enable the calculation the Fourier transform of a signal much faster than a DFT. FFT exploits the symmetry and periodicity properties of the degree factor WN. In particular these two properties areSymmetry prop(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 reply of an FFT looks like a sinc function (sinx) / x, if the function to be transformed is not harmonically related to the sampling frequency,Radix 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 provides a direct measure of execution time and that the relevant logarithm base is 2 then as shown in circuit board 4.1, ratio of execution times for the (DFT) vs. (Radix 2 FFT) (denoted as Speed 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 radix 2 algorithms, Decimation in Time (DIT) and Decimation in frequency (DIF) algorithm. They both confide on the recursive decomposition of an N point transform into 2 (N/2) point transforms. This decomposition process can be applied to any abstruse (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. present 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 SimulationFigure 4.8 Simulink model for verification of TDOA algorithmSimulink model is used to verify the algorithm for calculating the time differe nce of arrival (TDOA). Samples of audio signal is read 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 tink the 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 irregular is shown in figure 4.9. We see that a right away line is obtained at delay sample of 25. But, we can also see variations in between, with maximum value o f delay samples shooting to 128. But the maximum luck 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 seconds 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 drive modelFigure 4.11 shows a Simulink model of stepper motor drive using 2 phase interbreeding 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 endeavor of stepper motor drive is controlled by the STEP and DIR signals generated from the Signal Builder block. Square-wave current references are generated using the current amplitude and the step frequency parameters stipulate in the dialog window of the Signal Builder block.The STEP signal from the Signal Builder block controls the movement of the stepper motor. A positive value of STEP 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 while 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 scope hoofer MOTORA stepper motor is an electromechanical device which converts electrical pulses into discrete 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 s equence. The motors rotation has several direct relationships to these applied input pulses. The sequence of the applied pulses is at present 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 efficacious 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 magnetic disc drives, automotive and many more. One of the most important advantages of a stepper motor is that it can be accurately controlled in an open loop system. dissonant loop control means no feedback information about position is needed. The position is known simply ba ck 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 magnetic flux is developed in the stator coil when a phase winding of a stepper motor is energized with current. The direction of this flux is determined by the right 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 atomic number 16 pole 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 payable to magnetic attraction. motorbas.pdfFigure 3.14 Stator and rotor of stepper motor showing the current directionWe have used a stepper motor with fractional 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 diodeDiodes D5 and D6 are LEDsQ2 is IRF540N n-channel MOSFETB1 is 12 V supply for motorGND1 is FPGA groundGND2 is motor supply groundOperationThe MOSFET generally remains off due to the pull down of the gate voltage by the series connection of the resistor R3 and LED D5. When the input from FPGA is of high logic the diode of the optoisolator is turned on biasing the transistor, increasing 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 discredited if the gate to source voltage exceeds 20V. Hence, for protection 15V zener diode is used. The protection for high reverse voltage is obtained by using diodes D1 and D4.MULTIPLIERFigureThe Multiplier centerfield 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 harvest 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 constant 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. foreplay signalA170 A operand input bus, 18 bits wideB170 B operand input bus, 18 bits wide (parallel multipliers only)CLK Rising edge clock inputOutput signalP350 Product output bit 35 downto bit 06. EPILOGUE6.1 System RequiredTo deploy any system, both supporting hardware and package 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 essential software for VHDL coding and simulation.HardwareMicrophonesAudio amplifiersConnectors and cablesProto boardResistors, capacitorsMOSFETsPower supplySoftwareXilinx ISEModelsimMatlabProteusWindows XP, VistaCOST INCURREDWe have presented here, the cost incurred during the toil of the project.Input sectionS.No.ComponentQuantityRate (NRs) greet (NRs)1Microphone210202ADC (0808 CCN)14504503 yellowish brown (HEF4050BP)2501004Audio Amplifier (LM 386)225505Resistor1 pack50506Capacitor1 pack2002007M iscellaneous400Total1,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,510Note stark 3E starter kit was provided by the Department of Electronics and Computer Engineering.Communication and transportation cost has not been included.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.