Sunday, October 25, 2009

UFO Over Moscow???





Strange Clous Formation!!

Saturday, October 24, 2009

The Art of Being Well



If you don’t want to be ill...
...Speak your feelings.

Emotions and feelings that are hidden, repressed, end in illnesses as: gastritis, ulcer, lumbar pains, spinal. With time, the repression of the feelings degenerates to the cancer. Then, we go to a confidante, to share our intimacy, ours "secret", our errors! The dialogue, the speech, the word, is a powerful remedy and an excellent therapy!

If you don’t want to be ill...
...Make Decisions.

The undecided person remains in doubt, in anxiety, in anguish. Indecision accumulates problems, worries and aggressions. Human history is made of decisions. To decide is precisely to know to renounce, to know to lose advantages and values to win others. The undecided people are victims of gastric ailments, nervous pains and problems of the skin.



If you don’t want to be ill...
...Find Solutions.

Negative people do not find solutions and they enlarge problems. They prefer lamentation, gossip, pessimism. It is better to light a match that to regret the darkness. A bee is small, but produces one of the sweetest things that exist. We are what we think. The negative thought generates negative energy that is transformed into illness.


If you don’t want to be ill...
...Don’t Live By Appearances.

Who hides reality, pretends , poses and always wants to give the impression of being well. He wants to be seen as perfect, easy-going, etc. but is accumulating tons of weight. A bronze statue with feet of clay. There is nothing worse for the health than to live on appearances and facades. These are people with a lot of varnish and little root. Their destiny is the pharmacy, the hospital and pain.



If you don’t want to be ill...
...Accept.

The refusal of acceptance and the absence of self-esteem, make us alienate ourselves. Being at one with ourselves is the core of a healthy life. They who do not accept this, become envious, jealous, imitators, ultra-competitive, destructive. Be accepted, accept that you are accepted, accept the criticisms. It is wisdom, good sense and therapy.

If you don’t want to be ill...
...Trust.

Who does not trust, does not communicate, is not opened, is not related, does not create deep and stable relations, does not know to do true friendships. Without confidence, there is not relationship. Distrust is a lack of faith in you and in faith itself.


If you don’t want to be ill...
...Do Not Live Life Sad.

Good humor. Laughter. Rest. Happiness. These replenish health and bring long life. The happy person has the gift to improve the environment wherever they live. “Good humor saves us from the hands of the doctor". Happiness is health and therapy.

Monday, October 19, 2009

Generator & Syndromer for (15,7) Cyclic Code

Here is the combined generator and decoder matlab script for (15,7) cyclic code.
In the transmitter, (15,7) cyclic code is sent in generator while syndrome is obtaianed in the receiver side. Can refer back to previous post.






%Given generator g(X)=1+X^4+X^6+X^7+X^8 for a (15,7) cyclic code

%Calculate the transmitted cyclic code for a given message and
%show its operation step by step

clc
clear all;
close all;

%Generator part-------------------------------------------------------------
m=[1 0 1 1 1 0 0]; %A given message with k size (can change to any value)
disp(sprintf('\n\nThe message is %d%d%d%d%d%d%d\n\n',m))
m_flp= fliplr(m); %reverse the sequence because MSB is first shifted in
x=zeros(1,8); %initiallized shift register to zero
x_prev = zeros(1,8); %initialized virtual previous state shift register to zero

for i=1: length(m)

%store all previous value
x_prev(1)=x(1);
x_prev(2)=x(2);
x_prev(3)=x(3);
x_prev(4)=x(4);
x_prev(5)=x(5);
x_prev(6)=x(6);
x_prev(7)=x(7);
x_prev(8)=xor(x(8),m_flp(i));

%encoder connection based on the generator g(X)
x(1) = x_prev(8);
x(2) = x_prev(1);
x(3) = x_prev(2);
x(4) = x_prev(3);
x(5) = xor(x_prev(4),x_prev(8));
x(6) = x_prev(5);
x(7) = xor(x_prev(6),x_prev(8));
x(8) = xor(x_prev(7),x_prev(8));

%storing values
x_store(i+1,:)=[x(1) x(2) x(3) x(4) x(5) x(6) x(7) x(8)]; %the +1 to include initial state
shift_number(i+1,:)=i;
m_input(i+1)=m_flp(i);

end

%display nicely
for i=1: (length(m)+1) %plus 1 to include initial state
disp(sprintf('Shift number = %d\tRegister-->%d%d%d%d%d%d%d%d,\tinput=%d',shift_number(i),x_store(i,:),m_input(i)))
end

