great video sir.... exactly found what i needed... there is a minor misprint in calculation of norm_dem for Y & Z... 24 is printed instead 23.. but it wont affect the result much.. thanks for the simplified explanation :)
@andy.robinson7 жыл бұрын
Thanks! You broke the formula down to my level perfectly.
@BattleAddictGaming9 жыл бұрын
Holy crap was this helpful. Thanks a million for explaining it so well! Its also handy having a familiar accent.
@khurramhameed112-fetphdees64 жыл бұрын
Thank you very much sir for soooooo nice way of teaching..
@publicenemymcmenemy7 жыл бұрын
Clear explanation and example. Thanks!
@calvin199803249 жыл бұрын
Hi David, can you please provide a reference text for the formula of Normalised Correlation? I try to apply it to my data but cannot even google anything like the formula, it seems many pages are dealing with Normalised crosscorrelation. Does this formula have any other name?
@mahmoudnady24229 жыл бұрын
thank you it is interesting and useful
@sushilkulkarni22434 жыл бұрын
Hello David. Suppose I want to compare two audio files and want to find similarity score . How i have to do? I have one audio .wav file of 4 to 6 seconds and another audio .wav file of about 1 to 2 seconds.
@slocm3z5 жыл бұрын
lol i don't know why i watched these. but its cool non the less. i'm sure it'll come up in the future haha
@sodkenij82887 жыл бұрын
Thanks !! I love ur video so much
@abhinavabhi45257 жыл бұрын
after watching your video we feel to dump our professors into a well.
@rydude9986 жыл бұрын
If the sinusoid is already apart of the signal a and b why are you multiplying the sum of the sinusoids squared with the sum of the signals square in the denominator of your code? edit: My bad, I misunderstood what signals you were comparing in the normalized correlation. However, I don't understand why it was required to step through the matrix with a for loop previously but not now?
@eldany_uy3 жыл бұрын
Thanks for sharing this!!! I'm trying to implement but I'm not getting a value between -1 and +1...should I be doing something wrong? Anyway 'seems' to work. What i do is: i have two arrays: A[a1,a2,a3,a4...] B[b1,b2,b3,b4...] first normalize both data groups from 0 to 100 ( i want to find % changes) second i put in a variable 'first_pass' : (A[a1]*B[b1])+(A[a2]*B[b2]).... third i put in a variable 'second_pass' : (A[a1]^2) + (A[a2]^2).... forth i do the same with graph B and store in 'third pass' : B([b1]^2) + (B[b2]^2).... fifth i get my results: (first_pass/(SQRT(second_pass*third_pass)) my results is always > 0 but not between -1 and +1 could you help me? :) Thanks!
@Illumarnati10 жыл бұрын
Hi David, nice! Check typo at 5 min into Normalized Corr... video where your calculated energy for y is 24... & should be 23 as in the previous step.
@ddorran10 жыл бұрын
Thanks Illumarnati! I've added a comment at 4:10. Apologies for any confusion caused.
@Illumarnati10 жыл бұрын
David Dorran no confusion. Again, very nicely done. Thanks.
@danielpaz3497 жыл бұрын
Hello, thanks for the video. I have a question, what does biased and unbiased means in the xcorr function? (roughly speaking).
@ddorran7 жыл бұрын
unbiased means that values further away from a lag of zero are general smaller since there are fewer non-zero samples to sum. You can account for this by dividing by the number of overlapping samples for each calculation.
@Nick1Nap9 жыл бұрын
Hi David, I am really enjoying the videos you posted. I have seen others using the Pearson coefficient for correlation, specifically in template matching methods in the signal processing domain. The method above and Pearson method will provide rho to range from -1 to 1. However, It seems they will give slightly different answers, regarding the produced correlation coefficient. Are you aware of any type of documentation out there that highlights these two methods and their differences? Or even a more specific name for the normalized correlation coefficient method you discussed above for to me to do literature search on ? I am aware of this method, and its heavily used in signal processing as well, for applications in DTF and match filtering. I guess I am wondering if there is an ideal time to use one or the other, and I really haven't seen anything or anyone address this..... Best, Nick
@Nick1Nap9 жыл бұрын
+Nick1Nap I think found what I need... Thanks! dsp.stackexchange.com/questions/9491/normalized-square-error-vs-pearson-correlation-as-similarity-measures-of-two-sig
@ddorran9 жыл бұрын
+Nick1Nap Thanks for posting this link! I have a bad habit of using my own (and sometimes incorrect) terminology when I'm attempting to explain a concept and I have noticed this to be particularly problematic with this video.
@jeremfer63197 жыл бұрын
what does x= [a b c d] means? is it a dicrete signal that gets value a when t=0 , b when t=1 ... d when t=3 ? and what does N means?
So, from what I understand: correlation measure is to show how strongly the signal is into the sample signal, while normalized correlation is how similar are the signals, is this right, please?
@ddorran2 жыл бұрын
yes. That's how I interpret them
@shashidharmuniswamy26202 жыл бұрын
@@ddorran Thank you for your response, David. Actually, this makes sense and does have a basis I feel. While the Correlation measure shows how strongly the signal is in the sample signal by the dot product, the normalized correlation relation looks very much similar to the Pearson correlation factor (r). Thereby describing how linear or nonlinear the association of the two variables x and y, or in this case - the signals are. Can I conclude like this? It would be nice to hear your thoughts, please.
@athens314153 жыл бұрын
This is a good explanation of what the equations represent and how to code them up, but ultimately fails to explain what it claims to do (describe when normalised correlation is beneficial to use over other methods).
@ddorran3 жыл бұрын
In the first minute of the video it shows that standard correlation measures are impacted by the energy of the signals being correlated (rather than the shape) and later it shows that normalised correlation deals with this issue by scaling standard correlation appropriately. Does this not show when normalised correlation is useful? Have I misunderstood the point you are making?
@sarvariabhinav7 жыл бұрын
excellent explaination but can you tell why we have only used energy scaling factor normalisation and not some other function like say modulus scaling factor??? please reply...Thank You.
@ddorran7 жыл бұрын
The scaling factor used ensures that the correlation value returned lies between -1 and 1. I guess that other scaling factors could be used that might be more computationally efficient but they wouldn't have the property of ensuring the result lies between -1 and 1
@asrafmohamedmoubark9 жыл бұрын
hi..i have a question..in what particular situation that we have to use normalize correlation ? can you explain to me..thank you..
@ddorran9 жыл бұрын
+asraf mohamed One situation would be where you have a signal that contains a lot of high energy fluctuations and you are searching for the presence of relatively low energy waveform within the signal.
@asrafmohamedmoubark9 жыл бұрын
+David Dorran it make sense..thank you so much..by the way..i like all of your videos..good jobs..carry on..cheers
@Krishnajha201016 жыл бұрын
Hint: Think in terms of vectors. Normalized correlation is just the dot product of unit vectors.
@tetlleyplus7 жыл бұрын
Isn't Normalised Correlation, just the cosine of the angle between the two vectors? (dot(x',y)/sqrt(norm(x)*norm(y))
@fukgovernment9 жыл бұрын
Thanks sir. But I am a bit confused some textbooks include some kind of shifting to one of the signal being correlated. Yours do not include any form of shifting?
@ddorran9 жыл бұрын
Outlaw The shifting (a.k.a. lag) is associated with cross correlation. See kzbin.info/www/bejne/iICbpGSKp6qfe9k
@tigrayrimey64183 жыл бұрын
good pt.
@rabiafyz99528 жыл бұрын
Hi, i searched normalized cross correlation. which used signal - mean in equation. So i have a question, What is the difference between normalized cross correlation and normalized correlation?
@ddorran8 жыл бұрын
Here is a link to a video that might help explain kzbin.info/www/bejne/iICbpGSKp6qfe9k
@NosferatuBS4 жыл бұрын
Thank you!
@bigumangaba793010 жыл бұрын
enlightening
@kuncao654910 жыл бұрын
why we should not use the normalised correlation here? Is the b did more similar with s1?
@ddorran10 жыл бұрын
In the second example you are trying to determine how strongly present one signal is another rather than a direct measure of similarity between signals
@kuncao654910 жыл бұрын
Thank you! I think I don't get the meaning of 'strongly present', would it be used in signal conditioning? It did amplify the signal, yet introduced a larger noise.
@ddorran10 жыл бұрын
Yes - you could have a signal you are interested in buried in noise. So in this case you would have a signal added with noise - you could use correlation to see how strongly the signal was present in the noisy signal.
@Hamdifollowing9 жыл бұрын
when correlation is applied is there a minimum value based on which it is decided that the waves are similar or it is proportionality between minmum corr and max corr ?
@ddorran9 жыл бұрын
it would depend on the application and would most likely be determined through experimentation
@Hamdifollowing9 жыл бұрын
David Dorran so it complicated then . i did a correlation between i think two sines and the value was 60 . in DTMF number detection .. correlating the spectrum of the recording with standard DTMF signals spectrum doesn't result 1 in the normalized formula . the peaks are of very less values but still constitute peaks compared to other correlations .
@pranavbhardwaj9095 жыл бұрын
Could someone please resolve the following issue : The correlation results 1, when compared to correlation results 2, indicate that the 2 signals in consideration are better correlated in the first case (100>50). However the same conclusion from normalized correlation results indicate otherwise (0.4364
@Hamdifollowing10 жыл бұрын
how we can link this to the fourier series and transform ? i think in the transform we are using the standard correlation .
@ddorran10 жыл бұрын
The discrete Fourier transform is a simply correlation of a signal with a set of sinusoidal basis functions see kzbin.info/www/bejne/eGPMhnd4j991prs
@Hamdifollowing10 жыл бұрын
David Dorran Nice. But what is the necessity of correlating with exponential ? Exponential contains Re cosine part and Im sine part . Why we just can not correlate with cosine or sine ? And why we do not use normalization ?
@ddorran10 жыл бұрын
hamdi f The complex exponential is a combination of a cosine and a sine so its mathematically convenient to use it rather than use separate sines and cosines. Also if the signal being analysed is complex (real and imaginary terms) then that signal isn't just made up of sinusoids (which are combinations of negative and positive frequency complex exponential pairs which are equally weighted see kzbin.info/www/bejne/g2LFfYOQmbN2iKM) its made up of a set of positive frequency complex exponentials and negative frequency complex exponentials which may not have matching weighting for positive and negative frequency pairs. If you used normalised correlation you wouldn't be able to determine how strongly present a cosine or sine was in the signal being analysed see kzbin.info/www/bejne/pJiodGapjcqImJYm36s
@Hamdifollowing10 жыл бұрын
David Dorran Regarding the last paragraph ; if i got a x1(t)=coswt and x2(t)=10*coswt then the normalized corr formula fails though they have the same frequency and should have the same magnitude response except for the some scaling differences in magnitude plot . And if i have two different frequency waves the standard corr formula may fail and show misleading answer that they are similar ! The second point ; you said that standard corr shows how much of signal 1 is in signal 2 . But since multiplication is commutative and that means that sig1 is contained in sig2 as much as sig2 is contained in sig1 ! and i think that is not correct . Can we use at least for real signals .. a Fourier terms of cosine or sine for corr ?
@ddorran10 жыл бұрын
If you correlate two sinusoids of different frequencies (f1 and f2) you will get a result of zero (once the duration over which you correlate is an integer multiple of 1/(f1-f2)) With regard to the second point my terminology is misleading - I do say that correlation is a measure of how strongly present one signal is in another which I think is conceptually a nice way to think of it in certain situations. However saying that correlation is measure of similarity between two signals is more accurate and would fit in with your observation that the correlation process is commutative. Yes you could undertake a Fourier type analysis of real signal that correlates against only real cosines and sines.
@yuanli76267 жыл бұрын
thanks a lot!
@milorday51412 жыл бұрын
thx
@TheBjjninja5 жыл бұрын
Why not just scale the data?
@ddorran5 жыл бұрын
Scaling the data would also work. It amounts to the same thing