Wednesday, September 26, 2012

Sound Processing on DSP

Sound Processing


Introduction

Sound processing is one of the many applications of Digital Signal Processing. Different effects can be performed with various filters. In this project we will describe some processing methods using sound signals. Then we will show how to implement these filter and compare their outputs.
All musical programs are produced in basically two stages. First, sound from each individual instrument is recorded in an acoustically inert studio on a single track of a multi-track tape recorder. Then the signals from each track are manipulated by the sound engineer to add special audio effects and are combined to in a mix down system to finally generate the stereo recording on a two-track tape recorder. The audio effects are artificially generated using various signal processing circuits and devices, and they are increasingly being performed using digital signal processing techniques. They can be done by Time-Domain Operations and Frequency-Domain Operations.
For years musicians have been using different to give their music a unique sound. Some of these techniques were found by accident, while others were found after a lot of work and experimentation. While the effects have not changed much in the past few years, the ways in which these effects are produced have.In recent years there has been a movement away from analog signal processing towards digital signal processing of music.This movement has allowed for very precise and easily reproduced effects.

Our Project

As part of our EE623 DSP course, we worked on producing echo effect using the single echo filter and the multiple echo FIR filter. It was a very intersting project, but we found the filters to be limiting in their effects. We wanted to experiment with filters which will produce a better and clearer output effect. This also encouraged us to work on other concepts like delay, reverberation, flanging, and equalizer.
In this report,we have described some of the filters we used, provided links to the Matlab code,the response plots of the filters, and the input and output sound files.
  • Delaying  

The delay is one of the simplest effects out there, but it is very valuable when used properly. A little delay can bring life to dull mixes, widen your instrument's sound, and even allow you to solo over yourself. The delay is the also a building block for a number of other effects,such as reverb,  flanging, chorusing.
Simply put, a delay takes an audio signal, and plays it back after the delay time. The delay time can range from several milliseconds to several seconds.
  • Reverberation

Reverberation is the result of the many reflections of a sound that occur in a room. From any sound source, say a speaker of your stereo, there is a direct path that the sounds covers to reach our ears. But that's not the only way the sound can reach us. Sound waves can also take a slightly longer path by reflecting off a wall or the ceiling, before arriving at your ears, as shown in Figure 1. A reflected sound wave like this will arrive a little later than the direct sound, since it travels a longer distance, and is generally a little weaker, as the walls and other surfaces in the room will absorb some of the sound energy. Of course, these reflected waves can again bounce off another wall before arriving at your ears, and so on. This series of delayed and attenuated sound waves is what we call reverb, and this is what creates the 'spaciousness' of a room.
Reverberation
  • Flanging

Flanging has a very characteristic sound that many people refer to as a "whooshing" sound, or a sound similar to the sound of a jet plane flying overhead. Flanging is generally considered a particular type of phasing (another popular effect). Flanging is created by mixing a signal with a slightly delayed copy of itself, where the length of the delay is constantly changing.