output=[x_store(length(m)+1,:) m]; % Transmited output

disp(sprintf('\n\nThe transmitted cyclic code is %d%d%d%d%d%d%d%d%d%d%d%d%d%d%d\n\n',output))


%Receive part-------------------------------------------------------------

%Calculate the received cyclic code for a given messege and

%show its operation step by step to get syndrome

z=output;

%to enable corrupted bit
%z=xor(output , [1 0 0 0 0 0 0 0 0 0 0 0 0 0 0])

z_flp= fliplr(z); %reverse the sequence because MSB is first shifted in
x=zeros(1,8); %initiallized shift register to zero
x_prev = zeros(1,8); %initiallized virtual previous shift register to zero

for i=1: length(z)

%store all previous value
x_prev(1)=x(1);
x_prev(2)=x(2);
x_prev(3)=x(3);
x_prev(4)=x(4);
x_prev(5)=x(5);
x_prev(6)=x(6);
x_prev(7)=x(7);
x_prev(8)=x(8);

%decoder connection based on the generator g(X)
x(1) = xor(x_prev(8),z_flp(i));
x(2) = x_prev(1);
x(3) = x_prev(2);
x(4) = x_prev(3);
x(5) = xor(x_prev(4),x_prev(8));
x(6) = x_prev(5);
x(7) = xor(x_prev(6),x_prev(8));
x(8) = xor(x_prev(7),x_prev(8));

%storing values
x_store(i+1,:)=[x(1) x(2) x(3) x(4) x(5) x(6) x(7) x(8)];
shift_number(i+1,:)=i;
z_input(i+1)=z_flp(i);

end

%display nicely
for i=1: (length(z)+1) %plus 1 to include initial state
disp(sprintf('Shift number = %d\tRegister-->%d%d%d%d%d%d%d%d,\tinput=%d',shift_number(i),x_store(i,:),z_input(i)))
end

disp(sprintf('\n\nThe syndrome is %d%d%d%d%d%d%d%d',x_store(length(z)+1,:)))



------------------------------------------------------
Work screen
------------------------------------------------------

The message is 1011100


Shift number = 0 Register-->00000000, input=0
Shift number = 1 Register-->00000000, input=0
Shift number = 2 Register-->00000000, input=0
Shift number = 3 Register-->10001011, input=1
Shift number = 4 Register-->01000101, input=1
Shift number = 5 Register-->00100010, input=1
Shift number = 6 Register-->00010001, input=0
Shift number = 7 Register-->00001000, input=1


The transmitted cyclic code is 000010001011100


Shift number = 0 Register-->00000000, input=0
Shift number = 1 Register-->00000000, input=0
Shift number = 2 Register-->00000000, input=0
Shift number = 3 Register-->10000000, input=1
Shift number = 4 Register-->11000000, input=1
Shift number = 5 Register-->11100000, input=1
Shift number = 6 Register-->01110000, input=0
Shift number = 7 Register-->10111000, input=1
Shift number = 8 Register-->01011100, input=0
Shift number = 9 Register-->00101110, input=0
Shift number = 10 Register-->00010111, input=0
Shift number = 11 Register-->00000000, input=1
Shift number = 12 Register-->00000000, input=0
Shift number = 13 Register-->00000000, input=0
Shift number = 14 Register-->00000000, input=0
Shift number = 15 Register-->00000000, input=0


The syndrome is 00000000

Matlab: Calculating Syndrome of Cyclic Code (15,7)

The design of the syndrome decoder

It is a matlab script to calculate syndrome of a (15,7) cyclic code.

%for cyclic code (15,7)
%Given g(X)=1+X^4+X^6+X^7+X^8
%Design a syndrome computation circuit and calculate the syndrome if
input, Z=1+X^12+X^14

clc
clear all;
close all;

z=[1 0 0 0 0 0 0 0 0 0 0 0 1 0 1 ]; %input vector=1+X^12+X^14
z_flp= fliplr(z); %reverse the sequence because MSB is first shifted in
x=zeros(1,8); %initialized shift register to zero
x_prev = zeros(1,8); %initialized virtual previous shift register to zero

for i=1: length(z)

%store all previous value
x_prev(1)=x(1);
x_prev(2)=x(2);
x_prev(3)=x(3);
x_prev(4)=x(4);
x_prev(5)=x(5);
x_prev(6)=x(6);
x_prev(7)=x(7);
x_prev(8)=x(8);

