2012年11月13日 星期二

1114-…

雖然跟那阿姨說我是上禮拜一打電話的張同學,但阿姨很清楚地記得這件事,並馬上說我知道我知道。這讓我遲疑的心和認為她應該需要一些時間思考的想法瞬間消滅。彷彿不過是昨日過往的電話。不過要知道,這幾天當中所經過無數陡峭的山壁和嚴峻的峽谷,是無法用一個禮拜這樣的說詞來帶過。這使得我感覺這一切都已經過了許久許久。而當被逼到極點的時候,夢見熟悉的故人時,哎~ 就像從谷底中遇見了光明一般,遇見了思念了許久的光...。想當年與他們一起的時光,好像天空中的浮雲一般,抓不得又迅速消逝。大學學歷結束進到了新的階段後,往日的生活方式一併被重組。身邊的朋友一個一個被安排到不同的生活圈,更不用說相處時間有多少的簡短。那阿姨是唯一喚醒我當年和故人一起相處時光的記憶(只因曾經在那裏投宿過)。「所以我們就沒有在那裏住囉…」「沒關係…」阿姨說。我接著說:「我還是會到你那裏玩玩」阿姨說:「好的,有空就盡量來喔!」於是我們結束了這段對話。

2012年8月7日 星期二

[觀察] old song once more 老歌重現

某年某月(2012-03-28)我們參加了一場某某比賽,選定了一首很傳奇的詩歌。
就是下面這首:

美麗的夜裡

曲風定位在bossa nova,而裡面的許多元素也不會很陌生。只是對於現代詩歌來說,這樣的創作模型似乎比較少見,而且一旦出現了之後,或許就無法再copy一樣的模型。但是這樣的經典模型讓我感到非常地熟悉,似乎可能也許是從哪裡得到了靈感而創作出來的。但是這種曲風已經不少見了,因為bossa nova的曲風範圍也不小,而這種曲風算是國人較喜歡較能接受的。

某一天(2012-8-8),我在youtube打下關鍵字"old pop songs",第一個出現的影片("In The Night When We Are Together"),上面有Korean等字樣,我始終不想點進去,但是徘徊一陣子之後還是點進去了。影片開始用古典吉他做前奏,再來慢慢帶入bossa nova的和絃。其實我已經有感覺了,直到彈奏者開始唱的時候,我馬上翻出上面那首「美麗的夜裡」。我不是想要批評,就姑且當作是"In The Night When We Are Together"的「改良版」。的確,「美麗的夜裡」這首帶有力量,不過他已經不是原始的創作模型。

In The Night When We Are Together

後者這首弦律沒有那麼甜,並沒有太大的吸引力,而我也不想對這首做太多評論。只是覺得,現在的音樂創作人可能快沒有靈感了。

2012年7月30日 星期一

[724] Wavelet transform in Python

I was recently finished the job that making the wavelet transform (2dwavelet97lift.py) appliable for any size and any aspect ratio of images. Before that, of course, I’ve spent much time for understading basics of descrete wavelet transformation. Using the sample code of CDF 9/7 Discrete Wavelet Transform which the file named “2dwavelet97lift.py”. Indeed, it is a 2D wavelet transform but only for square image and the length must be 23 while it does 3 level transform. My job is split the 2D transform into two 1D transform while its 2D transform transpose the image two times which only works on square image. This can solve the problem and be applied for any aspect ratio of images. Let’s see the result of sample image which in size of 1600x1000.

2d_a1 original image

2d_a1_fwt image after fwt

2d_a1_iwt image after iwt

How about the other problem? In this, I use a stupid but really working way: resize it! Resize to what size? It depends on the level of transformation. We can resize the length of the image to the multiplication of (2 << level) and must larger than the original.

You can download the sample program here.
Python 2.7 and PIL are required to be installed.
Click the cmd file to run and you can also edit the parameters:
  pyc_filename [image_filename] [transform_level]

2012年6月29日 星期五

[624][629] JPEG in DCT vs DWT

 

在6/24只花兩三天完成的JPEG in DCT

花了兩天完成的jpeg壓縮

並沒有進行包裝,
只有進行 DCT –> quantization –> dequantization –> IDFT 這些步驟而已。
使用的quantization table為:

16  11  10  16  24   40   51   61  
12  12  14  19  26   58   60   55  
14  13  16  24  40   57   69   56  
14  17  22  29  51   87   80   62  
18  22  37  56  68   109  103  77  
24  35  55  64  81   104  113  92  
49  64  78  87  103  121  120  101 
72  92  95  98  112  100  103  99  

而新出的JPEG2000則是使用DWT來進行轉換,
據說可以達到良好的壓縮效果以及品質。
於是我使用discrete biorthogonal CDF 9/7 wavelet transform內的程式碼
來做個實驗,只將DCT調換成DWT。

結果比較如下圖(上為DCT,下為DWT):

DCT_vs_DWT

放大來比較(上為DCT,下為DWT),可見DWT明顯出現方格條紋。

DCT_vs_DWT

實驗結果如果用以下步驟:

DWT –> quantization –> dequantization –> IDWT

其效果不甚理想,可見JPEG2000仍隱藏一些奧秘在裡頭。

2012年5月13日 星期日

台北清真寺一日遊

有幸被一位領袖請到了裡面講解有關XXX(保密)的說明。
這可是我第一次看到台灣的回教徒,且正要上前做禮拜。
女生都包著頭巾,真的讓我有點地區混淆的感覺。
我到底是不是在台灣?

IMG1104
IMG1105
IMG1106
IMG1107

我們可以看到在禮拜天的早上,
每個小朋友和青少年都背著書包去做禮拜。
就像我小時候在印尼所見小朋友背著書包上主日學一樣,
這幾乎要騙倒我的感覺了。

