Pages

Showing posts with label short. Show all posts
Showing posts with label short. Show all posts

Sunday, May 14, 2017

Digital Filter Short note 1

Digital Filter Short note 1


Digital Filtering Short note

This note should refer to [1].

R signal and wavethresh packages provide the functions for signal processing.

Analogy and Digital Filter

An analog-to-digital (A/D) converter is an electronic circuits that are built into the recording amplifiers or between the amplifiers and recording devices. An A/D converter usually has the function of filtering signals. In contrast to the analogy filter, a digital filter applies the filtering after the signals are discreteised.

Basis of Signal Filtering

This section will mention four concepts, the pass, gain, alias and phase.

There are four basic types of filters, the high pass, the low pass, the band pass, and the band stop. Each attenuates different range of frequencies.

  • High pass attenuates low frequency
  • Low pass attenuates high frequency
  • Band stop attenuates a certain range of frequency. Notch filters belong to this category. It filters out 50 or 60 Hz.
  • Band pass attenuates above and below a certain range of frequency

A gain function can be divided into three band:

  • pass band: the frequency range that is mostly retained
  • stop band: the frequency range that little energy is passed
  • transition band: the frequency range that the gain is intermediate.

Gain is the ratio of output amplitude to input amplitude. Gain function is the relation between gain and frequency. Sometimes, power is used instead of amplitude. Importantly power does not equal to amplitude.

Aliasing refers to a problem that signal frequencies are too high to be represented accurately at a given sampling rate.

Frequencies within the transition band are usually called cutoff or corner frequency (( f_c )). The definition of cutoff frequency (( f_c )) depends on the unit to express the frequency, octave or decade.

  • octave (a doubling or halving of frequency)
  • decade (a ten-fold change in frequency)

EE literature defines usually ( f_c ) consistently as the half-power frequency, the frequency within the transition band where the gain is .5. In this case, the gain is defined as the ratio of output power to input power.

In decibles, a gain of .5 equals to -3.0103 dB, because a ratio in decibels is ten times the logarithm to base 10 of the ratio of two power quantities[2]. So, 3 dB down refers to half of the power at a specific frequency is attenuated.

# show .5 gain = -.30103 dB
10 * log10(0.5)
## [1] -3.01

However, some literature defines ( f_c ) as the half-amplitude frequency. Because the power equals to ( voltage^2/resistance ), where the resistance is implicitly set to 1, the half-amplitude frequency differs in fact from the half-power definition. Their relation is .707 and .5.

Page 352 left column 2nd paragraph. When the time constants are 2.2, .25, and 1 seconds, the cutoff frequencies are:

1/(2.2 * 2 * pi)
## [1] 0.07234
1/(0.25 * 2 * pi)
## [1] 0.6366

1/(1 * 2 * pi)
## [1] 0.1592

Reference

[1] Cook and Miller (1992). Digital filtering: Background and tutorial for psychophysiologists, 29(3), Psychophysiology.

[2] IEEE Standard 100 The Authoritative Dictionary of IEEE Standards Terms, Seventh Edition, The Institute of Electrical and Electronics Engineering, New York, 2000; ISBN 0-7381-2601-2; page 288)

Read more »

Saturday, April 15, 2017

Digg Short URL Expander Greasemonkey Script

Digg Short URL Expander Greasemonkey Script


Digg Short URL Expander is a Greasemonkey script by Of Zen and Computing that expands Digg Short URLs. This user script modifies links on any web page so that the link URL points to the actual site being linked instead of an intermediary Digg.com page.

The Digg Short URL Controversy

Social news site Digg provides a URL shortening service that allows people to easily post links on sites like Twitter which limit the size of a message. The URL to the page being linked might be very long � the URL to the page you are currently reading for example, http://www.ofzenandcomputing.com/zanswers/2288, is 46 characters long and would therefore consume over 30% of the space allotted to you in a Twitter status update. But by shortening it to http://digg.com/u195mh with Digg�s URL shortening service, it becomes 22 characters long and only takes up 17% of the space allotted.

Controversy has risen around Digg�s URL shortening service. At first, linked pages were wrapped in a Digg-branded frame which motivated many bloggers, publishers and web developers to implement �frame killers� on their sites. And yesterday Digg was accused of hitting users with a bait and switch scheme by modifying the behavior of its URL shortening service so that visitors land on an intermediary Digg web page describing the linked site, instead of the site itself.

�Digg�s Kevin Rose Not Pleased With DiggBar Change� by TechCrunch notes that Digg founder Kevin Rose is not pleased with this change and we will likely see the new policy modified or reversed soon.

Fix it yourself with the Digg Short URL Expander

Why wait for an official announcement when the amazing flexibility the Firefox web browser gives you the power to modify the behavior of Digg Short URLs on your own? Install our Digg Short URL Expander Greasemonkey script and clicking Digg Short URLs will take you straight to the web page the publisher intended you to see.

Before you can use the Digg Short URL Expander script, you must be using Mozilla Firefox and have the Greasemonkey add-on installed.

Read more »