Friday, May 21, 2010

一个Geek 的内心

曾几何时,我们都是一群天真的孩子,对世界和社会的好奇让们有了自己的思想.

沟通

言语,表情,行动.

交流

同步,异步,随机

识人

长短,习性,理想

用人

天时,地利,人和

管理

松紧,规矩,原则

回报

无私,感恩,循环

Sunday, March 7, 2010

Jacobi iterations and vector rotation

The Jacobi method [see wiki] for solving liner system is based on the fact that matrix multiplication will rotate the vector and converge if the infinity norm of Eigen values are less than 1.

From a practical point of view, the performance of convergence is determined by the spectral radius [see wiki] of the matrix. and the small the spectral radius the better.

CORDIC computations are also a sequence of rotations but the rotation matrix is adaptive. the spectral radius of rotation matrix is always 1, but when rotating using shift & add, the spectral radius is slightly bigger than 1, but as the rotation angle –>0, the spectral radius->1, so resulting vector converge to the set angle/point. more information about CORDIC please check these papers.

I have also wrote a matlab script for visualizing the path of the vector converge/ diverge. the red curve shows the path, and green/blue lines are the lines defined by eigenvectors. note that the rotation vector is random.

%%  eig value roatation divergence/ convegence
N=100; %number of interations
r=rand(2,2);

[l v]=eig(r);
x=N*ones(1:N,2);
eigenvalu_max=max(max(v))
if eigenvalu_max<1.1


    for i=1:N+1
x(i+1,:)=r*x(i,:)';
end
end

%compass(x(:,1),x(:,2));
plot(x(:,1),x(:,2),'r'); axis equal; hold on
plot([-N:N]'./l(1,1),[-N:N]'./l(2,1),'g');
plot([-N:N]'./l(1,2),[-N:N]'./l(2,2),'b'); hold off;


eigen_rotation1



the path of convergence some oscillate along the way down to 0, this another interesting fact about eigenvalues, so far I am still not very sure the exact reason, but I have some ideas, maybe I will post another one when I got the time to prove it.

Saturday, March 6, 2010

Pink noise beat analysis -part1

pink noise [see wiki] is a very interesting phenomena where the frequency spectrum has a 1/f curve.

but many musical instrument’s harmonics often show this 1/f like curve as well, a interesting fact is, if the frequency spectrum curve is smooth (no leakages [see wiki] or holes ), then they don’t sounds like noise any more. otherwise they sounds more noisy.

blow is a sample pink beat I found from this link http://www.brusi.com/downloads.shtml, a download  link is provided below, you can try it first and then read on.

in matlab, the periodogram analysis shows the PSD like this,

pink beat

and the time domain waveform as below

pink beat_time

to compare it with another base generated by Maxim Vedenev

from http://dj-toolbox.9f.com/

drum beat_time

and PSD

drum beat_psd

personally, I would say the pink beat is more rich with dynamics and sounds more attractive,and the drum beat is more pure and more leaky in the spectrum, but that’s not end of story.

I will post a second blog which explain the windowing effect on PSD and spectral smoothing. thanks for reading.