Insights Blog
-- Browse All Articles --
Physics Articles
Physics Tutorials
Physics Guides
Physics FAQ
Math Articles
Math Tutorials
Math Guides
Math FAQ
Education Articles
Education Guides
Bio/Chem Articles
Technology Guides
Computer Science Tutorials
Forums
General Math
Calculus
Differential Equations
Topology and Analysis
Linear and Abstract Algebra
Differential Geometry
Set Theory, Logic, Probability, Statistics
MATLAB, Maple, Mathematica, LaTeX
Trending
Featured Threads
Log in
Register
What's new
Search
Search
Search titles only
By:
General Math
Calculus
Differential Equations
Topology and Analysis
Linear and Abstract Algebra
Differential Geometry
Set Theory, Logic, Probability, Statistics
MATLAB, Maple, Mathematica, LaTeX
Menu
Log in
Register
Navigation
More options
Contact us
Close Menu
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Forums
Mathematics
MATLAB, Maple, Mathematica, LaTeX
Calculating delay b/w signals using correlation
Reply to thread
Message
[QUOTE="nauman, post: 6853770, member: 585735"] Hi all I am generating two signals of same frequency, i introduce a fixed delay in one of the signal and then try to find out the simulated delay using MATLAB 'gccphat' and 'finddelay' functions, but not able to measure correct delay. MATLAB Code script is given below: [CODE lang="matlab" title="Delay b/w two signals using correlation"]clc clear close all%%%%======================================================================= %%%%============================General Parameters========================= %%%%======================================================================= fo=8500;%frequency in Hz samp_f=30*51.2e3;%Sampling frequency samp_t=1/samp_f; chunk_size=163840; total_chunks=1; chunk_time=chunk_size/samp_f; chunk_t=0:samp_t:(samp_t*(chunk_size-1));%time vector calculated delay_=0.0064; H1(1:chunk_size,1)=sin(2*pi*fo*(chunk_t))+0*randn(1,chunk_size);%Sensor H1 signal H2(1:chunk_size,1)=sin(2*pi*fo*(chunk_t+delay_))+0*randn(1,chunk_size);%Sensor H2 signal figure,plot(H1(1:2000)),hold on,plot(H2(1:2000),'r') format long tau_a=gccphat(H1,H2,samp_f) tau_b = finddelay(H1, H2) / samp_f[/CODE] Output: tau_a = 0 tau_b = 1.171875000000000e-05 Can any one kindly point out where i am doing wrong with such simple task? As per my understanding, both outputs should match with the delay i.e. 0.0064s? Thanks [/QUOTE]
Insert quotes…
Post reply
Forums
Mathematics
MATLAB, Maple, Mathematica, LaTeX
Calculating delay b/w signals using correlation
Back
Top