Lair Of The Multimedia Guru

2015-01-06

WordPress spam filters

Many years ago the spamfilter i used for this blog was spam karma 2, it was free, it worked and it worked well. Sadly it hasnt been maintained or updated by anyone since a really long time, which did not improve its ability to keep spams away as spambots and spammers evolved. Also with each update of wordpress it started falling apart more until finally with the update to 4.1 spam karma 2 stoped working, assinging every spam a large positive karma value
So i enabled akismet and bad behavior which where already installed. If anyone has difficulty posting a comment due to them, please email me and ill try to look into it.

Filed under: Uncategorized — Michael @ 01:54

2008-12-11

Love, death and a bunch of stalkers

Following is a true story of various odd events the happened a few years ago in my life, taken alone most and especially the begin would not be worth mentioning or writing about but together they might be.

Introduction, the begin until autumn 2003

I guess most people have someone who is important to them or who they love. In my case its Nadja, we’ve been in the same class in school which was indeed a long time ago. Somehow our paths parted, i always wanted to call her, but i didnt, and neither did she, nor have i heared anything from or about her, and neither did i ask. Well why should i have asked, iam not the kind that sniffs behind peoples backs about their lives, i always hated it when my mother did and wouldnt want to be treating others that way. Not that i had much contact to anyone i could have easily asked …

summer/autumn 2003

I was still living with my mother in her appartment, my father had bought his own appartment and left (IIRC) a year or so earlier. Without my father around, i was the only one left for my mother to talk to/blame/annoy. Now dont misunderstand me, my mother isnt evil (hmm or maybe she is ;) but i simply couldnt stand it anymore and left too. I also had a strange feeling that something wasnt right with Nadja … Being in my new appartment and not having my mother stand behind me all day long, i finally called Nadja, i still had the number from school time, to my dismay the number did not work. And to make it worse the phone company also had noone in their lists with a matching family name and street address, and that includes people that arent listed in the public phone book. Internet search engines also where a dead end, like they had been in previous years when i tried to find an email address of her. Being not too lucky with finding anything, i thought, “my phone number is in the phone book, my email is easy to find, if Nadja needs something she could find me easily…”, not that i was too happy about it but for whatever reason i temporarly gave up searching her. There where also many other things to do in my new appartment and my feeling that something was wrong, well i couldnt have known, i had to be imagining things.

2004

I think it was spring, though i cant say that for certain, i was on my way to the supermarket around the corner, when i run into my grandmother. What was she doing here i wondered, well she told me that my other grandmother called her and said that my stove was broken and i couldnt make tea so she wanted to bring me a electrical heater plate thingy so i could make tee. Well, my stove wasnt broken and i didnt call either of my grandmothers. This thing left all of us a little puzzled, it seems someone with a male and young voice called my grandmother (the one from my fathers side) and pretended to be me (her phone number was in the phone book), telling her the story of a broken stove and tea, she didnt know the address of my new appartment so she called my mother and as she didnt reach her my other grandmother who then came to help.

2005.02.16 17:53 my phone rings …

IIRC the person said something like the following (in german)
“Iam [cant remember] from kurier, daily newpaper, could i speak with [name of my mother]”
I think for a moment and then tell him that, iam sorry but i do not know anyone by that name. He accepts that though apparently not very happily and we hang up. Not too surprissingly noone from “kurier” which actually is a pretty large newspaper here ever calls my mother.

2005.03.05

It wouldnt be worth mentioning, where it not in relation to the following events, not that the other things at the begin of 2005 would be, but on this day mike melanson told me a little joke by email, something like “After the conference Diego, myself and the other multimedia hackers in attendance will coordinate an austrian road trip and locate you and see what happens when you are exposed to sunshine :)”
this was in relpy to myself declining the suggestion to meet everyone at linuxtag.

2005.03.29 9:36 another odd phone call

Some female claiming to be from lotto and wanting to speak with “frau michael niedermayer”, i mildly enraged tell her “herr niedermayer”, not too successfull she continues with calling me “frau michael niedermayer” which is somethinbg like “mrs./miss michael niedermayer” so i hang up. It has to be noted that she had no odd dialect and thus likely could speak german well enough to know the difference. According to my notes her phone number was “+43 6648194927”
Besides these calls, there was no lack of others who wanted to just ask a few questions for various statistics, and interviews in 2005.

2005 march or april

