Monthly Archives: July 2016

Window Parameters in FIR Filter Design

The previous article in this series discussed that a tapered window, such as a Bartlett, can give better PSL than a rectangular window which has abrupt variation in the time domain.

In this article, first, we will review other popular windows. Then, we will clarify the design procedure by calculating the cutoff of the ideal filter, window type, and window length from given filter specs, namely, and now we need to find the required ideal filter response, window type, and window length to design an FIR filter. The relation between these parameters is the subject of this article.

Other Popular Window Functions

Fortunately, the Bartlett and the rectangular windows are not the only options in FIR filter design and many other windows have been developed.

Table I shows some of the most popular windows along with their important properties. In Table I, Bartlett, Hann, and Hamming have equal approximate main lobe width, but we can observe the general trade-off between the PSL and the main lobe width. The rectangular window has the smallest main lobe width and the largest PSL, whereas the Blackman has the widest main lobe and the smallest PSL.

The Fourier transform of three windows, Bartlett, Hann, and Hamming with

M=21M=21

, are plotted in Figure (1). The mentioned trade-off is observed in these three windows, too. As the PSL reduces, the main lobe width increases.

 

In addition to PSL and approximate main lobe width, Table I gives, for each window, the peak approximation error, which is the deviation from the ideal response (denoted by

δδ

) expressed in dB. This is an important parameter which allows us to choose an appropriate window based on the requirements of an application. Peak approximation error determines how much deviation from the ideal response we expect for each of the window types. This is illustrated in Figure (2).

As will be discussed in the following section, the deviations from the ideal response in the pass-band and stop-band are approximately equal when using the window method to design FIR filters, i.e.,

δ1=δ2=δδ1=δ2=δ

. Therefore, we can select the suitable window based on how much ripple is allowed in the pass-band or how much attenuation is needed in the stop-band.

How to The Speakers Work

An atom has a center nucleus that is made of neutral charges called neutrons, and positive charges called protons. Moving around the nucleus are negative charges called electrons.

Opposite charges attract, so electrons are attracted to the protons in the nucleus. At the same time, similar charges repel, so too many electrons in one area tend to push one or more electrons to leave.

Electrons are in constant motion around an atom.

Chemistry

When multiple atoms are brought near each other, the electrons can move between neighboring atoms. The electrons must follow paths that take into account their constant motion, the force of attraction to the protons, and the force of repulsion to fellow electrons. Balancing all those rules for many atoms brought together sometimes results in regular patterns or crystalline shapes.

Piezoelectric Effect

Certain materials will generate a measurable potential difference when they are made to expand or shrink in a particular direction.

Increasing or decreasing the space between the atoms by squeezing, hitting, or bending the crystal can cause the electrons to redistribute themselves and cause electrons to leave the crystal, or create room for electrons to enter the crystal. A physical force on the crystal creates the electromotive force that moves charges around a circuit.

The opposite is true as well: Applying an electric field to a piezoelectric crystal leads to the addition or removal of electrons, and this in turn causes the crystal to deform and thereby generate a small physical force.

Representation of a compressed (left) and stretched (right) crystalline structure.

How Piezoelectric Speakers Move

The piezoelectric effect can be employed in the construction of thin-form-factor speakers that are valuable alternatives to traditional electrodynamic speakers in space-constrained applications. These devices are referred to as both piezoelectric speakers and ceramic speakers.

Apply an electric field to a piezoelectric material and it will change size. The piezoelectric material will shrink or grow as charges are introduced or removed, but the base material will not.

This causes elastic deformation of the material toward or away from a direction that is perpendicular to the surface of the speaker. As soon as the electric field is removed from the piezoelectric material, it will return to its original shape.

As the speaker flexes and strikes air molecules, it causes a chain reaction of collisions that eventually reaches your ear. If enough air molecules strike your ear, the nerve cells send a signal to your brain that you interpret as sound.

How Disturbances Travel

An unimaginable number of atoms and molecules surround us and are in constant motion. These particles move in straight lines until they hit other atoms and their direction changes. A single particle will never move far before a collision, but the effects of the collision can travel great distances as new particles collide with their neighbors.

Imagine adding a single drop of food coloring to the center of a swimming pool. The particles of food coloring might take minutes or hours to reach the edge, but the waves generated by the drop would be at the pools edge in seconds.

Air particles strike our bodies constantly and randomly all the time. When the collisions stop being less constant and less random, and start being more regular and patterned, we are hit with more particles at specific times. Certain nerve cells in our ears can detect these increased, patterned collisions and send signals to our brains, and our brain interprets the pattern as sound.

UNO Hardware Design

Most articles explain the software of Arduinos. However, understanding hardware design helps you to make the next step in the Arduino journey. A good grasp of the electronic design of your Arduino hardware will help you learn how to embed an Arduino in the design of a final product, including what to keep and what to omit from your original design.

Components Overview

The PCB design of the Arduino UNO uses SMD (Surface Mount Device) components. I entered the SMD world years ago when I dug into Arduino PCB design while I was a part of a team redesigning a DIY clonefor Arduino UNO.

Integrated circuits use standardized packages, and there are families for packages.

The dimensions of many SMD resistors, capacitors, and LEDs are indicated by package codes such as the following:

Most packages are generic and can be used for different parts with different functionality. The SOT-223 package, for example, can contain a transistor or a regulator.

In the table below, you can see a list of some components in the Arduino UNO with their respective package:

Arduino UNO System Overview

Before we can understand the UNO’s hardware, we must have a general overview of the system first.

After your code is compiled using Arduino IDE, it should be uploaded to the main microcontroller of the Arduino UNO using a USB connection. Because the main microcontroller doesn’t have a USB transceiver, you need a bridge to convert signals between the serial interface (UART interface) of the microcontroller and the host USB signals.

The bridge in the latest revision is the ATmega16U2, which has a USB transceiver and also a serial interface (UART interface).

To power your Arduino board, you can use the USB as a power source. Another option is to use a DC jack. You may ask, “if I connect both a DC adapter and the USB, which will be the power source?” The answer will be discussed in the “Power Part” section from this article.

To reset your board, you should use a push button in the board. Another source of reset should be every time you open the serial monitor from Arduino IDE.

I redistributed the original Arduino UNO schematic to be more readable below. I advise you to download it and open the PCB and schematic using Eagle CAD while you are reading this article.