Wednesday, April 25, 2012

Peak detection in matlab


A great function for peak detection in matlab is the peakfinder (downloadable at http://www.mathworks.com/matlabcentral/fileexchange/25500). Here's a set of super basic instructions regarding how to use this function (for people with little experience with matlab):

Setting up peakfinder

  1. Download the peakfinder package from the link above. extract/unzip the folder and put it in a folder under your matlab path
  2. In matlab, add the peakfinder folder to path (file -> set path, click on set path, select the peakfinder folder by browsing, click on save, then click on close)


Using peak finder
Assuming your signal is already in the matlab workspace called x, to find the peaks using peakfinder, type in the following in the matlab command window:

[peaks, locs] = findpeaks(x)

This would result in two vectors:

peaks = [# # # # # ... ] <-- indicates all the peaks that are found in x
locs = [# # # # # ...] <-- indicates all the locations/positions of the found peaks

To examine the peaks found using this setting, you can type in the following:

plot(x);
hold on;
plot(locs,peaks,'o','MarkerEdgeColor','r')

More functions/setting can be consulted through typing 'help peakfinder' in the matlab command window.

Labels: , ,

Monday, February 13, 2012

不能說的秘密 the untold secret


作詞:方文山
作曲:周杰倫

冷咖啡離開了杯墊
the cold coffee had left the coster
我忍住的情緒在很後面
my repressed feelings were kept way in the back
拼命想挽回的從前
the past i tried everything to recover
在我臉上依舊清晰可見
was still vivid on my face

最美的不是下雨天
the most beautiful was not the rain
是曾與你躲過雨的屋簷
but rather the roof under which we were sheltered together
回憶的畫面 在盪著鞦韆
the scenes in the memories were oscillating on the swing
夢開始不甜
the dream started to lose its sweetness

你說把愛漸漸放下會走更遠
you said we would walk farther by slowly letting love go
又何必去改變 已錯過的時間
no need to alter the time that had already been missed
你用你的指尖阻止我說再見
your fingertip stopped me from saying goodbye
想像你在身邊 在完全失去之前
i tried to fancy you to be by my side, before losing you completely

你說把愛漸漸放下會走更遠
you said we would walk farther by slowly letting love go
或許命運的籤 只讓我們遇見
perhaps we were the only ones to encounter the wheel of fortune
只讓我們相戀 這一季的秋天
we were the only ones to fall in love, in this season of autumn
飄落後才發現 這幸福的碎片
realized only after they had scattered and fallen, the pieces of our past happiness
要我怎麼撿
no means for me to pick them up

Labels:

Tuesday, January 31, 2012

秋凉 autumn chill

http://www.tudou.com/programs/view/8ezOYRo6F0g/?FR=LIAN

词曲:曹方

秋凉 偶然想起
autumn chill, remembered occasionally
诗篇满天 落叶满地 保持距离
the sky covered in poems, the ground covered in leafs, keep a distance
秋凉 一个世纪
autumn chill, an entire century
两个世界 面对自己 失去感觉
two worlds, facing oneself, losing feelings

秋凉 独自疯狂
autumn chill, being crazy alone
会到这里 没有重点 无法继续
back to this place, there was no point, failed to carry on
秋凉 绿茶的香
autumn chill, the aroma of green tea
你变了样 我们逃脱 不要去想
you'd changed, we'd escaped, stop thinking

我也觉得迷惘
as well i felt confused
青春像一座山背负一路感伤
the youth was like a mountain, burdened by a long trail of melancholy
我也觉得有些失望
as well i felt disappointed
我也觉得希望
as well i felt hope
春天夏天秋天冬天会不一样
the four seasons would be different
我也觉得有点阳光
as well i felt the ray of sunlight
我们总要坚强 别紧张
we need to be strong, don't get nervous
就算现在秋凉
despite the autumn chill

秋凉 梦的衣裳
autumn chill, the clothing of dreams
没用勇气 没有力气 告别假想
no courage, no strength, stopped hypothesizing
秋凉 季节变换
autumn chills, the change of seasons
点了只烟 灭了知觉 不要去想
a cigarette lighted, the perception extinguished, stop thinking

我也觉得迷惘
as well i felt confused
青春像一座山背负一路感伤
the youth was like a mountain, burdened by a long trail of melancholy
我也觉得有些失望
as well i felt disappointed
我也觉得希望
as well i felt hope
春天夏天秋天冬天会不一样
the four seasons would be different
我也觉得有点阳光
as well i felt the ray of sunlight
我们总要坚强 别紧张
we need to be strong, don't get nervous
就算现在秋凉
despite the autumn chill


秋凉 季节变换
autumn chills, the change of seasons
点了只烟 灭了知觉 不要去想
a cigarette lighted, the perception extinguished, stop thinking
我也觉得有些失望
as well i felt disappointed
我也觉得希望
as well i felt hope
春天夏天秋天冬天会不一样
the four seasons would be different
我也觉得有点阳光
as well i felt the ray of sunlight
我们总要坚强 
we need to be strong
我们总要坚强 
we need to be strong



我们总要坚强 
we need to be strong



Labels: , ,

Saturday, January 28, 2012

微涼的你 the chill you


作詞:陳綺貞 • 作曲:林暐哲 • 編曲:林暐哲

迎著微微的風 像微微的你
catching the mild breeze, like the mild you
在我不經意的時候掀起一陣漣漪
it stirred ripples while i wasn't paying attention
躲著涼涼的雨 像涼涼的你
hiding from the cool drizzle, like the cool you
偶爾捎來消息
it occasionally brought along some news
將我整天灼熱的思緒撫平
that calmed down my heated thoughts
在夜裡 在黎明
in the night, and in the morning
融化我凝結的心
melting away my congealed heart

擁抱一陣微涼的風
embracing a fist of chill breeze
心的空隙任你來去
letting you freely come and go from the spaces in my heart
我睜大了眼睛
i opened my eyes wide
找尋不到你
only to fail at finding you

飄散的髮留住了你
you stayed to catch my blown hair
微笑的臉卻來不及溫習你的吻
yet there was not enough time for my smile to review your kisses
回憶才是你唯一的痕跡
memory was your only trace

Labels: , ,

Friday, January 27, 2012

雨天的尾巴 the tail of a rainy day


詞:陳綺貞 作曲:陳綺貞 演唱:陳綺貞

雨天的手牽著你的衣袖
the hand of a rainy day was holding your sleeve
雨天的溫柔總是選錯擁擠時候
the tenderness of a rainy day always wrongly picked a crowded time
雨天的小指頭騷動我虛有的鄉愁
the pinky of a rainy day tickled my decorative melancholy
雨天的尾巴讓夕陽牽著走
the tail of a rainy day was taken by the sunset

春天的手拍一拍曬乾的枕頭
the hand of spring patted the sun-dried pillows
夏天的溫柔躲在你的畫框不走
the tenderness of summer took shelter in the frame of your painting
秋天的小指頭點亮了小鎮的燈火
the pinky of autumn sparked all the lights in a small town
冬天的尾巴摩擦愛人的雙手
the tail of winter rubbed the hands of lovers

雨天的手啊牽著你的衣袖
the hand of a rainy day was holding your sleeve
雨天的溫柔總是選錯擁擠街頭
the tenderness of a rainy day always picked the wrong crowded streets
雨天的小指頭騷動我虛有的鄉愁
the pinky of a rainy day tickled my decorative melancholy
雨天的尾巴拍打浪花一朵朵
the tail of a rainy day whipped and splashed the waves
雨天的尾巴讓夕陽牽著走
the tail of a rainy day was taken by the sunset
我的青春是否 你也牽著走
was it my youth that was taken by you as well

Labels: , ,

Tuesday, January 24, 2012

只願為你守著約 wish only to keep my promises for you


作曲: 黃舒駿 • 填詞: 黃舒駿

我沒有感覺 除了等你 我的心如止水
I have no feelings, other than waiting for you, my heart is like still water
我痴心守約 不願更改一點點 
whole-heartedly keeping my promise, i'm unwilling to change a thing

是什麼世界 還有我們這般遙遠的苦戀
what kind of a world exists such bloomy, distant romance like ours
我什麼不缺 只貪有你在身邊 
wanting nothing, i crave only for your company by my side

許多人在周圍 我卻從未眷戀
surrounded by many people , but i've never cared
再也沒有人像你給我 那初見顫動的感覺
no one else have given me, the feeling that trembled me when we first met

我只願為你守著約 我的心永遠那麼恬
I wish only to keep my promises for you, my heart will always stay calm
也許孤單寂寞 但心中依然無悔 也無怨
lonely perhaps, yet inside my heart, there is no regrets, no complaints

我只願為你守著約 我的心從沒有走遠
I wish only to keep my promises for you, my heart has never gone far
不管陰晴圓缺 不管時間空間 
through the alternating phases of the moon, through time and space
一生都不會改變
this won't change as long as i shall live
再長的路 縱然距離遙遠 我能穿越
however long the road, however far the distance, I will get through

想念著你的笑 我忍不住流淚
ruminating on your smile, I could no longer hold my tears
再也沒有人比我瞭解 那愛得堅決的滋味
no one understands better than I do, the taste of a stubborn love

Labels: , ,

Sunday, January 22, 2012

奈何 nevertheless


作曲: 李達濤 • 填詞: 李達濤 • 監製: Alvin Leong

有緣相聚 又何必常相欺 
when the karma brings us to together, there's no need for deception
到無緣時分離 又何必常相憶
when the karma takes us apart, there's no need for reminiscing
我心裏有的只是一個你 
all i have on my heart is just you
你心裏沒有我 又何必在一起
if i'm not on your heart, there's no need for us to be together

今天說要忘了你 
said that I was going to forget you one day
明天卻又想起你
yet you sneaked up in my memory the next day
念你念你在夢裏 
keep missing you in my dreams
問此情何時已
wonder when this feeling would end

Labels: , ,