As iam on my way home from supermarket, some guy in the street where my appartment is maybe he was 20-30 years old, wearing shorts. He said “Wast du schon an der sonne” which in english means “did you where already in the sun”. I ignored him and kept walking.
After that ive seen him many times sitting in the park, though never with a notebook or other normal hacker toy. Its also interresting to note that the last time ive seen him in the park was not too long prior to the next odd event.
(also neither diego nor mike look like him nor could they explain it when i asked)

2005.06.02 evening maybe 20-21 o clock

I was in the park, spoke there on my mobile with my mother and then went home, on the way home, someone (female vioce) called “michi” from behind, not recognizing the voice nor expecting anyone I ignored it, the person didnt call a second time that day. 2 Days later same place same time, i was waiting for the traffic light to turn green when i spotted 2 girls diagonally across the crossroads, i didnt recognize either of them, though lets call them girl A and B for the sake of referring to them. The light turtned green and a little while after they where behind and out of sight someone from their direction called “niedermayer”, for some reason i ignored it, they didnt call again.
In the following 2 and a half months ive run across girl A (or at least i think it was her) several dozen times at random places. She always starred at me as if iam supposed to know her but i apparently didnt, at least i didnt recognize her. She was wearing something like jeans, tshirt and green sport shoes. I was thinking it must be someone from my school class, but i simply couldnt match her up with anyone, either way it wasnt Nadja so i really didnt care who she was or what she wanted, especially as she could have said what she wanted instead of just staring and IIRC once saying “hello”, well this reasoning shall turn out to have been possibly too naive.

2005.07.23 16-17 o clock

As i walk home, just as iam entering the house, a guy maybe 10 meters before me on the street takes a photo of me, he appeared nervous, theres also nothing there, not even a trashcan that would be worthy of a picture.

2005.08.24

As iam waiting at mc donalds for my 2 cheesburgers, someone to my right a few meters away is called by the name Nadja several times, she is or looks like girl B wearing a long black dress. She does remind me of someone from my school class but not Nadja, she doesnt look into my direction but the look on her face makes it very obvious that she is feeling very uncomfortable almost as if she wanted to do anything but being there playing Nadja which really is what she was doing. She also said no word at all.
Being somewhat confused and having received the 2 cheesburgers, i paid and left.
About 2 weeks later, again at mc donalds, as iam leaving, straight ahead along the street on its left side where a park is, i see an ambulance with blue blinking lights. I enter the park at its close corner and watch from quite some distance. I see someone looking like girl B walking together with several other people and ambulance man/doctors over the meadow to the ambulance. They dont seem to be in a hurry, neither is the ambulance after they reached it. I walk through the rest of the park and round the ambulance and then turn and walk home, the ambulance still standing at the same spot, still blinking blue.
After now seeing someone apparently knowning my name, being called Nadja and entering an ambulance i felt rather uncomfortable, that Nadja might not be ok, that i maybe didnt recognize her, I didnt really care who the weird people playing street theater where or why there where doing this, but i had to find Nadja.
The phone book, all phone companies, and google lead to nothing, but i found Marta, another one from my class, she could not explain who the weird people where but she could tell me what is with Nadja, Marta said Nadja died 2 years ago in 2003.
She did not know any details, but said that she is certain about it.
I did not want to belive this, and kept asking others i knew and ones i did not knew, as well as the official sources. Everyone who knew something confirmed that Nadja died in 2003.
Now if this was a fictional story then the death of Nadja, one of the best, most honest, righteous and selfless people i knew, would be the end. She was not the kind that pretended to be good while doing evil things, rather the opposite. Besides she is/was the most important one in my life. But reality is cold and mercyless, so the story cannot end here yet …
More weird people appear and watch me, they follow me around, watch what i buy in the supermarket, where i walk to, …

2005.10.04

As iam on my way from the supermarket to my appartment, as i enter the house, seconds after passing a male thin guy, he behind me, says “niedermayer comes now” (in german).
I quickly rush to my appartment, but find nothing touched except maybe a chest of drawers moved a little, its top drawer is rather hard to move without moving the whole thing …

2005.10.05 15:30-16:30

I buy a more secure lock and exchange the old against it.

2005.10.07 7:00

My doorbell rings, iam in bed, sleeping. Tired i put on some clothes and stumble to the door. After opening it, i see a not too big guy with a woolen cap/hood. He very politely asks if he woke me, theres a somehow wicked smile on his face. He says he is searching for someone with the name “altendorfer” to renovate their appartment. I tell him politely that i dont know anyone by that name. He leaves and i head back to bed.