%decoder connection
x(1) = xor(x_prev(8),z_flp(i));
x(2) = x_prev(1);
x(3) = x_prev(2);
x(4) = x_prev(3);
x(5) = xor(x_prev(4),x_prev(8));
x(6) = x_prev(5);
x(7) = xor(x_prev(6),x_prev(8));
x(8) = xor(x_prev(7),x_prev(8));

%storing values
x_store(i+1,:)=[x(1) x(2) x(3) x(4) x(5) x(6) x(7) x(8)];
shift_number(i+1,:)=i;
z_input(i+1)=z_flp(i);

end

%display nicely
for i=1: (length(z)+1) %plus 1 to include initial state
disp(sprintf('Shift number = %d\tRegister-->%d%d%d%d%d%d%d%d,\tinput=%d',shift_number(i),x_store(i,:),z_input(i)))
end




--------------------------------------------------------------------------------------
Calculating Syndrome Value:
Shift number = 0 Register-->00000000, input=0
Shift number = 1 Register-->10000000, input=1
Shift number = 2 Register-->01000000, input=0
Shift number = 3 Register-->10100000, input=1
Shift number = 4 Register-->01010000, input=0
Shift number = 5 Register-->00101000, input=0
Shift number = 6 Register-->00010100, input=0
Shift number = 7 Register-->00001010, input=0
Shift number = 8 Register-->00000101, input=0
Shift number = 9 Register-->10001001, input=0
Shift number = 10 Register-->11001111, input=0
Shift number = 11 Register-->11101100, input=0
Shift number = 12 Register-->01110110, input=0
Shift number = 13 Register-->00111011, input=0
Shift number = 14 Register-->10010110, input=0
Shift number = 15 Register-->11001011, input=1

Other cyclic code: generator-syndromer-for-15-7-cyclic-code

Sunday, October 18, 2009

低頭看得破

低頭看得破


僧人的鞋子上面,左三個洞右三個洞,為的是讓出家人低頭看得破。 但是人在諸多慾望面前卻很難看得破,因為很多時候當我們的眼睛只緊緊盯著自己渴求的東西時,是很難低下頭來看的。

在禪宗裡有這樣的一個故事:有一位高僧,是一座大寺廟的方丈,因年事已高,心中思考著找接班人。一日,他將兩個得意弟子叫到面前,這兩個弟子一個叫慧明,一個叫塵元。高僧對他們說:「你們倆誰能憑自己的力量,從寺院後面懸崖的下面攀爬上來,誰將是我的接班人。」

慧明和塵元一同來到懸崖下,那真是一面令人望之生畏的懸崖,崖壁極其險峻陡峭。身體健壯的慧明,信心百倍地開始攀爬。但是不一會兒他就從上面滑了下來。慧明爬起來重新開始,儘管這一次他小心翼翼,但還是從山坡上面滾落到原地。慧明稍事休息了後又開始攀爬,儘管摔得鼻青臉腫,他也絕不放棄……讓人感到遺憾的是,慧明屢爬屢摔,最後一次他拼盡全身之力,爬到半山腰時,因氣力已盡,又無處歇息,重重地摔到一塊大石頭上,當場昏了過去。高僧不得不讓幾個僧人用繩索,將他救了回去。

接著輪到塵元了,他一開始也是和慧明一樣,竭盡全力地向崖頂攀爬,結果也屢爬屢摔。塵元緊握繩索站在一塊山石上面,他打算再試一次,但是當他不經意地向下看了一眼以後,突然放下了用來攀上崖頂的繩索。然後他整了整衣衫,拍了拍身上的泥土,扭頭向著山下走去。

旁觀的眾僧都十分不解,難道塵元就這麼輕易的放棄了?

大家對此議論紛紛。只有高僧默然無語地看著塵元的去向。

塵元到了山下,沿著一條小溪流順水而上,穿過樹林,越過山谷……最後沒費什麼力氣就到達了崖頂。

當塵元重新站到高僧面前時,眾人還以為高僧會痛罵他貪生怕死,膽小怯弱,甚至會將他逐出寺門。誰知高僧卻微笑著宣佈將塵元定為新一任住持。

眾僧皆面面相覷,不知所以。塵元向同修們解釋:「寺後懸崖乃是人力不能攀登上去的。但是只要於山腰處低頭下看,便可見一條上山之路。


師父經常對我們說"明者因境而變,智者隨情而行",就是教導我們要知伸縮退變的啊。」

高僧滿意地點了點頭說:「若為名利所誘,心中則只有面前的懸崖絕壁。天不設牢,而人自在心中建牢。在名利牢籠之內,徒勞苦爭,輕者苦惱傷心,重者傷身損肢,極重者粉身碎骨。」

