instruction
stringlengths
31
27k
I am playing with the periodogram of MATLAB. I created a simple script to observe how it behaves: rng(1); %# initialize the random number generator Fs = 1000; %# Sampling frequency duration = 0.1; %# seconds A = 1; %# Sinusoid amplitude f = 150; %# Sinusoid frequency eps = 0.01; t = 0:1/Fs:duration; x = A * sin(2*...
Mathematica's ImageResize function supports many resampling methods. Not being familiar with this area, beyond nearest neighbour, bilinear, biquadratic and bicubic (which are obvious from the name), I am lost. Can you point me to some source that will explain the basic (mathematical) differences between these methods, ...
In mathematics, the term ergodic is used to describe a dynamical system which, broadly speaking, has the same behavior averaged over time as averaged over space. -from wikipedia From the perspective of engineering a signal processing system, does knowing whether a signal is ergodic change the plan of attack for anal...
I am a biologist with very little experience with image processing but have sufficient knowledge of MATLAB and have the image processing toolbox. Ideally I am looking for a MATLAB based solution, but an approach outlining how to go about it would also be helpful. Update (28 Nov 2011) It appears that there are certain p...
I am faced with a tricky challenge: To extract binary data from an iPhone magnetic strip card reader. This is what the magnetisation on the card looks like: Source Here is the .WAV the iPhone receives when you swipe a card (don't get your hopes up too much, it is a bonus loyalty card ;)). That's three swipes by the w...
I'm trying to apply a decay envelope to a sinusoidal waveform using Verilog. Hardware constraints prevent use of multiplication to simply multiply by the envelope. The sine values and envelope values, for which I'm simply using $1-e^{-x}$, are stored in ROMs to speed everything up. Right now I'm simply calculating the ...
I am new to signal processing and especially to FFT, hence I am not sure if I am doing the correct thing here and I am a bit confused with the result. I have a discrete real function (measurement data) and want to set up a low pass filter on that. The tool of choice is Python with the numpy package. I follow this proce...
I have an interesting problem that I'm trying to solve. So for example, if we have a black and white image containing two textures (A and B), I'm interested in knowing the pixel values of the boundaries that would completely cover the individual textures. I thought of using cross correlation, which would give me a clu...
Matlab's spectrogram() function calculates the STFT of a signal. It describes its NFFT argument as follows: S = SPECTROGRAM(X,WINDOW,NOVERLAP,NFFT) specifies the number of frequency points used to calculate the discrete Fourier transforms. If NFFT is not specified, the default NFFT is used. Am I correct in ...
I'm currently devising a solution for demodulating a DPSK signal in C#. So far I've got a working FFT with phase detection, BUT: I now have an issue of aligning the window of the FFT to synchronise with each symbol transmitted on the audio stream - now I've done some manual testing and for a test transmission I rendere...
I'm trying to calculate the envelope of an arbitrary spectrum but I'm slightly lost as to the best way to do this. I've looked at cepstral enveloping but its very fiddly and I can't seem to get it to give the right results. I've also tried LPC but again it eems to miss a lot of the minor peaks while enveloping the maj...
I have to do cross correlation of two audio file to prove they are similar. I have taken the FFT of the two audio files and have their power spectrum values in separate arrays. How should I proceed further to cross-correlate them and prove that they're similar? Is there a better way to do it? Any basic ideas will be h...
In an answer to a previous question, it was stated that one should zero-pad the input signals (add zeros to the end so that at least half of the wave is "blank") What's the reason for this?
I have binary XDR data file representing radar data. What is XDR data formatting? What is useful for? How to visualize this binary file? Is there any kind of software that converts this data format in any other?
(This question relates to Extracting Binary Magnetic-Strip Card Data from raw WAV) I am extracting the binary sequence from the magnetic strip on a credit card. As you can see, the signal is degraded clearly in one place. also there is a minor degradation right on the left of the image. Just using IIR (i.e. $X_{\rm ...
I am starting with an audio signal picked up from the microphone jack of my iPhone, generated by running a standard magnetic strip ATM card through a sensor. On an old card, there will be a few degenerate bits: Now filtering out this damage is one issue, which I have asked here: Removing noise from F2F signal But how ...
A problem in computer vision and 3d reconstruction is getting the camera's intrinsics parameters. A common solution is to use an object in which one knows the measurements of the shape before hand, such as a checker board. The issue with this method is that it must be done every time the camera parameter's change such...
Pretty simple question - I am trying to figure out what exactly is different between 'de-noising' a signal, and simply filtering it (as we commonly know) to remove noise. Is this a case of lexical overlap or is there something fundamentally different? Why is it called 'de-noising'? Edit: Perhaps crucially, when we tal...
For what types of filter design problems might genetic or evolutionary algorithms be useful? What kinds of genetic or evolutionary algorithms are used for DSP problems? Edit: I expanded the question to include the larger set of evolutionary algorithms, such as differential evolution.
Could someone point out the core texts or articles most useful on techniques for the removal of noise from scanned text for OCR applications?
What would be the ideal way to find the mean and standard deviation of a signal for a real time application. I'd like to be able to trigger a controller when a signal was more than 3 standard deviation off of the mean for a certain amount of time. I'm assuming a dedicated DSP would do this pretty readily, but is the...
I have written a program to perform FastICA on a stereo WAV file using the code on Python MDP FastICA Example With the audio examples I get very good results. Then I try to do real world recording using two computer mono microphones connected to the stereo mic in of my pc by connecting mic 1 to L channel and mic 2 to R...
What are the best filtering techniques for a highly volatility price series with jumps. What needs to be considered in designing new filters for practical finance which are adaptive and highly reactive to jumps? Also I have seen a filter called JMA which is proprietary. If I want to create a similar filter, what direct...
I remember a result about the cross-correlation function of a stationary signal and that same signal, filtered through a linear time-invariant filter. There might have been an assumption that the signal was Gaussian. What is the cross-correlation function? $$E\left\{ x(t) y(t) \right\} = \,\,\,?$$ where $y(t)$ is the o...
There is a postdoc in my lab whose specialty is "statistical signal processing". He has a PhD in Electrical Engineering and he analyzes the neural data collected. I am wondering what courses/topics I should start studying to follow in his footsteps. I'm not exactly looking for things like statistics and signal processi...
In some telecommunication systems, scrambling of transmitted data is applied to provide some level of security. For example, the communication system might look like: Data -> Scrambling -> Compression -> Error correction encoding Could one possibly match the scrambling with the error-correcting code to obtain some bene...
In its chapter on Kalman filters, my DSP book states, seemingly out of the blue, that the stationary Kalman filter for a system $$\begin{cases} x(t+1) &= Ax(t) + w(t) \\ y(t) &= Cx(t) + v(t) \end{cases}$$ has the predictor $$\hat{x}(t+1|t) = (A-A\bar{K}C)\hat{x}(t|t-1) + A\bar{K}y(t)$$ and stationary state vector cov...
I need to find all the contours in an image retrieved from the camera. So I first use the canny edge detector to find the edges and then find the contours. Pretty simple. However, my contours get "merged". For example, in the image below, I clearly have 4 different objects. The edges are slightly touching at some point...
Let's say I have a set of 5 markers. I am trying to find the relative distances between each marker using an augmented reality framework such as ARToolkit. In my camera feed thee first 20 frames show me the first 2 markers only so I can work out the transformation between the 2 markers. The second 20 frames show me the...
How would one segment large area's of gray (ranging from white to black) from an image ? (If you know this in opencv, you may answer by saying what you would do in opencv). For example given this picture: You see that this is a large area of gray and it is clearly distinguishable from the rest. How can you segment thi...
I just simulated an auto-regressive second-order model fueled by white noise and estimated the parameters with normalized least-mean-square filters of orders 1-4. As the first-order filter under-models the system, of course the estimations are weird. The second-order filter finds good estimates, although it has a coupl...
What are the best solutions to detect line in a point cloud? Comparison being made with and between Hough Transform, Radon Transform, RANSAC (see wikipedia) and Brute-Force Search (see wikipedia). Which one is the most robust against the dispersion of points in point cloud? Note: 1- The question is about 3D point cloud...
I am trying to use Roberts edge detection to process an image. Do I just apply both of the masks to the image and perform convolution as normal? Could someone give me the breakdown of how to use this edge detection method, as I am trying to program it to process a greyscale image. I convoluted the image using both kern...
I am using a recording device that seems to shift the colors horizontally and I would like to find the amount of unshifting I have to do on 2/3 of the channels in order to obtain an image with minimal color distortion. You can see here that in the original image at least the blue channel was shifted back with ~1.0 pix...
I understand OpenCV is the de facto library for programming image processing in C/C++; I'm wondering if there is a C or C++ library like that for audio processing. I basically want to filter raw waves from a microphone, and analyze them with some machine learning algorithms. But I may eventually also need: Multiplatfo...
I've been hunting around for an alternative to Matlab's System Identification Toolbox, but the commonality of the terms "system" and "identification" are confounding the search. Are there any standalone libraries that are written for this purpose? (in C++, C#, Python, etc.)
I am a C# programmer and have a project to create a Mark Reader software. Bubble sheets that have been filled in by students are scanned using a general scanner (as opposed to a special scanner for bubble sheet). The resulting images must be processed using the Mark Reader software in question. I have a bit knowledge i...
What should my approach be towards designing a filter that can simultaneously remove salt & pepper noise and improve the resolution?
I want to reconstruct the text from the following image as best as possible. The tricky part is that I want to do it only using morphorogical operations on the image I tried using erosion, dilation, opening and closing but the result is not very good. Is this even possible?
Applying constant false alarm rate is a critical step for estimation of performance of all detectors. Has anybody experience on practical implementation of this estimator for energy detector? Can anybody explain and introduce a code to me?
(EDIT: This question follows from Extracting Binary Magnetic-Strip Card Data from raw WAV) Here is my signal (top line) and a basic IIR filter applied (bottom line) (EDIT: my task is to break the signal into binary 0 (frequency F) and binary 1 (frequency 2F) -- that's why it is called F2F. So I need to process it in ...
I have a two vectors of spatial data (each about 2000 elements in length). One is a convolved version of the other. I am trying to determine the kernel that would produce such a convolution. I know that I can do this by finding the inverse Fourier transform of the ratio of the Fourier transforms of the output and input...
I am preparing an interview which may require some knowledges on DSP. Is there any questions, fundamental concepts, and theories that I would not want miss? Thanks a lot for the suggestions.
Given a WSS process with the following Auto Correlation Function: $$ r\left ( \tau \right ) = {\sigma}^{2} {e}^{-\alpha \left | \tau \right |} $$ The Laplace Transform would be: $$ R \left ( s \right ) = \mathfrak{L} \left \{ r \left ( \tau \right ) \right \} = \frac{-2 \alpha {\sigma} ^ {2}}{\left ( s - \alpha \right ...
I'm trying to detect and classify non-speech sounds. Currently, I'm using a series of moving overlapped power spectrums from training sounds as the features I am looking for. When I do analysis, I'm just computing the same amount of overlapped spectrums so that the number of features are the same. Right now the perform...
Due to my work, I just started studying hyperspectral or multispectral image processing. I think I have enough programming background and studied mathematics for my degree - it was long time ago though. Since early this year, I have been exposed to image processing in my development work for manufacturing industry. An...
I have an Analog-Digital Converter used for getting digital data from LoadCell scales. In order to use this data in my formulas I need to convert that data to the millimeters. But how do I do it?
I would like to apply The Morlet wavelet transform to analyse my EEG signals. I have many short signals each is only 1 min long. and they all recorded in 30Hz. I have Two questions: In the Morlet wavelet, What is the best scale (alpha) to use in my case ? About the edge effect: How can I know / compute what portion o...
I am able to write a basic sine wave generator for audio, but I want it to be able to smoothly transition from one frequency to another. If I just stop generating one frequency and immediately switch to another there will be a discontinuity in the signal and a "click" will be heard. My question is, what is a good algor...
I have two sensors that have a cross talk between them. I would like to cancel the cross talk. For this I recorded two tracks, where sensor no.1 (called x1) has some input, and sensor no.2 (called x2) is zero. I was told to make the following operations: Since your cross talk is small: 1) Simply measure the transfer f...
I am trying to get a rough estimate of a position of a hand through using backprojection on frames retrieved from a camera. I do not need perfect detection on the hand, but I can't really afford to get many false blobs. At night, my histogram works fine but at day I get a large amount of false blobs. The patch of skin ...
i would like to ask... is there such a thing such as "Pitch Detection with the Histogram Frequencies Algorithm" ? Does such a thing exist or is it the harmonic product spectrum algorithm or cepstral algorithm for pitch detection ? Also do you have more information on the algorithm and source code in matlab ? Thank you ...
Imagine I've got some offline data that I want to smooth. I could use an auto-regressive or moving-average filter of some appropriate order for conducting the smoothing. On which criteria should I base my filter decision?
A book claims this as a motivation for introducing exponential averaging: A disadvantage of ensemble averaging is that the resulting estimate cannot track dynamic changes occurring in the observed signal. -- L. Sörnmo and P. Laguna, Bioelectrical signal processing in cardiac and neurological applications The authors ...
In MPEG, there is a process where an image is broken up into macroblocks and a motion vector is computed for each of those macro blocks. You then transmit these vectors, along with the prediction errors, to reconstruct the next image in the video sequence. I'm trying to get a firm grasp on how this works. Each macrob...
I have a signal sampled at $\Delta t$: $f_i(t_i=i\Delta t)$ where $i = 0,\ldots,n-1$. I want to find the first and second derivative of the signal: $f'(t)$ and $f''(t)$. My first thought was to estimate the derivatives by central differences: \begin{align} f'(t_{i})&=\frac{f(t_{i+1})-f(t_{i-1})}{2\Delta t}\\ f''(t_{i})...
Every time I've read "first Fourier transform", I've assumed it to be a misspelling of the fast Fourier transform. Recently though, I saw the term in both the title and keywords of an article from a seemingly serious, albeit not peer-reviewed, journal, Japanese Circulation Journal. Development of a new analytical metho...
I have a signal sampled at $\Delta t: fi(ti=i\Delta t)$ where i = 0..n-1. I want to find the first derivative of the signal: f'(t). My first thought was to estimate this by a central difference: $f'(t_i) =\frac{f(t_{i+1})−f(t_{i−1})}{2\Delta t}$ However the signal may have a lot of high frequency noise that may cause q...
I have a signal: $f_i(t_i=i\Delta t)$, where $i = 0\ldots n-1$. The signal seems to vary quickly around a slower varying "trend". I am assuming that the quickly varying part is noise and the slowly varying part is the real signal. How do I estimate the signal-to-noise ratio (SNR) of the signal? I guess that if I coul...
First, I appologize because I'm a software developper and it's been a very long time I didn't dive into pure mathematics, so my question might seem dumb. I hope not. The context is pitch recognition in music. If you take a musical note, and apply a Fourier transform to it, you will have and infinite sum of amplitudes ...
I am an experienced software engineer and am working on smartphone sensors. I've taken fundamental EE classes in DSP and am trying to apply my knowledge. I believe that I understand convolution, transfer functions, z-transform, etc. I know a little bit about FIR and IIR filters. Now, when reading through software APIs ...
I have found that this is a simple, but bad lowpass filter: $$y(n) = x(n) + x(n-1)$$ However, I can't understand why it is a lowpass filter. What is its cutoff frequency?
I have some code based on Jake Janovetz's Parks-McClellan (Remez) filter generating code. How can I estimate the number of taps required to build a lowpass filter given requirements for pass band ripple and stop band attenuation? I already know how to convert from these requirements back to the filter error deviation. ...
I have the following transfer function: $$H(s)=\frac{s}{(s+1)(s+2)}$$ How can I find the gain and phase response of the above system? I know the first step has something to do with substituting $s = j\omega$ into $H(s)$. How can I find whether the system is stable and whether it is causal?
Lets say I have two objects very close to each other. There is a colour difference between them, but the difference is small. Therefore when finding contours, both the objects are treated like on object. Is there a way to make the difference in colour more significant? As in exponentially increase the small difference ...
I want to split signal in multiple bands and process each band. Number of bands is not yet determined, but it would be more then 6 and less then 11 (depending on the collected results) As demonstrative example, let's consider common linear PCM sound data file input.wav and I want to calculate RMS per each band. Using a...
I'm doing a project in T-wave extraction from ECG signal. Initially I completed the preprocessing steps like noise removal and baseline drift cancellation. Then I need to extract T wave using discrete wavelet transform. I tried different wavelets for different level in wavelet, but I'm not able to extract the T wave. ...
Based on what I read, I've made an algorithm for FM sound synthesis. I'm not sure if I did it right. When creating a software synth instrument a function is used to generate an oscillator and a modulator can be used to module the frequency of this oscillator. I don't know if FM synthesis is supposed to only work for mo...
In one of other discussions : How to find frequency response, stability, and causality of a linear system? I found a comment which was quite strong and definitely caught my attention. An ideal low-pass filter is an example of a system that is not BIBO stable even though its frequency response is bounded for all $f...
What are the different kinds of noise in speech signal? How can I simulate the same in Matlab for adding to a clean speech signal?
I'm new to signal processing. I'm plotting a signal in the time-domain in matlab. I don't understand which parts of the signal are high frequencies and low frequencies, can someone explain what a high and low frequency is, and how to see high frequencies and low frequencies on a graph?
Is there some mechanism to say whether the image is "clean" for the purpose of image processing? For example, in the following image, the topmost row is the cleanest and the bottom one is the least clean. As a result, the top-image gives accurate output; the bottom-one gives less accurate. Examples of noisy and noise-l...
I am providing 2 d grey scale images to the anisotropic diffusion function in MATLAB but not getting desired outputs. How many iterations are ideal and how should i approach this problem?I am keeping kappa values between 20 to 100. I am carrying out the operations on the standard lena image by adding salt and pepper no...
I build a signal, $x$, which is linear in the frequency domain as (in MATLAB syntax) x = 1:0.1:1e3; Then I do: y = (ifft(x)); and I would like to build a binary signal (zeros and ones) from $y$, but I can't define any threshold value such that if y(index) > threshold y(index) = 1 else y(index) = 0 How can I im...
Every time I think I have understood the covariance matrix, someone else comes up wih a different formulation. I am currently reading this paper: J. Benesty, "Adaptive eigenvalue decomposition algorithm for passive acoustic source localization", J. Acoust. Soc. Am. Volume 107, Issue 1, pp. 384-391 (2000) and I have c...
In my project, I have to digitize an ECG image taken with a normal camera (jpeg). For example, I have the following camera captured image: and I want to get something like this:- and then the digitized data (x,y points), like in this video on digitization of ECG I have no idea how to do it, so I searched and consult...
I have a set of pressure data at a sampling rate of 262144 Hz for 3 seconds making it 786432 samples of pressure data. I want to plot a curve of the SPL (sound pressure level) vs frequency. I first converted pressure data to SPL using $20\log_{10}(P/P_{ref})$ and performed a 4096 point FFT for the 192 segments of data ...
I am trying to create a histogram of the depth videos (converted to grayscale first) in order to apply a threshold to keep only highest values, and then do some dilation in order to extract contours. Apparently I am stuck, and besides that i don't know if what I am thinking is the right way to extract contours from dep...
I have discrete time series containing signal with smoothly varied frequency over time (called a "sweep"). How can I design a discrete filter (low-pass or band-pass in my case) of a finite length with linearly varying cut-frequency over time and constant cut-slope? EDIT: the signal is the sampled "trace" of the seismic...
I am working on anisotropic diffusion and the two coefficients proposed by Perona & Malik. I wanted to know what is the use of diffusion in image processing? Why is anisotropic diffusion important and in which fields is it commonly used?
Say I have measurements of a function $y = y(x)$, sampled at $x_i$ with some noise, that could be approximated by a Taylor series expansion. Is there an accepted way of estimating the coefficients for that expansion from my measurements? I could fit the data to a polynomial, but that's not quite right, because for a Ta...
I have a simple single pole low pass filter (for parameter smoothing) that can be explained by the following formula: $$ y[n] = (1-a) y[n-1] + a x[n] $$ The architecture that I'm using has access to single-instruction, multiple-data (SIMD) instructions that can perform multiple vectorized calculations in parallel. I ...
I want to find the line between color blue and color gray in the following picture: More exactly, the end points of that line. Is the Hough transform a choice? If yes how should I set up the picture before using Hough? Any way of solving this would be helpful.
I've read up a lot about this, but haven't been able to piece everything together successfully, so I'm looking for some help. I need to filter 50 Hz from a signal. It looks like the best options are either a notch filter or a LMS filter, but I don't have a copy of the noise so a notch filter seems to be the best choice...
I am currently involved in a project involving programming an imaging sensor. Our sensor is giving us noise, so we want to correct for it. Someone else on the project came up with the idea to take a "black" image i.e. put the lens cap on and take an image that is meant to be all black. (Obviously it is not due to noise...
There are a number of videos that I'm looking to process of different video games to detect various "states" in them. The first game that I am tackling is any edition of Super Street Fighter 4. In it, I'd like to detect when the "vs" character screen comes up. Here's an example of one frame of the video: (taken from ...
If I use a generic filter for generating colored noise like pink,brown,white then how do I modify this statement and how do I know what are the coefficients to be used in AR model for different noise.Signal is white gaussian noise and y gives different noise based on the value of a.
I am currently reading up on and teaching myself ICA from a number of good sources. (Also see this post for past context). I have the basic jist down, but there is something I am not clear about. For a scenario where multiple signals are impinging on multiple spatial sensors, (of course, with number of sensors >= numbe...
I have a filter design, and it filters over a 1-2 kHz range. What should I do if I want to apply it to data with a different sample rate than the one for which it was designed? Let's say it consists of Bessel and Chebyshev filters. How do I find a function that defines each filter's coefficients at an arbitrary sample ...
I load and display an image of some rice in Matlab: g = imread('rice.png'); imshow(g); I take the FFT of this image and shift it: G = fft2(g); imshow(log(abs(fftshift(G)) + 1), []); If I place a x and y axis trough the center of the image; I find that the image is symmetric g(-x,-y)=g(x,y). For a 1D signal we have ...
I am looking for algorithm(s) to solve the following problem: Given a noisy .wav sound capture (some wind + friction noise on the microphone), how to detect the BPM of a soft drum beat? I have attempted googling the subject, but the results are quite poor, due to high amount of mp3 related software for both analysis an...
I need to enhance the visibility of veins on dorsal hand vein images in my project. I use two different even-symmetric Gabor filters bank improve vein visibility. First bank consists of these gabor functions: $$G^\mathit{e}_\mathit{mk}(x,y)=\dfrac{\gamma}{2\pi\sigma^2}\exp\Bigg\{-\frac{1}{2}\left(\dfrac{x_\mathit{\thet...
I have a problem that I thought was going to be simple, but it has become surprisingly stubborn and I question my method... I have used the method (described below), but I wanted to confirm that this was the right approach, and see if there was another method I could use. What I basically have is two wideband signals...
My inputs are several binary images like: They have globally the same content but may be unregistered as they are produced from a hand camera. What I would like to compute is the 2D displacement vector from the first image to the second. I use OpenCV and my first attempt was to compute feature points (SURF algorithm) a...
It seems that I haven't studied enough about FM Synthesis. My current algorithm looks like this: modulator = sin( 2 * pi * fm_freq * i/sample_rate ) carrier = sin( 2 * pi * ( freq + modulator ) * i/sample_rate ) Instead of generating one stable waveform, it generates a sound warping from a pure sine wave to something ...
In a few days I have an exam of image processing. I'm currently having a look at the example exam and I came across this question. "Which transformation of this image is being done here. Explain the components in the quadrants NA (second image)." Na Can anyone help me with this ?
I would like to implement a fourth order fixed point low-pass IIR filter in C (with Q15 arithmetic), and I will prepare this filter by using two stages cascaded direct form-II bi-quad filters. I have found countless C implementations and example coefficients on the digital signal processing books, but I saw non of them...
What are the most used techniques for lip sync (audio/video sync) for conferencing over IP (and related issues with playout buffering)? I could find a lot of paper about audio intrastream synchronization, but only a few dealing with audio and video all together.
I'm interested in finding all tennis courts (and other similar well defined features like basketball courts) in my county, and I have aerial imagery of good (but varying) resolution, but I'm not sure of the best way to find them. Here are two examples of the imagery: I've looked at the various methods, and I think te...
I need to find the bandwidth the signal $x = 50 \operatorname{sinc}(125(t-10))^2$. (Where $\operatorname{sinc}(x)=\dfrac{\sin (\pi x)}{\pi x}$ [normalized] or $\operatorname{sinc}(x)=\dfrac{\sin x}{x}$ [unnormalized]) How would I go about doing this in MATLAB?