因為不是很了解能不能拍照,所以我就偷偷地偷拍。

IMG1116
這些都是台灣人,但我們要幫忙的是外勞。

因為電腦需要充電,於是有人把我帶進了主堂。
我又繼續偷拍。。。

IMG1118
IMG1126
這是他們一天當中需要禱告的五個時間,最左邊不算。
在印尼這是沒有人不知道的,
在印尼的清真寺在這五個時間都會用廣播頌唱禱告詞。
到底聽起來如何呢?
我們等會兒瞧瞧。

IMG1139
傳說中的圓頂結構

IMG1140
印尼的禮拜開始了,我又繼續偷拍。。。
(ps. 因為要一起處理公務,我坐在女士區,
       對面才是男士區,但有個台灣老頭卻也坐在這裡)
IMG1141
這老頭也在拍,我於是明目張膽地繼續拍(和偷拍他)。

IMG1142
我在處理公務沒錯啊!

IMG1144
這台一定是台灣的邦交大使的坐駕。
那裏也有一些來自非洲的外籍人士。

對了,他們禱告的時候是這樣的:

2012年4月24日 星期二

冷凍食品

心血來潮(其實是懶得煮)買了些這樣的東西:

IMG024

因為沒微波爐,所以就想打開來考。
結果一打開來,是一塊冰淇淋!!!

IMG025

390克有多多呢?
這麼多:

2012-04-24-001

2012年4月11日 星期三

課後

下課後的黃昏,同學們瞬間吵雜的聲響劃破了課間的寧靜。
而我,卻為此感到沉重。
走到實驗室門口,人們紛紛交出手上的作業。
忽然一個詢問,讓我出手幫了一下忙。
「那個......作業什麼時候交啊?」
「我來去問問助教。」
事情辦完後一瞬間的分離,更讓沉重更下一層。
走進車棚思考著之後要如何打發沒心情的時間,
只因心中的不捨而感到似乎該留下來去辦些什麼事。
到了家(另一個),頭腳衝了涼水,感到稍微舒適的心情,
便感嘆,那些算什麼。
我們還有明天的。

2012年3月22日 星期四

2012年3月20日 星期二

[321程式] C版的explode() 函式–explode() in C

/*

* explode function like in PHP (realloc version)

* completed in 2012/3/21

* since 2012/3/21

*/

#include <stdio.h>

#include <stdlib.h>

#include <string.h>

 

char **explode(const char *del, const char *src, int *size);

 

int main(int argc, char *argv[]) {

     char *str = "We will we will rock you!";

     char **new_str;

     int i, len;

 

     printf("The original str: %s\n", str);

     new_str = explode("* ", str, &len);

     printf("The length: %d\n", len);

     printf("After explode:\n");

     for(i = 0; i < len; i++){

         printf("%s\n", new_str[i]);

     }

 

     system("pause");

 

     return 0;

}

 

char **explode(const char *del, const char *src, int *size) {

     int i = 0;

     int idx_del;

     int idx_src = 0;

     int num_token = 0;

     int last_pos = 0;

     char **des = NULL;

 

     // get the token and doing explode

     while(*(src+idx_src) != '\0') {

         idx_del = 0;

         while(*(del+idx_del) != '\0') {

              if(*(src+idx_src) == *(del+idx_del)){

                  // increase the num of token

                  num_token++;

                  // re-allocate the space for 'des'

                  des = (char**)realloc(des, (num_token)*sizeof(char*));

                  // allocate in real time for the new string

                  des[i] = (char*)malloc((idx_src-last_pos+1)*sizeof(char));

                  // put the 'end of string' in the last item

                  des[i][idx_src-last_pos] = '\0';

                  // copy the specific section to be the new string

                  strncpy(des[i++], src+last_pos, idx_src-last_pos);

                  // record the position for the next new string

                  last_pos = idx_src+1;

                  // exit the current loop

                  break;

              }

              idx_del++;

         }

         idx_src++;

     }

     num_token += 1;

     // assign the num of token to the variable from outside

     *size = num_token;

 

     // don't forget the last one if there is

     des[num_token-1] = (char*)malloc((idx_src-last_pos+1)*sizeof(char));

     des[num_token-1][idx_src-last_pos] = '\0';

     strncpy(des[num_token-1], src+last_pos, idx_src-last_pos);

 

     return des;

}

2012年2月28日 星期二

[228事件] 吉他換弦了!

是D’Addario的,85/15 American Bronze。
但不知道是light的還是extra light的。

IMG_7143

IMG_7144

弦是這天(2/26)斷的:

IMG_7084

2012年2月10日 星期五

我的九型人格分析(180題)結果

九型人格分析
第四型藝術型、浪漫者、自我型、憑感覺者
21%
第五型智慧型、觀察者、思想型、理性分析者、思考型
16%
第六型忠誠型、忠誠型、尋找安全者、謹慎型
16%
第一型完美主義者、完美型、改革者、改進型、秩序大使
15%
第二型助人者、全愛型、助人型、成就他人者、博愛型
10%
第九型和平型、和平者、和諧型、維持和諧者
8%
第八型領袖型、能力型、挑戰者、保護者、權威型
7%
第七型快樂主義型、豐富型、活躍型、創造可能者、享樂型
4%
第三型成就者、事業型、成就型、實踐型
3%

2021年11月 6N6P真空管耳擴

  今年某月看到下面這位大大的貼文就想造出來一台真空管耳擴。 OTL WCF headphone amp build + awesome prototype material 從規劃製作、蒐集元件到動手製作前前後後大約花了三個月吧! 真正動手組裝大概是11月初的事情,短短一兩的禮...