Filter a Rectangular Pulse with no Ringing
To filter a rectangular pulse without any ringing, there is only one requirement on the filter coefficients: they must all be positive. However, if we want the leading and trailing edge of the pulse to be symmetrical, then the coefficients must be symmetrical. What we are describing is basically a window function.
Consider a rectangular pulse 32 samples long with fs = 1 kHz. Here is the Matlab code to generate the pulse:
N= 64; fs= 1000; % Hz sample...Digital Envelope Detection: The Good, the Bad, and the Ugly
Recently I've been thinking about the process of envelope detection. Tutorial information on this topic is readily available but that information is spread out over a number of DSP textbooks and many Internet web sites. The purpose of this blog is to summarize various digital envelope detection methods in one place.
Here I focus on envelope detection as it is applied to an amplitude-fluctuating sinusoidal signal where the positive-amplitude fluctuations (the sinusoid's envelope)...
Exponential Smoothing with a Wrinkle
IntroductionThis is an article to hopefully give a better understanding to the Discrete Fourier Transform (DFT) by providing a set of preprocessing filters to improve the resolution of the DFT. Because of the exponential nature of sinusoidal functions, they have special mathematical properties when exponential smoothing is applied to them. These properties are derived and explained in this blog article.
Basic Exponential Smoothing
Exponential smoothing is also known as...
Discrete-Time PLLs, Part 1: Basics
In this series of tutorials on discrete-time PLLs we will be focusing on Phase-Locked Loops that can be implemented in discrete-time signal proessors such as FPGAs, DSPs and of course, MATLAB.
Multilayer Perceptrons and Event Classification with data from CODEC using Scilab and Weka
For my first blog, I thought I would introduce the reader to Scilab [1] and Weka [2]. In order to illustrate how they work, I will put together a script in Scilab that will sample using the microphone and CODEC on your PC and save the waveform as a CSV file.
Multimedia Processing with FFMPEG
FFMPEG is a set of libraries and a command line tool for encoding and decoding audio and video in many different formats. It is a free software project for manipulating/processing multimedia data. Many open source media players are based on FFMPEG libraries.
Approximating the area of a chirp by fitting a polynomial
Once in a while we need to estimate the area of a dataset in which we are interested. This area could give us, for example, force (mass vs acceleration) or electric power (electric current vs charge).
GPS - some terminology!
Hi!
For my first post, I will share some information about GPS - Global Positioning System. I will delve one step deeper than a basic explanation of how a GPS system works and introduce some terminology.
GPS, like we all know is the system useful for identifying one's position, velocity, & time using signals from satellites (referred to as SV or space vehicle in literature). It uses the principle of trilateration (not triangulation which is misused frequently) for...
The Most Interesting FIR Filter Equation in the World: Why FIR Filters Can Be Linear Phase
This blog discusses a little-known filter characteristic that enables real- and complex-coefficient tapped-delay line FIR filters to exhibit linear phase behavior. That is, this blog answers the question:
What is the constraint on real- and complex-valued FIR filters that guarantee linear phase behavior in the frequency domain?I'll declare two things to convince you to continue reading.
Declaration# 1: "That the coefficients must be symmetrical" is not a correct
Phase and Amplitude Calculation for a Pure Real Tone in a DFT: Method 1
IntroductionThis is an article to hopefully give a better understanding of the Discrete Fourier Transform (DFT) by deriving exact formulas for the phase and amplitude of a non-integer frequency real tone in a DFT. The linearity of the Fourier Transform is exploited to reframe the problem as the equivalent of finding a set of coordinates in a specific vector space. The found coordinates are then used to calculate the phase and amplitude of the pure real tone in the DFT. This article...
Computing Translated Frequencies in Digitizing and Downsampling Analog Bandpass Signals
In digital signal processing (DSP) we're all familiar with the processes of bandpass sampling an analog bandpass signal and downsampling a digital bandpass signal. The overall spectral behavior of those operations are well-documented. However, mathematical expressions for computing the translated frequency of individual spectral components, after bandpass sampling or downsampling, are not available in the standard DSP textbooks. The following three sections explain how to compute the...
New Video: Parametric Oscillations
I just posted this last night. It's kinda off-topic from the mission of the channel, but I realized that it had been months since I'd posted a video, and having an excuse to build on helped keep me on track.
Phase and Amplitude Calculation for a Pure Complex Tone in a DFT using Multiple Bins
IntroductionThis is an article to hopefully give a better understanding of the Discrete Fourier Transform (DFT) by deriving exact formulas to calculate the phase and amplitude of a pure complex tone from several DFT bin values and knowing the frequency. This article is functionally an extension of my prior article "Phase and Amplitude Calculation for a Pure Complex Tone in a DFT"[1] which used only one bin for a complex tone, but it is actually much more similar to my approach for real...
There and Back Again: Time of Flight Ranging between Two Wireless Nodes
With the growth in the Internet of Things (IoT) products, the number of applications requiring an estimate of range between two wireless nodes in indoor channels is growing very quickly as well. Therefore, localization is becoming a red hot market today and will remain so in the coming years.
One question that is perplexing is that many companies now a days are offering cm level accurate solutions using RF signals. The conventional wireless nodes usually implement synchronization...
In Search of The Fourth Wave
Last year I participated in the first DSP Related online conference, where I presented a short talk called "In Search of The Fourth Wave". It's based on a small mystery I encountered when I was working on Think DSP. As you might know:
A sawtooth wave contains harmonics at integer multiples of the fundamental frequency, and their amplitudes drop off in proportion to 1/f. A square wave contains only odd multiples of the fundamental, but they also drop off...Exact Near Instantaneous Frequency Formulas Best at Peaks (Part 1)
IntroductionThis is an article that is a another digression from trying to give a better understanding of the Discrete Fourier Transform (DFT). Although it is not as far off as the last blog article.
A new family of formulas for calculating the frequency of a single pure tone in a short interval in the time domain is presented. They are a generalization of Equation (1) from Rick Lyons' recent blog article titled "Sinusoidal Frequency Estimation Based on Time-Domain Samples"[1]. ...
Multilayer Perceptrons and Event Classification with data from CODEC using Scilab and Weka
For my first blog, I thought I would introduce the reader to Scilab [1] and Weka [2]. In order to illustrate how they work, I will put together a script in Scilab that will sample using the microphone and CODEC on your PC and save the waveform as a CSV file.
Two Bin Exact Frequency Formulas for a Pure Real Tone in a DFT
IntroductionThis is an article to hopefully give a better understanding of the Discrete Fourier Transform (DFT) by deriving exact formulas for the frequency of a real tone in a DFT. This time it is a two bin version. The approach taken is a vector based one similar to the approach used in "Three Bin Exact Frequency Formulas for a Pure Complex Tone in a DFT"[1]. The real valued formula presented in this article actually preceded, and was the basis for the complex three bin...
Improved Three Bin Exact Frequency Formula for a Pure Real Tone in a DFT
IntroductionThis is an article to hopefully give a better understanding of the Discrete Fourier Transform (DFT) by extending the exact two bin formulas for the frequency of a real tone in a DFT to the three bin case. This article is a direct extension of my prior article "Two Bin Exact Frequency Formulas for a Pure Real Tone in a DFT"[1]. The formulas derived in the previous article are also presented in this article in the computational order, rather than the indirect order they were...
An Alternative Form of the Pure Real Tone DFT Bin Value Formula
IntroductionThis is an article to hopefully give a better understanding of the Discrete Fourier Transform (DFT) by deriving alternative exact formulas for the bin values of a real tone in a DFT. The derivation of the source equations can be found in my earlier blog article titled "DFT Bin Value Formulas for Pure Real Tones"[1]. The new form is slighty more complicated and calculation intensive, but it is more computationally accurate in the vicinity of near integer frequencies. This...
A Two Bin Exact Frequency Formula for a Pure Complex Tone in a DFT
IntroductionThis is an article to hopefully give a better understanding to the Discrete Fourier Transform (DFT) by deriving an exact formula for the frequency of a complex tone in a DFT. It is basically a parallel treatment to the real case given in Exact Frequency Formula for a Pure Real Tone in a DFT. Since a real signal is the sum of two complex signals, the frequency formula for a single complex tone signal is a lot less complicated than for the real case.
Theoretical...Two Bin Exact Frequency Formulas for a Pure Real Tone in a DFT
IntroductionThis is an article to hopefully give a better understanding of the Discrete Fourier Transform (DFT) by deriving exact formulas for the frequency of a real tone in a DFT. This time it is a two bin version. The approach taken is a vector based one similar to the approach used in "Three Bin Exact Frequency Formulas for a Pure Complex Tone in a DFT"[1]. The real valued formula presented in this article actually preceded, and was the basis for the complex three bin...
Phase and Amplitude Calculation for a Pure Complex Tone in a DFT using Multiple Bins
IntroductionThis is an article to hopefully give a better understanding of the Discrete Fourier Transform (DFT) by deriving exact formulas to calculate the phase and amplitude of a pure complex tone from several DFT bin values and knowing the frequency. This article is functionally an extension of my prior article "Phase and Amplitude Calculation for a Pure Complex Tone in a DFT"[1] which used only one bin for a complex tone, but it is actually much more similar to my approach for real...
In Search of The Fourth Wave
Last year I participated in the first DSP Related online conference, where I presented a short talk called "In Search of The Fourth Wave". It's based on a small mystery I encountered when I was working on Think DSP. As you might know:
A sawtooth wave contains harmonics at integer multiples of the fundamental frequency, and their amplitudes drop off in proportion to 1/f. A square wave contains only odd multiples of the fundamental, but they also drop off...Three Bin Exact Frequency Formulas for a Pure Complex Tone in a DFT
IntroductionThis is an article to hopefully give a better understanding to the Discrete Fourier Transform (DFT) by deriving exact formulas for the frequency of a complex tone in a DFT. This time it is three bin versions. Although the problem is similar to the two bin version in my previous blog article "A Two Bin Exact Frequency Formula for a Pure Complex Tone in a DFT"[1], a slightly different approach is taken using linear algebra concepts. Because of an extra degree of freedom...
Frequency Formula for a Pure Complex Tone in a DTFT
The analytic formula for calculating the frequency of a pure complex tone from the bin values of a rectangularly windowed Discrete Time Fourier Transform (DTFT) is derived. Unlike the corresponding Discrete Fourier Transform (DFT) case, there is no extra degree of freedom and only one solution is possible.
Exact Near Instantaneous Frequency Formulas Best at Peaks (Part 1)
IntroductionThis is an article that is a another digression from trying to give a better understanding of the Discrete Fourier Transform (DFT). Although it is not as far off as the last blog article.
A new family of formulas for calculating the frequency of a single pure tone in a short interval in the time domain is presented. They are a generalization of Equation (1) from Rick Lyons' recent blog article titled "Sinusoidal Frequency Estimation Based on Time-Domain Samples"[1]. ...
Improved Three Bin Exact Frequency Formula for a Pure Real Tone in a DFT
IntroductionThis is an article to hopefully give a better understanding of the Discrete Fourier Transform (DFT) by extending the exact two bin formulas for the frequency of a real tone in a DFT to the three bin case. This article is a direct extension of my prior article "Two Bin Exact Frequency Formulas for a Pure Real Tone in a DFT"[1]. The formulas derived in the previous article are also presented in this article in the computational order, rather than the indirect order they were...
Candan's Tweaks of Jacobsen's Frequency Approximation
IntroductionThis is an article to hopefully give a better understanding of the Discrete Fourier Transform (DFT) by explaining how a tweak to a well known frequency approximation formula makes it better, and another tweak makes it exact. The first tweak is shown to be the first of a pattern and a novel approximation formula is made from the second. It only requires a few extra calculations beyond the original approximation to come up with an approximation suitable for most...
Exact Near Instantaneous Frequency Formulas Best at Zero Crossings
IntroductionThis is an article that is the last of my digression from trying to give a better understanding of the Discrete Fourier Transform (DFT). It is along the lines of the last two.
In those articles, I presented exact formulas for calculating the frequency of a pure tone signal as instantaneously as possible in the time domain. Although the formulas work for both real and complex signals (something that does not happen with frequency domain formulas), for real signals they...