Sound Effects Implemented

  In the filters section we will describe about the filters, their usage and advantages and in effects section we will talk about 
  1. Delay
  2. Multiple Echo
  3. All pass Reverberation
  4. A Natural Sounding Reverberation
  5. Flanging
  6. Equalizer

  1. Delay

    A simple delay filter is shown below in figure 1.
    Delay

  2. Multi Echo Filter

    This filter realizes infinite number of echoes spaced "R" sampling periods apart and with exponentially decaying amplitude.
    The Block diagram of the multi-echo filter is given below.
    Multi Echo Filter
    Its Transfer function is given by
    H(Z) =  Z-R / (1 - alpha * ( Z-R))
    This filter is not good enough to provide natural sound reverberation because of two reasons.
    1. Its magnitude response is not constant for all frequencies resulting in, a 'coloration' of many musical sounds that are often unpleasant for listening purposes.
    2. The output echo density generated by unit impulse at the input is much lower than that observed in a real room.


  3. All Pass Reverberator

    To develop a more realistic reverberation, a reverberator with an all pass structure has been implemented
    All Pass Filter
    Its transfer function is given by
    H(Z) = (alpha + Z-R) / (1 + alpha * Z-R)
    Matlab Code
    Input Sound file
    Output Sound File

  4. A Natural Sounding Reverberator (Schroeder's Reverberator)

    In this case we try to simulate with a combination of 4 IIR filters and 2 All pass filters. We can have a general model of standard reverberation filter. With a suitable choice of decay factor,and delay units, we can have a more natural reverberator. This duplicates the sound that occurs in a specific closed space, such as a concert hall.
    A Natural Reverberator
    Matlab Code
    Input Sound file
    Output Sound File1

  5. Flanging effect

    The block diagram is given below
    A flange effect
    Its transfer function is
    H(Z) =(1 + alpha *( Z-beta (n) )
    where beta (n) is the time varying cosine function which is periodically varying between 0 an R
    Matlab Code
    Input Sound file
    Output Sound File

  6. Equalizer

    By using the Low-Pass, High Pass and Band-Pass Filters, an audio equalizer can be built. This allows the user to magnify or dampen any frequencies that they choose.Many equalizers on the market allow users to change up to 20 different frequency bands.For simplification we designed an equalizer with three bands: the lower band, a middle band, and the upper band. This was done with the MATLAB code that follows and the output is also shown below. The user can go through and change the gains to see the different effects that occur to the signal.
    A simple block diagram of the equalizer is given below
    Equalizer
    Output Sound File1 (Output of the Low Pass Filter) 
    Output Sound File2 (Output of the Band Pass Filter)
    Output Sound File3 (Output of the High Pass Filter)
    Output Sound File4 (The total output of the three filters)

Conclusion

Music signal processing includes a wide variety of effects and filtering techniques. Many of the algorithms discussed can be implemented quite easily with a few lines of MATLAB code. The effects covered above have been around for quite some time but can still be heard in many of the bands we listen to today. In the past the effects were implemented with analog technology, or in some cases two tape reels spinning at different speeds. Today, however, almost all musical signal processing effects are done digitally allowing for a wider variety of manipulation. We are able to see that in the past few years, how sound quality has improved tremendously. This will be greatly useful wherever sound transmission or its processing is done.

References

  1. Digital Signal Processing - A Computer Based Approach by Sanjit K Mitra
  2. Harmony Central
  3. McGill DSP course
  4. Handbook for Acoustic Ecology

Project done by
Rajani Shankar Sadasivam
Rajesh Samudrala
Vikas Sahdev
Click to view our Powerpoint Presentation


Reference
http://www-ece.eng.uab.edu/DCallaha/courses/DSP/
http://www-ece.eng.uab.edu/DCallaha/courses/DSP/Projects%202001/T4/sound.htm

https://ccrma.stanford.edu/~jos/fp/Definition_Simplest_Low_Pass.html
\



huffman coding
http://en.nerdaholyc.com/huffman-coding-on-a-string/
http://www.programminglogic.com/implementing-huffman-coding-in-c/
http://cprogramminglanguage.net/code-snippets/huffman-coding.aspx

Tuesday, September 25, 2012

White papaer example

Writing a Technical White Paper or Whitepaper

Overview and Objective

Every new technology has barriers to entry. Often times these barriers are based on myth or inaccurate facts that have been presented in the media. Some times the barriers are based on real world experience of customers using similar technologies. Other times a truly new technology comes along that addresses a problem in a different way.  In all cases, it is incumbent upon the vendor to educate prospects, analysts, and the press about the technology or a new approach to solving the problem. The objective of the technology "Whitepaper" or "White Paper" is to make an argument for a technology or approach and educate the reader as to why the argument is valid.

Definitions 
 
A white paper is an authoritative report or guide that helps readers understand an issue, solve a problem, or make a decision

Requirements

A whitepaper can be of varying length, usually from four pages to twenty. Anything longer probably won't hold the reader's attention.
The white paper should be formatted into small sections with clear titles for easy reading. Most white papers won't be read from cover-to-cover but rather skimmed for information that is important or educational to the reader.

Outline

The outline of a white paper varies drastically depending upon the content. The following is an example outline:
1)      Overview - The initial argument is stated in some detail.
2)      Key points - A listing is provided of the facts and statistics to back up the argument.  This is where the technology is explained.
3)      Examples - Real world examples of applying the technology.   Examples allow the reader to visualize how the theory presented applies in the real world.
4)      Summary - A reemphasis of the initial argument pulling in a summary of the facts and examples.

Helpful Hints

The following are some points to keep in mind as you build your white paper:
1)      Remember your point.  Identify the point of your paper before you start writing the white paper and write it down.  It is easy to get off on tangents when talking about technical subjects.  Remember the point of your paper, from the opening paragraph through to the summary, and make sure that each section talks to this central point  
2)      Use metaphors, but make sure they appeal to a wide audience. Metaphors are a good way to help make your point, but be sure they will be understood by your target audience. For example, a metaphor that references the US government may not be understood by an international market.
3)      Talk to your competitors' weaknesses. Though it is not necessary to mention your competitors by name, it will be helpful to your positioning if you call out the strengths of your product over your competitors' products.
4)      Don't talk in a negative tone to your audience. In calling out problems it is easy to slide into talking negatively about the people who created them. For example, the following sentence is very negative: "Corporate bureaucrats often make their business processes far more complex than necessary." Your audience will probably not directly relate to the sentence. Someone reading this from a company with highly complex business processes would understand that their processes are complex, but also understands that they became complex for a reason. They may feel that you don't understand their company and they may also take offense. A better way to word this would be, "Corporations often have highly complex processes that have evolved over time for a number of varied reasons. Many of these reasons may no longer be valid, leaving business process far more complex than necessary." This is a sentence that most everyone in any company can relate to.
5)      Try to control the length of the paper.  Very few people will read through a 30-page white paper.  They will, however, scan the headings and diagrams and read the sections that they feel are relevant to them.

