instruction
stringlengths
31
27k
There have been discussions on the differences between convolution and correlation, autocorrelation, cross-correlation, et al. In spite of looking at the visualizations, and understanding the formula for calculation of convolution and correlation, I don't understand the need for correlation - is it required for identi...
Let us consider the following code: function [ x ] = generate1(N,m,A3) f1 = 100; f2 = 200; T = 1./f1; t = (0:(N*T/m):(N*T))'; %' wn = randn(length(t),1); %zero mean variance 1 x = 20.*sin(2.*pi.*f1.*t) + 30.*cos(2.*pi.*f2.*t) + A3.*wn; %[pks,locs] = findpeaks(x); %plot(x); end I know peaks in the Fourier domain are r...
I need to implement an adaptive delta modulation encoder and decoder using matlab for my term project. How can I code a good adaptive delta modulation? How can I change delta(or sigma) to follow speech signals better? After that How can I decode it to recover original signal? I am using an algorithm which has that main...
I wish to isolate a crosswalk from its surrounding, and I thought that as crosswalks have a repetitive pattern of thick white stripes, I might be able to isolate them by measuring their frequency range, and using a band pass filter with the right cut-off frequencies. The problem is that I have no idea how to analyze th...
It's well known that convolution in the spatial domain is equivalent to multiplication in the frequency domain. i have multiplied the Fourier transform of an image F with H. where H is the FT of a Gaussian function generated by the following code: function H = gaussian_kernel(size, sigma) half_size = floor(size/2)...
According to my previous question, I have changed the generate command to: y=generate1(100,1000,1); and got the following picture: Now I want to test a wavelet transform on the same signal, which of course exists in Matlab, but I have one thing which I should clarify: generally, as I know large scale values corres...
I am trying to achieve a pattern matching between an image and a scene in which the image is. I am having problems with some images that does not contain corners, since SURF is not able to find keypoints. Does anybody know any algorithm or method for retrieving keypoints in images without corners? In other words: how c...
I am working on Speckle reduction in ultrasound images. I read a paper (snapshot of that paper is included below) where they have used a metric called beta metric which indicates the edge preserving capability of the filters. I tried to implement it using the equation (7) provided in the below snapshot. This is the c...
I'm implementing a spectrogram algorithm and I get the basic concepts, however, I'm struggling with something. Let's say I have a 1D vector: data = [0.36, 0.58, ...., 0.25] I then compute a STFT of this data (with an overlap of say 128) this then produces a 2D array. I then compute the log of these values in order to...
I have the following signal: I'm trying to compute a Spectrogram algorithm, but, don't think I'm doing it right.. I have computed the following: 1) STFT (size 256 with an overlap of 128) 2) Computed the logs using: '10 * log10(sqrt(re * re + im + im) This is the result that I get: But when I use pylab in Python (...
consider the classic scenario of identifying a radar frequency. You typically have a very short pulse of very high RF frequency. For example, a 50ns pulse repeating itself every 1MHz or so (PRF 1MHz and Pulse Repitition Interval 1us) and let's say there are 50 such pulses in each (radar) interrogation so that each set ...
I would like to find the frequency spectrum by drawing magnitude and phase for the following signal: S=sin(2*pi*100*t)+cos(pi*500*t); X=sinc(2*pi*t); Is there something particular to this problem that I should be noticing? We can easily find the spectra giving a time domain like t=0:0.01:0.1; And using the fft comm...
Why is this the most widely accepted model of signal sampling? When multiplying the continuous signal value with the Dirac delta, we get an infinite value. However, if we perform convolution of our signal and the Dirac comb, we get our signal again — how is it useful? The answer to a similar question has been given her...
When I transform an image from the spatial domain to the frequency domain, some frequencies are negative. What is the meaning of the negative sign? For example:
EDIT (after comments and subject matter review) CS is based on a choice of a sensing basis $\Phi$ relative to a representation basis $\Psi$. Using an "Incoherence Property" $\mu$ that measures the correlation between vectors from each basis it has been shown that the CS paradigm can achieve good reconstructions if the ...
A wavelet transform is defined for infinite length signals. Finite length signals must be extended in some way before they can be transformed. I know that periodic replication and zero padding are appropriate for signals that begin and end on the baseline, while mirror -image replication and linear extrapolation provid...
I would like to know if it is possible to search Doppler shift of a carrier with sufficient oversampling while performing code search in the freqency domain. For instance can I selectively drop every X time domain sample bin from the fft processing? Will that not effectively change the input frequency being compared t...
So, I was reading the paper on SURF (Bay, Ess, Tuytelaars, Van Gool: Speeded-Up Robust Features (SURF)) and I can not comprehend this paragraph below: Due to the use of box filters and integral images, we do not have to iteratively apply the same filter to the output of a previously filtered layer, but instead can...
Looking for a Basis representation: Given a sparse or compressible image M, how would one represent this image using a basis A? If I let m = vec(M) m = Ax where A is my "representation" basis and x is the vector of coefficients in the A domain, what is the method for actually getting A?
If I know y (samples) and x (signal), is there a practical matlab algorithm to calculate A in y = Ax?
Given a million data points in say 100d, is there a way to generate an optimal filter bank of say 20 filters from an SVD of the data ? Call the 100d space $F$ (as in Frequency), with coordinates $[f_1, f_2 ... f_{100}]$. There are many bases $V_i$ of $F$, that split the 1M $\times$ 100 data array $ A \approx \sum_{i=1}...
Is there a good online course (with video) for Image/Signal Processing or Matrix Computations that includes a section on the principles of Compressed Sensing?
First, some background: The STFT is the best general-purpose tool I know of for analysing a (musical or other) signal into its component frequencies. For many purposes the STFT works fine, but there are two related problems that make it non-ideal for musical purposes -- 1) the frequency bins are evenly-spaced, not loga...
I am looking to detect a combination of frequencies in the frequency domain. For example, here is my spectrum: And I'm trying to detect the pilot tone. I have the FFT of the pilot tone: which zoomed in looks like this: I tried doing a cross-correlation in matlab: trainingfft = fft(trainingfreq); datafft = fft(idat);...
All of my DSP experience is very much centred in the EM spectrum and I've only ever processed EM-type signals in the past. I'm now doing quite a bit of work in ultrasound and the audio spectrum, but a lot of the techniques I'm using are used in the EM mainly. I'm reading a lot of EM papers about DSP at much higher fr...
How come FIR filters are always stable? Since they contain poles, shouldn't they be more affected by stability issues than others?
Why is it that spectral images appear? I know they appear for $F_s$, but why those replicas appear, I don't know. E.g., sampling $x(t) = sin(1000 * 2\pi t)$ with a sample frequency of 230 Hz. I know it will alias, due to spectral replicas, but why do those appear at all?
Why is it that we Z-transform a difference equation to get a the transfer function of an digital filter? How come a digital filter is given in the Z-domain, and what is the Z-domain? And for that sake, why do analog filters operate in the S-domain, and what is the S-domain?
How does an equalizer prevent a sample and hold effect? Does a reconstruction filter only smooth out the output of an DAC (+S&H) or does it have another function?
Can anyone help me understand where the value of $2$ comes from in the following statement? A time function t whose frequency response is white out to a bandwidth B has about 2 · B · T independent values when measured for the time interval T. This is in the context of a serial stream of digital (e.g. binary) data. T...
while abs(x(i)) <0.05 % Silence detection i = i + 1; end x(1 : i) = []; x(6000 : 10000) = 0; x1 = x.* w; mx = fft(x1); % Transform to frequency domain nx = abs(mx(floor(mel(f))));
This is what I am doing and will be grateful for any help. I selected 16 similar blocks to a reference block from a search block, put them in a 3D array, Wavelet Thresholded them, took inverse transform. These 16 similar blocks belong to one 32 * 32 search block as mentioned above. Now I should multiply each of these ...
I have an EEG signal and it contains eye blink artifacts. I read some references and know that it is possible to detect eye blinks and remove them by using wavelet transforms, but I don't know that how do it. How do I detect eye blinks? After transforming the EEG signal into wavelet coefficients, what should I do and ...
I'm starting to learn about Gabor filters and Fourier series. I need to make a presentation on Gabor filters in a few months, so I need quality references for the presentation. Does anyone have any suggestions on introductory books, useful articles or other similar literature which I may use as references for theory on...
I am able to find out the velocities of pixels using the Lucas-Kanade method. Now I want to use it for tracking. I am using a Kalman filter taking $x$, $y$, $v_x$ and $v_y$ ($(x,y)$ is position of a particular object pixel and $(v_x,v_y)$ is velocity of a pixel) as state variables of the Kalman filter. Now the problem ...
I want to find the partial derivative of an image with respect to its X coordinate. I read that it can be done by convolution of the image with a mask like: fx = conv2(im1, 0.25 * [-1 1; -1 1]) I do not understand how is it calculating the partial derivative - can anyone explain?
I am relatively new to DSP and have been reading a lot on the internet. I have a couple of questions. I have a signal in the form of a function $$ f(x) = A_0 + A_1 \cos(\omega_1 x) + A_2 \cos(\omega_2 x)+...+ A_n \cos(\omega_n x). $$ I have $f(x)$ and I know the minimum and maximum frequencies. $f(x)$ can have really...
I have a 4096 sequence of FFT coefficient. All of which a real values. My sampling frequency is also 4096 samples per seconds. Now I want to make a plot. I know my Y axis would be my FFT magnitude values, but what would my x- axis be. Would it be my sampling frequency, that is 1,2,3,4.........4096?
I have This image which is basically made of sloped lines (almost horizontal and parallel) I tried exactly the code in matlab documentation to detect those lines (except the rotation part) but I got a very strange result (vertical lines detected and no single horizontal line!): I really can't find explanation of this...
I am working on Speckle Noise reduction in Ultrasound Images using MATLAB R2013. I have designed 10 basic filters and trying out hybrid combination using these filters. When I run my program I get different results at different time for the same input image, no other input parameters were changed. When I ran my program...
I am working on an implementation in which I need to apply an FFT to determine which of 4 frequencies are present in a signal. I am doing a 64 point FFT on a buffer which only is partly filled (the remainder of the buffer is zero-ed). When looking at the screenshots of the signal in the time domain, you will notice t...
I've just learned about linear systems and impulse response functions. I know that in a linear system consisting of $h_1[k]$ and $h_2[k]$, the impulse response of the system is $h_1[k] \ast h_2[k]$. In an exercise I was given the following system responses: \begin{align*} h_1(0) &= a \\ h_1(1) &= b \\ h_2(0) &= c \\ h_...
When I select a part of an image and apply a negative function to it, it works 100%: When trying to apply the same method using another function, the part of image becomes black: What is the problem and how can I fix it?
I am sampling two sinusoidal analogue signals that are phase separated by $\frac{2\pi}{3}$, and there appears to be a significant amount of common mode noise in my samples. What, if any approach can I take to improve my SNR?
This question is in two parts, both related in some way or another. Suppose I have a signal where the sample rate is 44100 and compute a normal 1D DFT on this signal. The size of this signal is 220500. I need to compute the Hertz for the outputted DFT. I calculate the bins using the formula below: sqrt(output[i].re * o...
Could you tell me why wavelets without scaling functions can't be used for two-dimensional analysis? What is the role of scaling function?
I have a large collection of oversampled images (family photos of varying 'sharpness' scanned at a uniformly high dpi) and would like to downsample them to optimise storage space whilst retaining detail within some reasonable threshold. I am hoping to find (or build) a tool that can help me identify what I (a confesse...
Thanks for your time to read my question first. I’m new about audio, but I have to make this done: Add a few bytes of data to a sound file and generate a new sound file. If I convert that file to any sound format, these bytes data should still there. When I play that file anywhere, I pick up the sound with mobile phon...
I can understand just fine how to use 1-dimensional interpolation on data points where one coordinate is a function of the other: y = f(x). However, when we have an image, we generally have points in the image that are not given uniquely by such a function, e.g. two points (x1,y1) and (x1,y2), so how do we describe thi...
I want to apply a homomorphic process to an image, and one of the steps involves the imadjust function. The source of this code is http://www.csse.uwa.edu.au/~pk/research/matlabfns/ One of the steps in the homomorphic process is the histogram truncation. This is where toward the end, imadjust is applied like this newi...
When someone says apply gaussian kernel, is that the same thing as saying, convolve it with a gaussian mask?
I am simulating (in Matlab) the transmit portion of a comm system. I generate random data, then I want to modulate it to BPSK, pulse shape the data, and then potentially shift it up in frequency by a carrier. My question is regarding the pulse shaping portion. Atleast in matlab, to generate the root raised cosine fil...
Some background: I am putting a sig-gen signal through an ADC, into an FPGA where I can modify it, out a DAC and up to a SpecAn. All that works fine. I am experimenting with fractional delay filters, coefficients, and IF values (which are just my sine wave coming in for testing). I sample at 200MHz, and I have played...
I have obtained this from Wikipedia about the application of Earth Movers Distance to pattern recognition. Can anybody explain the concept of signature used in this Wikipedia article. Thanks.
I am trying to implement a phase vocoder overlap-add pitch shifting algorithm for part of a plugin I'm writing. I have done this kind of thing offline before and I understand the theory, but this is the first time I've attempted to do realtime processing. This seems to add extra difficulty. Here's my issue: the audi...
I know that 3 conditions must be met in order a pair of stochastic processes $X(t)$ and $Y(t)$ to be characterized as jointly WSS: 1. $X(t)\;\; WSS$ 2. $Y(t)\;\; WSS$ 3. $R_{xy}(t_1,t_2) = R_{xy}(t_1 - t_2) = R_{xy}(t_2 - t_1)$ which means that their cross-correlation function should depend only on the difference $T = ...
We are using phase correlation to find pattern on image and what we get is 15% of results is spurious. Ours pattern has 32x32 pixels and image for research has 32x512 pixels. So we put Pattern to 32x512 pixels image to the left side and the rest of image is filled by zero pixels. Next we apply FFT to pattern and the im...
My professor told me that in sampling a signal, is not usual to respect the Shannon theorem because the interpolation formula contains sines and fractions which are difficult to calculate with a microprocessor. Why is audio sampled at 44.1-48 KHz (Nyquist frequency of audio signals)? Is there a dedicated hardware for ...
Suppose that I need to apply a convolution filter to an image. I want to do it by using the convolution theorem so I compute the kernel for the size of the input image to later calculate fft's and multiply. But I want the fft calculation to be less time consuming. The kernel loses its magnitude the further from its cen...
Currently, I am developing a piece of software for chord recognition. There are FFT and pitch class profiling on it. I tried using the pitch class profile proposed by Takuya Fujishima, but the result is not quite accurate. This may be because I misinterpreted the pitch class profile algorithm. I don't understand the fo...
I have two sine signals with frequencies f1 and f2, and phase p1 and p2. I modulate the phase of these signals to transmit two symbols simultaneously, chosen from the set [0,1,2,3]. For example, I represent 0 by 45 degrees phase shift, 1 by 90 degrees phase shift, etc. The signals will pass through an optical communi...
I am having trouble understanding the example program for audio recording , it comes with PyAudio module. I am using an external Audio Card to record the sound , obviously, the voice should be converted into the digital form to be presented to the computer. But i do not understand how this code converts the input Anal...
I have the following vector and wavelet transform (from R waveslim package) x<-c(0.1,0.4,0.1,-0.05,0.025,0.12,0.42,0.14,-0.15,0.25,0.35,0.23,0.11,-0.35,0.025,0.1,0.4,0.1,-0.05,0.025,-0.12,0.2,0.09,-0.05,0.05,0.15,0.13,0.21,-0.15,0.023,0.1,0.4,0.1,-0.05,0.025,0.12,0.42,0.14,-0.15,0.25,0.35,0.23,0.11,-0.35,0.025) J = 8 ...
What's the correct way. Should I zero-pad a signal before or after applying a windowing function?
I am learning about ADC MCP3422 Chip, because I want to use ADC Pi chip with my Raspberry Pi which is using MCP3424 ADCs, but I am having trouble understanding how the ADC calculation is done in the datasheet. (Data sheet links are available in the end) From what I know of ADCs, An ADC has a bit size. and ADC tends to...
I am trying to develop a filtering routine, using Java, and I am using the windowing method. From my studies, I was told that if I make a plot of the impulse response of an ideal lowpass filter, I would get a SINC graph. In this situation, what am I plotting against (i.e., what values are on the X-Axis?)?
I am a beginner in opencv and have started learning it using visual studio 2012 and opencv 2.4.7 . But i got stuck at very beginning .I want to know about Mat used in Opencv .It is a class and an image name is a variable of this class .i just know this .but still i am feeling like i didn't get it totally like what are ...
This is a rather general question. Suppose I have an arbitrary filter, $F$, defined in the Laplace domain; $$ F=k\frac{\prod_i (s+z_i)}{\prod_j(s+p_j)}. $$ How do I calculate the impulse response of this filter analytically? As a specific simple example, consider the first order low pass filter $$ F_0=\frac{1}{s+p}. ...
Is there any way to remove useless information (unimportant details) from an image? If, for example, we have a specific image, so this contains both useful and useless information. If this image can be recognized directly without the useless information, the unnecessary information can be removed (e.g., illumination, s...
I'm experimenting with a 30 Hz sine wave and I want to extract the frequencies of this, and have implemented the algorithm to do so. This gives a correct reading, well, gives 29 Hz. I'm now wanting to compute the algorithm for an STFT. So, for this, I use NFFT = 256 with an overlap of 128, using the Hanning Window fun...
I'm trying to implement the Iterative Hard Thresholding recovery algorithm for compressive sensing in python. It is a very simple algorithm, given $ \mathbf{y}( = \mathbf{A}\mathbf{x}), \mathbf{A}$, we start with $\mathbf{x}^{[0]}=0$ and update the estimate of $\mathbf{x}$ iteratively with, $\begin{equation} \mathbf{x...
I have a (rough) known period sine wave coming in, held in an array, with superimposed noise. I need to find and count the maxima and minima (in C). Any suggestions or algorithms? The signal has already been received and buffered, so not real time.
I'm having a hard time wrapping my head around doppler and how it affects a digital communications signal's baud rate. The examples that I've seen explain that the center frequency of a signal is shifted when either the receiver and/or transmitter are moving relative to each other. What I don't understand is the why ...
I have a handwritten document which contains graphics, tables, and text paragraphs. I know how to extract graphics from this document. Now I want to know how can I discriminate between text lines and table rows, if I have already segmented the document into lines? You can see an example of a document image below: in re...
What are the best ways to estimate the power spectrum of a given time series? Any pointers to review articles or book chapters would be appreciated. A little more information: When estimating a power spectrum from a time series, I typically use Welch's method (matlab command pwelch) with the default parameters. My un...
I have a chemical spectrum with amplitude on the Y axis and wavenumbers on the X axis, sampling interval I think this is $1.5^{10}$ hertz. I would like to reconstruct the amplitude/time representation of the original signal by performing a ifft of the signal however I have no phase information. Since the information is...
I might be going crazy here. Following my question: here I did some thinking and probably understood that my STFT algorithm was not performing correctly. I followed this algorithm: -> Get 256 of data -> Apply windowing function -> Get the FFT -> get the first 128 points Here is my result. I have used NFFT = 256 which...
Having some trouble understanding this concept, really could do with some advice. I want my STFT to have the following parameters: NFFT = 256 overlap/hop = 128 Now essentially, the algorithm will work as follows: 1) Split the signal into blocks of 256 This will result in around 72*265: 2) For each of these blocks, ca...
I was reading on windowed fourier transform and wavelet transform, and i was thinking that the windowed fourier transform is a subset of wavelet transform. Is that true?
A device is rotating with a particular wind speed and producing such pulse frequencies in a minute: 24.988 25.224 25.212 25.066 25.310 24.963 24.826 24.944 25.490 25.176 24.740 24.988 24.994 24.722 24.510 24.863 25.249 24.931 25.218 24.907 25.459 25.292 25.163 25.447 25.072 25.360 24.976 25.103 25.237 24.845 25.23...
I am trying to replicate the spetrum as given in Audacity and other commercial software... I am getting crazy with the correct scaling needed in order to have dBFS (with reference to a full scale sine wave). Suppose $x_t$ is the PCM sample at $k$ bit precision, first of all I rescale the PCM samples $$ s_t = \frac{x_t...
I'm doing pattern matching by means of normalized grey-scale correlation. My input image is noisy and so the peaks in the correlation plot cannot be found just by thresholding. The original correlation plot displayed as a surface, the peaks are visible, but are not the only local maxima in the picture, I need to find ...
If I have the discrete Hartley transform of a signal of length 2n, how can I use it to efficiently obtain the discrete Hartley transform of the same signal padded to length 2n+m for some m > 0?
I was reading a paper 'A Flexible Framework for Local Phase Coherence Computation' (paper URL) on using wavelets for local phase coherence. I just want to be sure. Is the gabor wavelet the same as the gabor function in the gabor transform (STFT)? If not, can we use a Windowed Fourier Transform instead?
I have a signal that consists of a sine wave, on which I apply a rectangular window and then an FFT. I'm only interested in the magnitude of the sine wave, and I want it to stay the same even if the signal shifts a few samples to the right relative to the window (of course assuming the sine wave has the same amplitude ...
I am new to DSP, so I wan't to know a couple of things. How does µlaw encoding function on a log scale such that you can input 16-bit signals and get the 8-bit µlaw signal output, after compression, and then use that as a building block to expand it back to 16-bit signals. I would love if someone can guide me through t...
I have a question regarding the fourier transform. If I plot the frequency against the fourier transform for a periodic signal and I get a peak, What is the physics behind it? I want to know the physical meaning of it. Why we get a peak and what does it signify? Thanks
I have been using convolution for finding outputs of various systems .I know how to use it.But I still don't know what does convolution exactly means? how one can define convolution ?
I have been experimenting with speaker independent automatic speech recognition. At this point, I understand that the signal is typically segmented into overlapping frames and MFCCs are extracted as features for each frame. A lot of the texts I read talk about reducing the dimensionality of the features using (for exa...
I'm working on a sound card based OFDM system and ran into some problems: How can I perform DAC on the real and imaginary parts of the IFFT? I think they are real numbers instead of 0 and 1. Thanks.
Ok, so I'm kind of moving forward with implementing the STFT. I realise that I was taking the entire FFT and not the first half. The problem that I'm having now is, understanding how to get the Freq bins, what calculation should I use? For example, I have been using this formula: (10 * log10(sqrt(v[i][j].re * v[i][j].r...
Given a difference equation, how do we tell if it is an IIR filter or FIR filter? For example, y(n) = x(n-3)+y(n-1) . Is it FIR or IIR? Can you please give me a way to figure this out? Thanks! :)
I'm trying to implement an sound card-based OFDM modem. A paper says: ...A serial to parallel converter is applied and the IFFT operation is performed on the parallel complex data. Say I have a stream $S$ of complex numbers, then after serial-to-parallel (S/P) conversion, it becomes $S_1$ and $S_2$. But as far as I...
I was reading a paper which uses a filter bank of gabor filters with different frequencies and orientations. However, I often see the construction of a filter bank of gabor filters with different frequencies and scales. I am not sure on the construction of it. How do I construct it, any generic example will be ok. Than...
I'm doing a small overview of different image representations used in image processing and computer vision. For every representation, I would like to have (at least) the following information: the name of the family of representations some basic characteristics of the representation family (what information is retaine...
When output histogram is not same as reference histogram, why is the method called histogram equalization? For example below are two figures from http://en.wikipedia.org/wiki/Histogram_equalization. The output histogram (2nd figure) looks nothing like a discrete uniform distribution. Why is it called "equalization" the...
I sample a continuous signal $s(T)$ over time. This leads to $s[t]$, which depends on several factors of which some are (pseudo-) periodic. I am interested in the effect of one such periodic factors and want to look at signal changes during this period under differing experimental conditions. I know the start and end o...
I'm trying to apply a frequency shift to a generated despreading code in order to find and track a broadcast signal CDMA. Expected doppler shift range of the signal from center frequency would be approx +/- 5KHz. Based on freq2 = c/(c-orbitspeed) * freq1. I am wanting to shift the code based on equations, assuming data...
I was reading and trying to reproduce the results in the arXiv preprint of Periodic Gabor Functions with Biorthogonal Exchange: A Highly Accurate and Efficient Method for Signal Compression by Asaf Shimshovitz et al., and a few questions arose. In brief, the paper outlines a new (as of 2012) family of wavelet-like expa...
A very simple MATLAB experiment: f = 200; fs = 1000; t = 0: 1/fs : 1; x = cos(2*pi*f*t); plot(angle(fftshift(fft(x)))); And here's the output: Now, made a minor change to the above code snippet; reducing the time duration by just 1 sample, as follows: f = 200; fs = 1000; t = 0: 1/fs : 1 - 1/fs; x = cos(2*...