2005.10.07 night, shortly before i want to go to bed

I walk by the entrance door of my appartment, noticing to my dismay that it is partly disassembled, more precissely the little hole with lenses through which you can look out is nicely taken appart and the metal plate in whichs center it is is very loose, to the point that there is a 10cm long and narrow hole one can look straight through to the outside, it was too narrow to stick ones finger through but a thick wire easily would have. To my further dismay both my keys and the security card needed to get replacement keys officially where placed at spots somewhat different from where i put them. The keys where hanging where the coats are hanging, though one was standing out straight horizontally from the keyring, a thing practically impossible to happen were they hanged there normally, but someone trying to be silent who was trying to return a single key quickly might very well place it like that.
The card, it was before and afterwards in my wallet, but now it was standing out, before, i had it sticked in as deep as possible as i knew i would not need it any time soon. Did i lock the door? When i was away: always, when i was at home: never.
Realizing that whoever was it, was long gone, i decided to block the door and go to sleep (a surely unwise choice, like never locking the door when i was at home …)
Next day in the morning i call the police, one of them, he looks like the average not too bright varity appears, he writes everything down, though as no real damage has been done and nothing stolen his interrest is low. he refuses to attempt to take fingerprints of the door pretending it was not possible to take fingerprints of smooth surfaces. I later file a complaint about this.

2005.10.09

A sunday, being convinced that someone could have made a duplicate key to my appartment, i replace the lock again, thanks here go to my mother for buying a lock and bringing it to me on a sunday where most shops are closed.

2005.10.15

I meet attila kinali, he having heared from all the mess here, jumped on a train to visit me. My appartment being a mess, ive offered/made no food for him. I was still far too confused about nadjas death to treat guests properly …

2005.10.16 9:00

My mother tells me that someone has broken in, in my fathers office, his replacement keys, portable phone, a cammera, a harddisk and some money of a colleague has been stolen.

2005 exact day unknown

It is late in the evening, i go out for a walk, its dark, the ground is littered with fallen leafes. There are no people on the street except that every time i walk through some leafes a little while later i hear footsteps behind me stepping into leafes as well. I see no shadow from him, its clear he keeps enough distance not to cast any shadow too far ahead. I walk for maybe half an hour with him following me all the time, until i try to discreetly look back at a crossroads, but i was not discreet enough, he turns around and walks away at that very crossroads.
On many other days similar things happen, most of the time though there are several guys that switch positions, also they often waited at a future crossroads instead of litterally following behind.

2005 exact day unknown

I hear noises at the my appartments entrance door, as if someone was trying to open it. Walking there and looking through the repaired peep hole thingy, i only see someones back standing bend over in front. My first thought was that its some old neighbor or a relative of one who went to the wrong floor, but then a few moments later i decide to double check this, but too late, when i look again he is gone.
Gone far too quick and silent for an old neighbor …

2005.11.08 15:00

The doorbell from the house door rings, i pick up the receiver and say “yes”, the awnser “police”. I press the open button, moments later 2 policemen, they dont look like the average dumb varity stand before me. They tell me that they came because of the break in a month ago. They ask many questions, look in all rooms, and listen to the various things i remember. They suspect that my mother is behind things.

2005 unknown day

I talk with my mother on the phone, and tell her that the guys watching/stalking me are always starring at me. Next day i find several people standing with their backs toward me standing at various points along the way i normally walk. They where quite noticeably starring in the air in random other directions …

2005 unknown day

I decide to do various random things and see how they react …

2005.11.17 17:00

Iam on my way to a large shop (baumax), just before the shop i run into my grandmother (from my fathers side) she tries to convince me to come to her house. I decline explaining that it is too cold at her house and the shop is heated. She accepts that and leaves.
I buy a rope and one of these stick with a rubber pump thingies to clean the drain of a wasching basin, whatever its called in englisha plunger, so i have a seperate one for my bathroom and toilet. After i leave, while waiting for the traffic light to turn green so i could cross the street to reach the tram, someone behind me says “Nadja hat ihren job verlohren, die mussten eben den headcount reduzieren” (in english, “nadja lost her job, they just had to reduce the headcount”). I turn around but there where too many people to identify who said that.

2005 end november begin december