Packaging

The white paper should be just that, printed on white paper and a clean format for easy duplication and the ability to e-mail as text. It should include diagrams or illustrations that help make points. It may be stapled or bound for easier reading. It should be included in press kits, used for a handout at trade shows, and be made available on the web site in both PDF format for download and html for on-line reading.   PDF may also be desired if there are lots of graphics.

Process

Here is a basic process for writing White Papers:
1)      Agree on objective of white paper.
2)      Define the target reader of the white paper.
3)      Interview key people in the company on their insights and opinions of the topic.
4)      Interview customers or the target market on their issues and insights.
5)      Gather data sheets, MRDs, competitive data, and functional specifications for back-up information.
6)      Write a first draft.
7)      Review first draft with technical resource and a sales resource.
8)      Write second draft.
9)      Review second draft with product manager, engineering, and management.
10)  Review the draft with a customer or prospect to make sure that you are talking at the right level.
11)  Write and review final draft.



http://hoffmanmarcom.com/writing-white-papers.php
http://www.infrasystems.com/writing-a-whitepaper.html
http://www.thatwhitepaperguy.com/white-paper-faq.html#press_release
http://www.thatwhitepaperguy.com/that-white-paper-guy-samples.html
http://www.dirjournal.com/business-journal/how-to-write-a-white-paper/

My word list

fer·ry/ˈferē/

Noun:
A boat or ship for conveying passengers and goods, esp. over a relatively short distance and as a regular service.

Verb:
Convey in a boat, esp. across a short stretch of water.

Synonyms:
ferryboat - raft

 

stance

Noun:
  1. The way in which someone stands, esp. when deliberately adopted (as in baseball, golf, and other sports); a person's posture.
  2. The attitude of a person or organization toward something; a standpoint: "its stance on the draft"

fur/fər/

Noun:
The short, fine, soft hair of certain animals: "a long, lean, muscular cat with sleek fur".

Verb:
Covered with or made from a particular type of fur: "silky-furred lemurs".

Synonyms:
pelt - coat - skin - hai

 

crest/krest/

Noun:
A comb or tuft of feathers, fur, or skin on the head of a bird or other animal.

 

ridge/rij/

Noun:
A long narrow hilltop, mountain range, or watershed.

Verb:
Mark with or form into narrow raised bands: "the ridged sand of the beach".

Synonyms:
crest

ledge/lej/

Noun:
  1. A narrow horizontal surface projecting from a wall, cliff, or other surface.
  2. An underwater ridge.

plank/plaNGk/

Noun:
A long, thin, flat piece of timber, used esp. in building and flooring.

soul/sōl/

Noun:
  1. The spiritual or immaterial part of a human being or animal, regarded as immortal.
  2. A person's moral or emotional nature or sense of identity.

tre·pan/trəˈpan/

Noun:
A trephine (hole saw) used by surgeons for perforating the skull.
Verb:
Perforate (a person's skull) with a trepan.

trepanningpresent participle of tre·pan

Verb:
Perforate (a person's skull) with a trepan.

vi·tal·ism/ˈvītlˌizəm/

Noun:
The theory that the origin and phenomena of life are dependent on a force or principle distinct from purely chemical or physical forces.

cog·ni·tion/kägˈniSHən/

Noun:
  1. The mental action or process of acquiring knowledge and understanding through thought, experience, and the senses.
  2. A result of this; a perception, sensation, or intuition.

 

daff


A daf (Persian) is a large-sized frame drum used to accompany both popular and classical music in Iran, Kurdistan, Azerbaijan, Turkey,...

duf·fer/ˈdəfər/

Noun:
  1. An incompetent or stupid person, esp. an elderly one.
  2. A person inexperienced at something, esp. at playing golf.

bait/bāt/

Noun:
Food used to entice fish or other animals as prey.

Verb:
Deliberately annoy or taunt (someone): "the boys reveled in baiting him about his love of literature".

Synonyms:
noun.  lure - decoy - enticement
verb.  entice - lure - allure

man·i·fes·to/ˌmanəˈfestō/

Noun:
A public declaration of policy and aims, esp. one issued before an election by a political party or candidate.

 per·sua·sive/pərˈswāsiv/


Adjective:
Good at persuading someone to do or believe something through reasoning or the use of temptation.