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.

Thursday, March 4, 2010

Virtual Box and Fedora 12 Guest

Installing Guest Additions on Virtualbox enables you to use some very powerful  features such as seamless integration and full screen resolution mode.

for a fresh fedora 12 install

  1. su -
  2. yum –y install dkms gcc kernel-devel kernel-headers
  3. reboot
  4. cd /media/VBOXADDITIONS_3.1.4_57640 (version 3.1.4)
  5. ./VBoxLinuxAdditions-x86.run (for 32bit)
  6. reboot
  7. done!

for more detail

http://digitizor.com/2009/05/26/how-to-install-virtualbox-guest-additions-for-a-linux-guest/

and..

Fedora 12 Installation and Post-Installation Guide

http://www.my-guides.net/en/content/view/174/26/

Wednesday, March 3, 2010

异步FIFO设计

很多人在论坛上发过Peter Alfke 的那篇

Simulation and Synthesis Techniques for Asynchronous FIFO Design with Asynchronous Pointer Comparisons

但是具体设计却没什么人提及,可能是由于技术的保留吧,这里送一份schematcis 吧, verilog嘛,因为是公司项目的一部分,所以就不便透露了.

 

fifo

read_ptr和write_ptr都没什么特别的,一个4位的k-walk gray counter.

n0(V)是指针比较.

dir1,dir0 给出quadrant 结果.

然后进行empty,full evaluation.

剩下就是指针控制了.

enjoy~