For the duration of a week or 2 they follow me around missing no day, i always favored one supermarket during that time, at the end i see a couple in that supermarket, the woman i suspect was supposed to look like Nadja, she had similar “Ausstrahlung” (someone translate this to english)aura like Nadja. She also had thick hands, and i mean not that she was thick or her arms, just the hands, Nadja did not had thick hands. I guess its hard to find people looking like Nadja that are willing to play street theater. I guess they where also supposed to do something but they didnt, he just said a word or 2 to her, maybe something like “Lets leave” but i dont remember exactly. After that i notice fewer people watching/following me around. This could of course also have been a coincidence but its odd why they followed me around so carefully for 1-2 weeks and then just stopped.

2005 12.13

I send nadjas mother a letter, hoping she would tell me something else than that Nadja is dead and hoping that maybe she has a clue who is behind that group following me around.
I didnt sent the letter sooner as several people like marta told me by email that i should leave nadjas mother alone and not ask.

2005.12.14 10-11 o clock

The bell from the house door rings, i get out of bed stumble to the door, expecting the postman (there was a packet i was waiting for), i pick up the receiver and say “yes”, and wait, but noone awnsers, so i press the door open button anyway. A little later i realize it might be nadjas mother and put on some clothes and walked down to check but i see noone, so i walk around the block hoping to spot someone, again no luck.

2006.01.01 10 o clock

I hear 2 woman talking a floor or 2 below me, i only catch a few phrases of the conversation, X: “… my daughter …”, Y:”… Michi … before 14-15 o clock few chances … many woman”, X:”MANY WOMAN?! …. is someone watching him?” Y:”A woman maybe”
X:”… frau [nadjas family name]”, After that, X left who possibly was nadjas mother, sadly i did not realize this quick enough. Who was Y? i dont know, Why was nadjas mother talking with a neighbor of mine instead of me? i neither know that.

2006.01.11

The doorbell rings, its the postman, bringing back my letter that i sent to nadjas mother, unopened, it seems it was laying at the post office and nadjas mother did not take it from the postman or was not at home nor picked it up from the post office after that.

2006.01.16

Not having heared anything from any neighbor yet about the whole, i go through the ones likely knowing and ask, its clear my suspicion is correct but they pretend not to know who had talked with nadjas mother, just trying to explain how she confused a few people who where looking at an appartment to rent at the floor above me with many woman coming to me. (and iam sure none of the ones i directly spoke with was Y)

somewhen 2006

Having heared various stories from members of my family and people from my class about other school comrades who died, i realize that alot more young people die than i would have guessed. So i decide to write a will, just in case …
Making sure my grave would be close to nadjas and not too close to people of my family (nothing against them but its called rest in peace for a reason). And that my computer stuff would end in the hands of some FOSS people. As well as for the very unlikely case that Nadja still is alive that she would get everything, not that i have much …

2007.07.19

I receive an SMS
Its text is: “Happy birthday ALLES GUTE ZUM GEBURTSTAG wünschen Tanja und Mädels”
in english litterally: “Happy birthday everything good for (your) birthday wish tanja and girls”
Whats special on this, well its the day nadja died, exactly 4 years before. I also should mention that i have fewer SMS than i have fingers on one hand if i dont count advertisements and stuff from people i know. And its of course not even close to my birthday.

Short of that and a few other oddities, things normallized with the end of 2005. Comparing things its like counting oddities per week or day in 2005 while afterwards it was rather per month or year. So they are either gone or worked more discreetly after 2005.

Also note, the list of events above is intentionally not complete lacking things that iam sure are unrelated to the group following me around as well as a few things to prevent them from knowing what i missed.

How did Nadja die? There are many contradicting rumors, and after excluding what is clearly false, that whats left still leaves an accident, suicide and murder open. I dont belive it was an accident, she would have had to be stupid or unlucky, but she was very intelligent, but then i cant exclude that it might have been an accident. And iam certain it was not suicide, also noone suggested to me that it might have been suicide.