然後高僧將衣缽錫杖傳交給了塵元,並語重心長地對大家說:「攀爬懸崖,意在堪驗你們心境,能不入名利牢籠,心中無礙,順天而行者,便是我中意之人。」



世間痴情之人,執著於勇氣和頑強者不在少數,但是往往卻如故事中的慧明一樣,並不能達到心中嚮往的那個地方,只是摔得鼻青臉腫,最終一無所獲。在己之所欲面前,我們缺少的是一份低頭看的淡泊和從容。低頭看,並不意味著信念的不堅定和放棄,只是讓我們擁有更多的選擇和迴旋的餘地。

在我以前工作過的單位,有一個人稱棋迷的老王,他最大的樂趣就是同人家下棋。一次在閒聊中他告訴我:他在二十歲的時候下棋的技術就很不錯了,經常參加縣裡或市裡的比賽。他為此很是得意,就連以前教過他的老師都不放在眼裡了。有一天,他過生日,請了很多人。其中包括他的女朋友和教他下棋的老師。

宴席過後,他如同以往一樣要跟老師賽一盤棋。老師提出一個要求,每局都用一樣物品做賭注。第一局用一百元做賭注,第二局賭老王最心愛車子,第三局賭老王女友送他的生日禮物。老王痛快的答應了。結果第一局他輕鬆的就贏了老師。

第二局的時候,老師很鄭重地警告他說:「不要太驕傲,如果輸了,車就要不回去了。」老王當然知道車子在自己心中的位置,所以很用心地跟老師又過起招來。可是讓他意外的是,他居然輸了。

在第三局中,老師又對他說,如果他贏了,不光可以保留住女朋友送他的禮物,還可以把車子也拿回去。於是他就更用心了,全部的精神都放在棋盤上。讓人不可置信的是,他居然又輸了。他怎麼也想不通,平時自己輕鬆就可以贏得的勝利,怎麼會如此大失水準一再失敗?老師最終當然沒有要他的車子和他女友的禮物,臨行前他送給自己這個弟子五個字:「外重者內拙」。

老王從這五個字上明白了自己失敗的原因:正因為他太在意車子和女友送他的禮物,所以思想上有了羈絆,過度用力和意念過於集中,因而將平素可以輕鬆完成的事情搞糟了。

是啊,越是急於完成什麼,越是太在意得失,那麼巨大的壓力和恐懼就會束縛你的手腳,你離你的目標就會越來越遠,成功也將遙不可及。所以,不妨把眼光放得遠一些,得失放得開一些,名利看得輕一些,讓生命中充滿淡泊的恬適和達觀的從容,就一定能「水窮之處待雲起,危崖旁側覓坦途。」

Sunday, October 11, 2009

EMC/EMI lab tour

Last semester, I attended electromagnetic compatibility and interference (EMC/EMI) graduate course in NTU. It is an interesting course which introducing the importance of EMC/EMI test and the way to reduce electromagnetic inteference in circuits and PCB boards. This course was taught by Prof See & Prof Koh. They are indeed knowledgeable and good in teaching, giving clear explanation.

having class in the semi-aechoic chamber

The most impressive part of this course is that we had a lab lecture inside in the Semi-Anechoic Chamber (SAC) at the last lecture. Wow, it is my first time visiting aechoic chamber.

the ceilling of the chamber was covered by absorbers

Antenna test equipments for different frequency ranges

There was a rotating ground plate which can support a tank weight. The metal table was a standard test setup for commercial products like computers and TV.

taking a photo :p

Besides visiting semi-aechoic chamber, we also visited Mode Stirred Chamber (MSC) or reverberation chamber. It was an improved version chamber that could stir electromagnetic wave in all direction to the device under test (DUT). Moreover the build up cost of this chamber is cheaper than SAC type. However MSC chamber is still under heavy research, hence it is not commonly used.

vertical stirrer

horizontal stirrer, near to the ceiling

a remoted plane was placed on a metal test table in the mode-stirred chamber (demo purpose)

Besides this, we also visited a smaller semi-aechoic chamber which filled with different type of absorber.

closure look on the absorber.

photo taking again :p


The alternative test room is to use this shielded enclosure room, which is less costly. But this room is a bit too small, just for demonstration purpose.

Tuesday, October 06, 2009

Superman Finds an Easier Way to Fly

Part 1 and part 2 of "Superman Finds an Easier Way to Fly". Will you behave as like him?


Part I



Part II