Who where the poeple following me around? Ultimately i do not know, at the top of the list though are private investigators hired by the copyright mafiaa, if it wasnt them some parts could be explained by 2 girls from my class and an unknown 3rd person hireing some private investigators. That 3rd person could be one of my parents, someone who knew nadja or some woman interrested in the ffmpeg maintainer. Motives could have been from just annoying me to finding information about me or Nadja.
Good arguments exist against most, it appears the person had difficulty identifying me at first, that would exclude my parents. But then its possible that not all events were caused by the same people …
Someone wanting to find information about nadja would have just asked, maybe pretending to be someone else than she was, but they wouldnt have done this kind of theater, the whole was just too much work for the return of no information at all, actually this text likely would tell such a person more than what they found out by their activity
Someone wanting to annoy/terrorize me really could have done more than the street theater they played, but then maybe it is hard to find people doing that “harder” kind of activity when one lacks contacts to the real mafia.
Gathering informatiuon about me, well i guess they did, not too much correct information once i realized that there are not just 1-2 girls from my class who i failed to recognize but even wrong information is information i guess

Note, if you send me any questions or comments by email, GPG encrypted&signed is strongly preferred!

Filed under: Uncategorized — Michael @ 16:46

Coverity

Its a little while ago that i made that screenshot, anyway, i thought its funny so iam posting it here

Filed under: Uncategorized — Michael @ 15:51

2007-09-26

Spam karma2

As you certainly have (not) noticed, ive enabled spam karma2, mike melanson worked hard on installing a few anti spam plugins for me, spam karma2 being one of them. thanks mike!

Until now spam was stoped by a simple word list and anything containing a link was as well blocked. On my side procmail sorted the large amount of moderated comments into certain spams and uncertain as well as non spam comments i then from time to time deleted spams which where missed and approved what was blocked incorrectly. That worked quite well actually … but you know if it aint broken then break it ;)

Spam karma2 should hopefully catch all spams and not block legitimate comments ;) It even has the ability to display a captcha if its not certain, just an hour ago it did that for a spamer who tried to sell some “herbs” for long “legs” it didnt help though i had to delete that by hand after the spamer or his script passed the captcha check

If you write a comment and it gets blocked with no captcha or other tests then please send me an email!

Comments welcome!

Filed under: Uncategorized — Michael @ 21:10

2007-09-02

Googles summer of code 2007

The company which tries so hard not to be evil, has this year again payed students, 900 according to wikipedia to work on free software. 8 of them worked on ffmpeg this year, luckily the results are less disasterous than last year where half the 5 students which where supposed to work on ffmpeg plain dissapeared, and just reapeared before the deadline to convince us that they where almost finished with everything so as to get payed …

But lets rather talk about this years SOC, first there where 19 students, submitting 37 applications about ffmpeg. To rate these 37 applications and to prevent the high failure rate of last year, we required students to do a qualification task, that is they had to make a not too insignificant contribution to ffmpeg to be accepted. What exactly they did was pretty much their decission though there was a list of suggestions. As a beautifull sideeffect of that, the qualification tasks led to some nice and new features for ffmpeg :).

9 of the 19 students submitted a qualification task, all thouse who submitted one passed, in addition 1 student was qualified through extensive past work on ffmpeg. From these 10 students, 2 sadly couldnt be accepted as they wanted to work on the same task as other students, well in principle it would have been possible to let 2 students work on the same task but it seemed silly. 1 wasnt accepted as his project appeared rather uninterresting and somewhat unrelated to video/audio. The 8th slot google provided was thus given to a student who didnt submit a qualification task. Also the actual decission of who would be accepted and who not was that of the mentors rating applications not of any single person …

So whats the current status?

  • Davids matroska muxer has passed review and should be commited to ffmpeg svn soon
  • Kostyas RV40 decoder looks pretty good and could probably be commited to ffmpeg svn soon, well actually if kosyta wanted he could commit immedeatly and continue work in ffmpeg svn
  • Marcos dirac decoder is also in good shape and theres not much keeping it from being commited, the encoder though needs more work
  • Kamils jpeg 2000 encoder and decoder, arent in good shape yet (only 2 out of 50 encoded images can be decoded by jasper, only 2 of 23 reference jpeg2k files can be decoded by kamils decoder), but then please dont forget that writing an encoder and decoder at the same time is harder then just one of the 2
  • Reynaldos QCELP decoder is missing a working postfilter, 1/4 and 1/8 decoding, so it needs more work as well
  • Bobbys avfilter is in quite good shape though its missing well working colorspace negotiation, also its missing actual integration in ffmpeg.c, only ffplay.c is there
  • Bartlomiejs EAC-3 decoder hasnt been reviewed by me yet …
  • xiaohuis mpeg-ts muxer itself also hasnt been reviewed by me yet, his patches though which where submitted and which ive reviewed need more work

I hope of course that all 8 students continue to work on their projects, free software in general and ffmpeg specifically!

Filed under: Uncategorized — Michael @ 22:55

2007-06-07

Quantization of a bunch of scalar variables

You have a few uniformly distributed independant scalar variables, how do you optimally quantize them? Simply each independantly by uniform scalar quantization, wrong this is likely to the surprise of the reader not optimal.

One way to see the suboptimality is to look at what independantly uniform scalar quantization does if we have 2 variables, it splits the plane in squares and represents all points within a square by its center. How can we do better? just split the plane in hexagons, both worst case and average quantization error decreases. The worst case for the square is 2^0.5/2=~0.7071, the worst case for the hexagon is 12^0.25/3=~0.6204

Another way to see the suboptimality is to look at the worst case point, which in case of the square lies equidistant to the centers of 4 squares but with a hexagon it just lies equidistant to 3 centers of 3 hexagons. So there are just 3 redundant ways to quantize it instead of 4

If we consider the (uniform scaler) quantization of the first variable of 2 then we can simply improve the worst case which lies exactly between 2 values of the first variable by making use of the useless least significant bit. More exactly add half a quantization step to the second variable if the first was quantized to an odd value, this interrestingly turns out to be equivalent to using hexagons for quantization, though the hexagons are a little squished here compared to the optimal case with regular hexagons

Ive also written a little test program in case anyone wants to play with this quantization stuff

Filed under: Uncategorized — Michael @ 02:28

2007-05-11

Tic Tac Toe

Java sucks, all remotely sane humans know that nowadays, but long long ago i did the unimagineable and volunteerly wrote some small java programs (until i realized how badly java sucks). Todays or actually tonights blog entry is dedicated to one of these, a little Tic-Tac-Toe game, which you should be able to see below in the unlikely case that you have java enabled in your browser


8? years old GPL source is available too, and in case you are wondering the images where created with povray, and yes patches to improve it are welcome ;)

PS: if you win send me a bugreport ;)

Filed under: Off Topic,Uncategorized — Michael @ 01:38

2007-03-25

Resampling

Resampling is the problem of converting a signal which is sampled at a given samplerate to one which is sampled at another samplerate. This is the same as converting a discretely sampled signal to a continuous one and then converting it back to a discretely sampled one.
There are many ways to look at this problem which dont lead to the same solutions

The optimization point of view

The problem can be seen as one of optimization that is choose the function which converts the discrete samples to a continous signal so that the error to the original correct signal is minimized. And then select the function which converts the continuous signal to discreet samples so that together with a optimal back conversation the error is minimzed.
While this is a nice generic definition of the problem it doesnt point to a obvious solution, also the optimal solution will almost certainly not be remotely close to a common sense definition of what samples represent, it might be more similar to a vector quantizer or other odd non linear thingy …

The linear optimization point of view

Like in the previous point we again try to find continuous->discrete->continuous convertion functions which minimize the error to the original but we restrict ourselfs to linear convolutional filters. Note continuous signal here means one which is either given analytically (like a polynom) or discretely sampled at higher resolution.
Here its a matter of linear algebra and a training set of signals to find the
optimal discrete->continuous filter for a given continuous->discrete filter. And the optimal continuous->discrete filter for a given discrete->continuous filter.
In this framework it is also possible to consider output and input devices. For example a monitor which converts the discretely sampled data into very tiny fuzzy colorfull dots, which when they are all added together give a continous signal. The monitor here is a discrete -> continuous filter for which we can find the optimal linear least squares filter which changes a given signal to a discretly sampled one.

The bandlimited point of view

Its possible to look at a amplitude per time signal also as a amplitude per frequency signal. If our signal now happens to not contain any non zero frequency component above a specific frequency X then this signal is said to be band limited. If we now sample such a signal with a sampling rate >2X then we can exactly restore the original continuous signal from these samples by simple convolution with the sinc filter (sin(x)/x) (the discrete samples here would be at x=…, -pi, 0, pi, 2pi, …).
And to remove all frequencies above a given frequency X while retaining all below again simply convolution with sinc is the awnser. So resampling becomes a simple matter of using the sinc filter with the correct scaling to find the new samples. Sadly there are a few problems and missunderstandings with this approch.

Summing a infinite number of samples fallacy

Some people say sinc cannot be used because it would require summing an infinite number of samples, this is of course not true as images and audio on computers tend not to contain infinite many samples to begin with. Or more precissely a signal of N samples can simply be converted into frequency domain with a FFT the too high frequency coefficients could then be set to 0 and then a inverese FFT could be applied. This is exactly equivalent to infinite periodic extension and application of the sinc filter. Direct applicaton of the sinc filter in time domain is trickier.

sincs latency

As the sinc filter has infinite support (theres no X after which all values are 0) it cannot be applied in realtime, it needs all input samples before it can output anything.
That also means all applications and libraries which claim to use sinc for resampling in realtime lie.

Causality and sinc

Most output samples depend on most (practically all) future input samples

Shooting sinc and the whole bandlimited theory down

Imagine absolute silence, open space, no obstacles to reflect sound and a gun, theres no doubt that the correct continuous sound amplitude will be exactly 0 (the air pressure will not change), now the gun is fired, which causes a very loud “bang” pretty much a very sharp spike in the amplitude and air pressure and then perfect silence again. Now this signal is clearly not bandlimited, so lets make it bandlimited by convolving it with sinc, the resulting signal will of course look like the sinc filter itself (convolution of a single spike is simply a identity operation). At that point we will have a bandlimited signal of a gunshot. Lets assume our signal is sampled at 8khz
in that case the amplitude 1 second before the gunshot will be 1/(pi*8000) of the loudness of the gunshot while this seems very little given a loud enough gunshot its audible and this simply isnt correct. Also for shorter distances like for example 5 samples before the gushot its 1/(pi*5) ~ 1/16 which for example when resampling an image with a sharp edge leads to terrible ringing artifacts.

Windowed sinc

An alternative to the infinite support sinc filter are windowed sinc filters, which are simply sinc componentwisely multiplied by a window function. These filers have compact support (are zero everywhere except a few samples). For them the the size of the transition band where frequencies are neither left at their amplitude nor attenuated to near 0 cannot be 0. Its size, the length of the filter the stopband attenuation and all the other parameters depend on each other and a trandeoff must be made …

Filed under: Uncategorized — Michael @ 03:50

2006-12-29

A few days ago chkrootkit told me “Enye LKM found”

My first thought was, shit …, but there was something odd, it wasnt reproduceable, subsequent runs of chkrootkit found nothing, was it just a false positive?
Also mutt had died with on odd error message, “Real-time signal 24” to be precisse, was there a relation? I decided to look at the chkrootkit source to clarify all that, i found the following:

   /* Check for Enye LKM */
   if (kill (12345, 58) >= 0)
   {
      printf("Enye LKM found\n");
      retdir+= errno;
   }

chkrootkit simply sends a “random” signal to a “random” pid, no check if anything normal is running at that pid not to mention the likelyness that a intruder would leave the pid/signal id at the default

Filed under: Uncategorized — Michael @ 23:25

2006-12-12

Hadamard transform

In the last blog entry ive mentioned the hadamard transform, so its high time to dissuss it
the hadamard transform is a linear transform, and all linear transforms can be written as a vector-matrix multiplication, here the matrix is orthogonal, symmetric and all it elements are either a or -a. Actually this is commonly written as a matrix of 1 and -1 which is multiplied by a which is sqrt(size of the transform), you also might want to take a look at Wikipedia/Hadamard_transform.
The hadamard transform is also somewhat similar to the DCT but simpler, thats also why its used as part of a SATD motion estimation comparission function, the dct would be slightly better quality wise but significantly slower …

How to calculate it

Well there are many ways
a slow and simple one is:

for(i=0; i<n; i++){
    dst[i]=0;
    for(j=0; j<n; j++){
        int sign= parity(i&j) ? -1 : 1;
        dst[i] += src[j] * sign;
    }
}

a faster one is:

void transform(int *data, int step, int n){
    int i, j;
    for(i=0; i<n; i+=2*step){
        for(j=i; j<i+step; j++){
            int a= data[j];
            data[j]      = a + data[j+step];
            data[j+step] = a - data[j+step];
        }
    }
    if(2*step<n)
        transform(data, 2*step, n);
}

You should of course not implement this recursively, but instead remove recursion, unroll the loops where cleanly possible and replace step and n by constants if you can.
Ive just written it like above as its IMHO easier to understand that way then 2 pages of unrolled loops

Filed under: Uncategorized — Michael @ 01:41
« Previous PageNext Page »

Powered by WordPress