texts:
I am a novice in image processing. As a part of my school project, I have to do the following steps in Matlab on the below image.

Detect the edges of a leaf.
Calculate the area of a leaf (excluding the stem portion)

My friend suggested me an idea of calculating the total number of pixels in the leaf (excluding stem portion) divided by the number of pixels per cm2.

But I don't know how to do these in Matlab. Someone, please guide me.


texts: White noise sound vs harmonic sound reverb

texts:
I use a microphone array to localise a sound source in a small lecture theatre.
I tested it  with white noise and a bird noise source. I found out that the white noise source give very good results. However, bird noise give noisy results.

My question is: does white noise produce less reverb and echo noise?
If so, why is that?


texts:
I have raw data in units of time (sec) vs acceleration (g). I can convert to to the frequency domain, but am unclear about conversion from an FFT to ASD.

For a bandwidth f1 -> f2 is it the sum or average of the squares?:

*Where g1 is the amplitude at f1 * sqrt(2)

$G_\text{rms}^2/\text{Hz} = \frac{\left(\sum\left(g_1^2 + g_o^2 + \cdots+ g_2^2\right)\right)^2}{f_2 - f_1}$
$G_\text{rms}^2/\text{Hz} =\frac{\text{mean}\left({g_1^2 + g_o^2 +\cdots+ g_2^2}\right)^2}{f_2-f_1}$


texts: Calculating the gain for adjusting sound level to X db

texts:
I have a sound signal, and I would like to implement a simple realtime level control (for info, I am using Pure Data, but I'd like to know about the general case).

For this I thought of using the envelope amplitude (in dB) of the input Vin_db, calculated over a window of N samples ; use it to calculate the gain G to apply to the signal to get an output with amplitude Vout_db. (Disclaimer : I am very rusty with maths and decibels ...)

So I took the wikipedia formula for decibels :

V_db = 10 * log10(P / P0)

=>

Vin_db = 10 * log10(Pin / P0)

Vout_db = 10 * log10(Pout / P0)

And this gave me :

Pout = Pin * 10^((Vout_db - Vin_db) / 10)

=>

G = 10^((Vout_db - Vin_db) / 10)

However, this doesn't seem to work ... When I measure the output level it is not the expected Vout. Is there a fundamental flaw in my reasoning ? Or just a calculation error ?

EDIT

Thanks to Paul R I found the correct formula (I need a 20 instead of a 10):

G = 10^((Vout_db - Vin_db) / 20)


texts: What does "invariant to bias and gain changes" mean?

texts:
Reading this paper, about the ECC criterion (which is included in opencv3), In section 3, the following is stated, with regard to the following equation:

(4) $\left\|\frac{i_r}{\left\|i_r\right\|} - \frac{i_w(p)}{\left\|i_w(p)\right\|}\right\|^2$

  It is apparent from (4) that our criterion is invariant to bias and gain changes. This also suggests that our measure is going to be invariant to any photometric distortions in brightness and/or in contrast.

What does "bias", "gain" invariant mean?

Thanks


texts: How to approximate these fuzzy rectangle shapes in binary maps?

texts:
The following binary maps are the results of a measurement I've carried out. I'm looking for a quantifiable measure of the red areas. I could trace rectangles manually (the green rectangle on the upper-right image), but it's hard to motivate their shapes.

Is there a natural (and well-used) method to detect the shapes of these rectangles?

My initial idea was to sum all columns and all rows, and then find the edges through some thresholding. But I'd like some more ideas, because my plan feels quite ad-hoc.


texts: Using FFT to convert to frequency domain, then IFFT back to time domain C++

texts:
I've posted the same question on stackoverflow.com with little success, so I thought I would try here!

I'm using C++/C to perform forwards and reverse FFT on some data which is supposed to be the pulsed output of a laser.

The idea is to take the output, use a forward FFT to convert to the frequency domain, apply a linear best fit to the phase ( first unwrapping it) and then subtracting this best fit from the phase information.

The resulting phase and amplitude are then converted back to the time domain, with the ultimate aim being the compression of the pulses through phase compensation.

I've attempted to do this in MATLAB unsuccesfully, and have turned to C++ as a result. The forwards FFT is working fine, I took the basic recipe from Numerical recipes in C++, and used a function to modify it for complex inputs as following:

void fft(Complex* DataIn, Complex* DataOut, int fftSize, int InverseTransform, int fftShift)
{

        double* Data  = new double[2*fftSize+3];
        Data[0] == 0.0;

        for(int i=0; i<fftSize; i++)
        {
                Data[i*2+1]  = real(DataIn[i]);
                Data[i*2+2]  = imag(DataIn[i]);
        }

        fft_basic(Data, fftSize, InverseTransform);

        for(int i=0; i<fftSize; i++)
        {
                DataOut[i] = Complex(Data[2*i+1], Data[2*i+2]);
        }

        //Swap the fft halfes
        if(fftShift==1)
        {
                Complex* temp = new Complex[fftSize];
                for(int i=0; i<fftSize/2; i++)
                {
                        temp[i+fftSize/2] = DataOut[i];
                }
                for(int i=fftSize/2; i<fftSize; i++)
                {
                        temp[i-fftSize/2] = DataOut[i];
                }
                for(int i=0; i<fftSize; i++)
                {
                        DataOut[i] = temp[i];
                }
                delete[] temp;
        }
        delete[] Data;
}

with the function ftt_basic() taken from 'Numerical recipes C++'. The input variable InverseTransform is simply the direction of the FFT: forward or reverse.

My issue is that the form of input seems to affect the output of the Reverse FFT. This could be a precision issue, but I've looked around and it doesn't seem to have affected anyone else before.

Feeding the output of the forwards FFT directly back into the reverse FFT yields pulses identical to the intput.

However taking the power output taken asreal^2+imag^2 of the forwards FFT and copying it to an array such that:

Reverse_fft_input[i]=complex(real(forwardsoutput[i]),imag(forwardsoutput[i]));

and then using this as the input for the reverse FFT yields regular coupled pulses, with the wrong amplitude and periodicity.

And finally, taking the output of the forwards FFT and copying such that:

Reverse_fft_input[i]=complex( Amplitude[i]*cos(phase[i]), Amplitude[i]*sin(phase[i]));

where the Amplitude[i]=(real^2+imag^2)^0.5 and phase[i]=atan(imag/real) yields a really mess output in the time domain, with a peak towards the middle, resembling the power spectrum in the frequency domain.

My question is, is it the precision of the cos and sin functions which cause the output of the reverse fft to become like this? All variables are stored as type 'double'. Why is it that there is such a massive a difference between the different methods of inputting the complex data, and why is it that only when the data is directly fed back into the reverse FFT that the data in the time domain is identical to the original input into the forwads FFT?

Thank you.

( I would have posted pictures but unfortunately I can't do that yet...)


texts: Additive but not homogeneous continuous system?

texts:
I am trying to find an example of a continuous system that is homogeneous, but not additive.
So far, the only example I could find was an example from this page, which describes system as $y(t) = \overline{x(t)}$, where (as I understand it) $\overline{a}$ is the conjugate of a complex number $a$.

This, however, will work for a scaling constant $a$ that is complex, but not real, and I am wondering if it is possible to find a system $S$ which is additive, but not homogeneous, and this holds even when we scale the input signal with a real constant?

I have been thinking a lot about it and I could not come with an example, nor could I prove it does not exist


texts: Phase shift and phase spectrum terms in multidimensional signal

texts:
I know about phase of a 1D signal. But when I go into higher dimensions like 2D,3D etc, it becomes headache to grasp the concept.

What are the terms phase shift and phase spectrum mean in case of multidimensional(2D,3D etc.) signal like an Image or video signal?
How is the phase term represented mathematically?
How do we analyze phase spectrum?
Which information do we get from phase spectrum about the signal?
Can anybody explain with a plot or figure ?


texts:
I'm trying to review MLE (maximum likelihood estimation).

What does it mean when one model fit the data better than does a comptitor model?


texts: What is the difference between Image Inpainting and Image Denoising?

texts:
Both of them seem to do the same task. Wherever the pixel values within the image refers to something that was not there in the original image, we call that pixel to be affected by noise. If this noise is less, we apply noise reduction. When the pixel refers to totally random value, we apply image inpainting.

So is image inpainting just an extreme case of image denoising?

Also if a large portion of pixels get affected, we call that a "noise" and need to apply denoising algorithms; whereas when a small portion gets affected like a scratch on the image, we apply inpainting techniques. But my question is: that scratch can also be regarded as a noise only. So why dont we call that process image denoising?


texts: Speaker diarization tool for acoustic analysis

texts:
I'm researching certain acoustic prosodic features during live clinical interactions. Because of the setting, the recordings always have cross channel bleed, and in some cases everything is recorded on one channel (e.g., collaborations with people that have a video database).

I need to diarize the speakers for audio analysis, but I don't have the skills to do it myself. I was wondering if you know any tools I can use for that, it doesn't have to be free, but I don't have a big budget.

I have tried the LIUM tool, which gives me a .seg file, but I'm not entirely sure what to do with it (I need two separate audio files), especially because it doesn't seem to have diarized my audio correctly.

Thank you!


texts:
I was wondering how a diagram like this is generated.

I am generating a QPSK signal using MATLAB by taking a cos and sin wave, multiplying each one by either 1 or -1 and adding them together to form a real valued QPSK signal. I then simulate an AWGN channel and send it to my demodulator. I mix it down using another cos and sin wave plus Low Pass Filter to get my recovered I and Q data. At this point I am left with the baseband which I can recover my data from by taking the angle of the I and Q components.

I am wondering at what point in that chain I could generate a the plot I post above.

Thank you


texts: Discrete Fourier Transform for beginners

texts:
I want to make image processing programs which talk about homomorphic filter. But when I read some articles, I can't get it. Maybe can anyone help it. I very need this. Sorry about my english.

I change spatial domain image to frequency domain with discrete Fourier transform. Right?
Formula Forward DFT:

What are M and N? Width and height of image?
and then, the output from forward formula, real and imaginary part? like "a+bj"?

When I try to inverse the Fourier transform with the formula:

F(u,v) is the result from forward dft? but it has 2 part real and imaginary? if,
F(u,v) = (a+bj) and result euler theorem e^... = cos(x)+j sin(x).

  So, F(u,v).e^... = (a+bj).( cos(x)+j sin(x) ) = a.cos(x) + j(a.sin(x) + b.cos(x)) - b.sin(x)

my equation correct ?

the result of inverse real and imaginary part again? because have "j".
how can i get my original image? take the real part, just make my image get blurred

THX for reply..


texts:
I have a blurred and noisy image $X$, I want to apply the Wiener filter on it and get a deblurred and denoised image $Y$ (i.e apply inverse of blurring filter while at the same time reducing some noise, if not accentuating it). I'd like to measure the SNR in both in order to evaluate the quantity of noise deleted.

I know the formula to calculate the SNR is:

$$SNR = \frac{P_{signal}}{P_{noise}}$$

However, how do I estimate the SNR in the real world, given just the noisy image $X$?


texts: information filter instead of kalman filter approach

texts:
I read many sources about kalman filter, yet no about the other approach to filtering, where canonical parametrization instead of moments parametrization is used.
So I would like to learn on examples how to use this filter with information matrix and information vector (not mean and covariance from KF).
Can anyone help me with this, give some examples, webpages, or parts of implementation code to be a basis to learn?
Really appreciate!


texts: How to classify the movement type of a target into two categories(direct motion or else) by using a doppler radar?

texts:
How to classify the movement type of a target just into two categories(one is direct motion which is almost straight line movement and the other is anything else) by using a doppler radar with a microdoppler technic, or the spectrogram of the doppler frequency?

Could you recommend a paper, patent, and something like that related to this issue?

Thank you so much.


texts:
In some places, it is said that z is equal to:
$$z = e^s \quad where \quad s = \sigma + j \Omega $$
But in some places, it is said that z is equal to:
$$z = e^{sT_s} \quad  $$
where Ts is a sampling interval.
Why are there two different definitions?


texts: How to set the "duration" parameter for a flanger with LFO oscillator

texts:
I am reading this book Designing Audio Effect Plugins in C++: For AAX, AU, and VST3 with DSP Theory. Here I implemented the Flanger effect. Quick summary: A flanger effect is basically a echo effect but the delay parameter is changed with an LFO oscillator to give the "flanging" sound.
Here is the graph:

My problem is this version of flanger only has the following properties:

In modern DJ equipments you see flanger with options such as "1beats,2beats,4beats...". What I noticed is The smaller lfoRate is the longer my flanger effect becomes. So If I set lfoRate around 10.26, my flanger becomes 1/8beats flanger. The book does not mention anything related to this. So I wonder what is the relationship between lforate and "Xbeats" of flanger. Lets say that my music is 128 bpm, is there is a special formula which is used to calculate lfoRate so that I have 4 beats flanger?


texts:
Show that the Hilbert transform of $h(t) = m(t) \cos(2 \pi \nu_c t)$ is

$$\hat{h} (t) = m(t) \sin(2 \pi \nu_c t),$$

where $m(t)$ is a real valued, band-limited function (i.e. we have Fourier transform $M(\nu) = 0$ for $|\nu| > \nu_m$) and $\nu_c > \nu_m.$

Attempt

I did some research and I found out that this result follows directly from 'Bedrosian's theorem'. But I am required to compute this by first finding its analytic signal $h_a$ whose imaginary part would then be the Hilbert transform. Here is my expression for $h_a (t):$

$$h_a (t) = 2 \int^\infty_0 \Big[ H(\nu) \Big] e^{j 2 \pi \nu t} \ d\nu = 2 \int^\infty_0 \Big[ \frac{1}{2} (M(\nu + \nu_c) + M(\nu - \nu_c)) \Big] e^{j 2 \pi \nu t} \ d\nu.$$

I have used the 'modulation property' of the Fourier transform to get to the RHS. So how can I proceed with the integration when we do not have an explicit expression for $m(t)$?


texts: Derivation of downsampling in the frequency domain

texts:
I'm having some trouble with this derivation

$$s_d = \begin{cases}1&\text{for}\quad m\quad\text{multiples of}\quad D\\ 0 &\text{otherwise}
\end{cases}$$

then $s_d$ is somehow rewritten to:

$$\frac{1}{D}\sum_{k=0}^{D-1}e^{jk2\pi \frac{m}{D}} $$

Can someone explain this?

EDIT:

Basically the same derivation as done here
Frequency Representation of Downsampled Signal


texts: Why are all real frequencies located on the Imaginary axis of the s-plane. I'd like to understand intuitively why this is true?

texts:
so my question is the following : "Why are all real frequencies located on the imaginary axis of the s-plane. I'd like to understand intuitively why this is true?"

My guess would be that any "real" frequency has a constant amplitude in the time-domain, which is only true for frequencies with real part equal to zero.

Is this right? Or how should I know intuitively that the statement about real frequencies lying on the imiganiry axis is true?


texts: Should I consider rgb values of a pixel as one value?

texts:
I was reading this paper for a project work.

  We train on 1.6 million 32*32 color images that have been preprocessed
  by subtracting from each pixel its mean value over all images and then
  dividing by the standard deviation of all pixels over all images.

I've trouble distinguishing between "from each pixel its mean value over all images" and "standard deviation of all pixels over all images".

Since, I'm dealing with color images, can I just take rgb values of each pixel as one value or should I calculate the mean and SD for every color differently?

For example if I have r=255, g=255, b=255, can I take pixel value as (in binary), (r<<16)+(g<<8)+b ?


texts: What version of sinc function to use ? (With additional factor of $\pi$ or not.)

texts:
I have an exam tomorrow on Signal Processing and one of the questions can go two ways:

Use a Hamming window to design an Nth
th order (N+1 tap) band pass FIR filter with a pass-band
between $f_0$-$f_1$ and a sampling frequency of $f_s$Hz
Following the windowing method of FIR filter design, use a Hamming window to design a
Nth order (N+1-tap) FIR lowpass filter with a cut-off frequency of $f_0$ Hz and a sampling rate of $f_s$Hz.

Now I have a slight problem with how the questions are answered in Mark Scheme for previous paper. For the band pass he uses this definition of $sinc$:
$$sinc(x)=\frac{sin(\pi x)}{\pi x}$$

While for the low pass he uses
$$sinc(x)=\frac{sin(x)}{x}$$

Here are the extracts:

Even in the first case he states that

But then his answers for $h[n]$ follow the $\pi x$ version of the sinc. I have a suspicion that he used matlab to evaluate the numbers and matlab in fact is using the $\frac{sin(\pi x)}{\pi x}$. During the lectures the only way we were taught to define sinc was in the "normal version" without $\pi$.

But then again looking at Wiki article about sinc. It states that the version with $\pi$ is commonly used in signal processing. Could someone tell me what to use and when? Thanks.


texts: Kalman Filter - Position/Velocity from Accelerometer and periodic position measurements

texts:
I am trying to implement an EKF to estimate my position and velocity states by using accelerometer measurements as well as periodic GPS (position) measurements.  Basically I want to use the constantly use the accelerometer and re-calibrate it for every position measurement that is available.  When there is GPS dropouts, the estimates rely solely on the accelerometer readings.

I believe I have it working if all measurements are available.  Since my acceleration is not one of my states, my accelerometer measurements are used in the predict side of my filter.  The position measurements are in the update side like normal.

If a position measurement is unavailable, what do I do during my update?  Without a position measurement, am I basically just saying that a priori estimate is equal to my posteriori? (i.e. my "pretend" position measurement is just my estimated position).

Or is there something fancier that has to be done?  Is there issues with the system not being "observable" (i.e. observability matrix not full rank) when the position measurements are not available?

Thanks in advance!


texts: Low-Pass FIR that keeps all values positive

texts:
Let's say, that I want to low-pass the norm (hence positive values)  of an analytic signal (related to Hilbert transform). This allows me to perform experiments with the envelope of audio.

For low-passing, I apply a Gaussian blur. It's technically the same as applying multiple time a moving average.
The advantages of a Gaussian blur are:

easy to implement, and enough fast.
good attenuation in the "stop band" (I just have to iterate more moving average to improve this).
all values remain positives. This is important, because  I use the low-passed norm to perform divisions.

But I'd like to test a low-pass with a narrower transition band.

Could you suggest me a simple solution, for a low-pass FIR (or something "linear phase" anyways) , with a narrower transition band than a straightforward Gaussian blur, and that allows to keep all values positive. For instance, with a sinc based FIR, there are oscillations around the zero line, and I want to avoid that. Adding an offset is out of question, as I want a result that is representative of the amplitude of the audio.


texts: Why can FFT only operate on images with specific properties?

texts:
Can FFT only operate on Grayscale images? If Yes, why?
Can FFT only operate on images with dimensions of power of two? If Yes, why?


texts:
I'm trying to transform a time series with a recursive filter to model a feedback.

I was able to do a simple filter like :

Y[t] = x +αY[t-1]

a[0]*y[n] = b[0]*x[n] + b[1]*x[n-1]

with scipy.signal.lfilter

scipy.signal.lfilter(a,b,my_timeseries)

but i don't know how i can model this kind of transformation with a filter:

Y = α (1 - e^(1 - β x)) + Y[T-1]

the desired effect is:

x = time_series data
feedback = .35
alfa = .40
beta = 10
transformed = np.empty(len(x.values))

for k in range(0, len(transformed )):
if k == 0:
    transformed[k] = x[0]
else:
    transformed[k] = (alfa* (1-np.exp(-beta*x[k])) ) + feedback*transformed[k-1]

can someone tell me what kind of filter is it?
and how i can define it with scipy.signal


texts: What is meaning of a signal having a "finite number of maxima and minima during any single period of time"?


texts:
According to this page, the Baudline software tool implements

  ...the uHz-rotator algorithm that operates in the complex domain to
  calculate an extremely accurate estimate of the frequency.

Furthermore

  Under good conditions (strong signal and low noise) the frequency
  accuracy can exceed 8 significant digits (~.000001 Hz).

I tested it with a signal generator (ToneGen). For 82.41 Hz (E2) it displays 82.40999 with averaging and 82.4 without (the rest of the digits keep spinning). The FFT size is only 2048 and the sample rate is the standard 44100Hz.

To compare, an implementation I'm working on, which employs quadratic interpolation, has a poor estimate of anywhere between 84 and 86Hz. The phase difference estimator isn't doing much better. In both cases I only get the precision to the first decimal when I increase the FFT size to 8192.

What is this uHz algorithm and how do you get such precision?


texts: Fitting a polynomial to a ridge in an array

texts:
I have an array of numerical data. Say,
%% setup an array of gaussians where the mean is quadratically swept
p = [0.15,-0.3,1];
mu = polyval(p, 1:8);
sig = 2;
tmp = (1/(sig*sqrt(2*pi)))*exp(-(1/2)*(((1:8)'-mu)/sig).^2);
%% add interference
tmp(6,5) = 1.2/(sig*sqrt(2*pi));
%% add noise
tmp = tmp + 1.5e-2*randn(size(tmp));

Assuming that the gaussians are oversampled (sample maxima are close enough to true maxima).
I would like to estimate p from the output array, p_hat.
I have been looking at it for some time, and I cannot twist my head around how to relate this to stuff that I know.

The most straight forward solution would be to take the maximum of each column, do a 1-d fitting using ordinary least squares, solve the outlier somehow. But then the column containing the outlier is not counted at all. I was hoping to be smarter than that, to improve the fit by depending on the secondary (true) peak of the interfered column.
On the face of it, this sounds related to ordinary least squares. But there are 2 independent variables (x-dim and y-dim). And the data is not a sparse point-cloud of "binary" data, but rather a uniform sampled array with amplitude.
The thought to traversing the array left to right (making assumptions of continuity and start or end-point) in a linear-programming kind of way occured to me, but then I would be fitting a continous line with constraints, rather than a parametric polynoma.

I prefer to not use toolboxes. Thanks for any ideas!


texts: Reliability of normalized cross-correlation with high lags

texts: Say you have two signals with 100 data points in each signal. Then there are 20 time lags where the computation of the normalized cross-correlation between those signals only considers 10 or less pairs of data points. It seems like the normalized cross-correlation is less meaningful at these lags because it is computed from less data. My question is, is there a general way of accounting for the uncertainty introduced when we look at the correlation with higher lags? Or does that vary too much based on the context?


texts: Types of interpolation used for reconstruction in DSP?

texts:
What are the different types of interpolation used in DSP for reconstruction of analog signal from discrete/digital signal

I am able to somehow learn two types of interpolation
1st is "zero order hold interpolation"and 2nd is "linear interpolation(first order interpolation)"

Reconstructed output looks like stair case or square wave for zero order hold interpolation while reconstructed output for linear interpolation(1st order interpolation) looks like a triangular wave

There are other types of interpolation besides above?

What are those types?  (That types give a much better/smoother reconstructed signal as compared to two types i discussed above)

What is the order of polynomial in those types (just like "zero order hold" type had zero order and "linear interpolation" type had order one)

For those other types of interpolation, what/how are the appearances/looks of reconstructed output waves ? (Please kindly try to include those wave graphs in your answer)

By reconstruction, i mean conversion of digital into analog signal


texts: Why do we substract a background image and not divide it?

texts:
Subtracting a background image for background correction is the standard way of doing background correction to obtain the foreground.

I am wondering if there are situations, where it would make sense to divide with the background image instead.

For example, it seems that having a uniform image intensity after division could be beneficial in interpreting an image. E.g in microscopy images.
It also seems physically more intuitive to have uniform baseline intensity after background correction/division than to have zero baseline intensity due to subtraction.


texts: Cancelling out known signal with sampling offset

texts:
I would like to cancel out a known audio signal at my receiver.

Specifically at my transmitter I am playing a song, and at my receiver I am recording it. Both transmit and receive sampling rate is 44.1kHz.

At the receiver I basically want to null out the song so that the only thing that is left is the ambient noise in the room.

When I lined up the received and transmitted signal, I noticed that there is sampling offset so I cannot simply subtract out the transmitted signal.

Are there tools in Matlab that are designed for this task?
And what are the general principles I can use to solve this?


texts:
I have developped an application for image inpainting. Now I want to claim that it can be used for realtime purposes.

Does somebody know a paper which gives some boundaries for realtime applications? I want to refer to a paper to prove my assumption.


texts: Why can you use the one-sided laplace transform to solve differential equation describing a causal LTI-system?

texts:
In an example, an equation describing a causal LTI-system is
$$
(D^2 + 5D + 6) y(t) = (D+1) x(t)
$$
where $y(t) = y_{zs}(t) + y_{zi}(t)$ and the initial conditions are $y(0^-) = 2, \dot{y}(0^-) = 1$.
$x(t) = e^{-4t}u(t)$ and we want to calculate $y(t)$.
My teacher said in an example of a solution that because $x(t) = 0, \quad t < 0$ we can take the one-sided/unilateral laplace transform of the RHS (since then the unilateral and bilateral laplace transform are the same, I guess ). Further, the explanation continued with that because the system is causal, the impulse response $h(t) = 0$ for $t < 0$ and therefore $y_{zs}(t) = (x*h)(t) = 0$ for $t < 0$. Therefore, supposedly, $y(t<0)=0$ and we can take the one-sided laplace transform of the LHS too.
I am questioning the part in boldface, because what about the zero-input response $y_{zi}(t)$, how do we know its value for $t<0$? I would like to belive it is not equal to $0$ for $t<0$ due to the initial conditions given at $0^-$ not being zero and $0^- < 0$. If it is not equal to $0$ for $t<0$ how can we know we can take the one-sided laplace transform of the LHS?
Note: I also read this question in which it is stated that non-zero initial conditions make the system non-linear and time-varying, which also makes me think the equation at hand is inconsistent with the fact that it describes an LTI-system?
Edit 1 in response to the comment about Lathi's linear systems and signals:
I did not remember that this example was indeed from the book, but I have read the example and the section "Comments on initial conditions at $0^-$ and at $0^+$ " before. The section explains that we cannot expect the total response $y(t)$ to satisfy the initial conditions given at $0^-$ at $0$, which makes perfect sense I think since $0^- \neq 0$. It goes on to say that there is another version of the laplace transform, $L_+$ that is not as convenient to work with. The author's discussion might have gone a bit over my head, because unfortunately I can't understand how it answers my questions, that is how we can assume $y(t)$ to be causal (in order to use the unilateral laplace transform on both sides of the equation) and the note about the non-zero initial conditions implying the system to not be LTI.
The reason I have not accepted the answer given so far is that it is a bit to advanced for me to judge its correctness and therefore I wanted to wait a bit in case there would be more input for my question. But eventually I will just assume it is correct and accept it.


texts: Convolving a discrete time sequence with a continuous-time filter?

texts:
I am a newbie to DSP, and have what seems to me a fundamental question.

I have a discrete-time sequence $g[n]$ of length $N$. I am supposed to pass this signal through a root-raised cosine filter $h_1(t)$ with a cut-off frequency of $F= 1/T$, to obtain a continuous time signal $x(t)$:
$$
x(t) = \sum\limits_{n=0}^{N}g[nT]h_1((t-n)T)
$$

Is this a correct expression to obtain the continuous-time signal?
Then, $x(t)$ is convolved with a second continuous-time filter $h_2(t)$ to obtain $y(t)$:
$$
y(t) = x\star h_2 (t) = g\star h_1\star h_2(t)
$$

where $\star$ denotes convolution. I am not sure how to expand the above expression in terms of summation or integral, as $g[n]$ is discrete-time and the other two filters are continuous-time.
Finally, I sample $y(t)$ at rate $F = 1/T$ and pass it through $h_3[n]$ to obtain the signal $z[n]$. The filter $h_3[n]$ the discrete-time counterpart of $h_1(t)$, i.e. $h_3[n] = h_3[nT] = h_1[nT]$. Here, I have the same problem as 2. above. I am not sure how to expand the following in terms of summation or integrals, now that this is a mix-up of discrete-time signals $g[n]$, $h_3[n]$ and continuous time signals $h_1(t)$ and $h_2(t)$:
$$
z[n] = z(nT) = y(nT)\star h_3(nT) = x\star h_2\star h_3(nT) = g\star h_1\star h_2\star h_3(nT)
$$

Can I interchange the convolutions in the above as follows?
$$
g\star h_1\star h_2\star h_3(nT) = g\star h_1\star h_3\star h_2(nT)
$$

Any help or hints would be greatly appreciated!

-ryan


texts: Offset QPSK detection in GNU Radio - Sample delay

texts:
An OQPSK detector is being tested in GNU Radio. The architecture was obtained from Michael Rice's Digital Communications - A discrete-time approach. The flowgraph is shown below.

The modulator architecture is basically QPSK delayed by half the sample rate, as shown below. In the flowgraph, the block oqpskIQMap maps the I/Q symbols from QPSK to OQPSK. It does so by delaying the Q-channel by d_delay, which is equal to the number of samples per symbol divided by two.

oqpskIQMap_impl::oqpskIQMap_impl(int sps)
      : gr::sync_block("oqpskIQMap",
              gr::io_signature::make(1, 1, sizeof(gr_complex)),
              gr::io_signature::make(1, 1, sizeof(gr_complex))),
        d_delay(sps/2)
    {
        //set_history(d_delay);
    }

    /*
     * Our virtual destructor.
     */
    oqpskIQMap_impl::~oqpskIQMap_impl()
    {
    }

    int
    oqpskIQMap_impl::work(int noutput_items,
        gr_vector_const_void_star &input_items,
        gr_vector_void_star &output_items)
    {
      const gr_complex *in = (const gr_complex *) input_items[0];
      gr_complex *out = (gr_complex *) output_items[0];
      for(int i = 0; i < noutput_items; i++)
          out[i] = gr_complex(real(in[i]),imag(in[i - d_delay]));

      // Do <+signal processing+>

      // Tell runtime system how many output items we produced.
      return noutput_items;
    }

The receiver architecture from Rice's book is shown below. In this architecture, the match-filter produces 2 samples per symbol. The oqpskIQDemap block processes the output samples (X(KTs), X(KTs + Ts/2), Y(KTs) and Y(KTs + Ts/2) into a constellation point (X(KTs) ,Y(KTs + Ts/2)), effectively reducing the sample rate to 1 sample per symbol.

oqpskIQDemap_impl::oqpskIQDemap_impl(int delay)
      : gr::sync_decimator("oqpskIQDemap",
              gr::io_signature::make(1, 1, sizeof(gr_complex)),
              gr::io_signature::make(1, 1, sizeof(gr_complex)), 2),
        d_delay(delay)
    {}

    /*
     * Our virtual destructor.
     */
    oqpskIQDemap_impl::~oqpskIQDemap_impl()
    {
    }

    int
    oqpskIQDemap_impl::work(int noutput_items,
        gr_vector_const_void_star &input_items,
        gr_vector_void_star &output_items)
    {
      const gr_complex *in = (const gr_complex *) input_items[0];
      gr_complex *out = (gr_complex *) output_items[0];

      for(int i = 0; i < noutput_items; i+=2)
          out[i] = gr_complex(real(in[i]),imag(in[i + 1]));

      // Tell runtime system how many output items we produced.
      return noutput_items;
    }

The transmitted constellation (top) looks pretty okay. The Rx constellation (bottom), on the other hand, seems to have some points crossing the boundaries unexpectedly, given that the SNR is 25 dBs. I suspect the problem is with the way I introduce the delay in the two IQ map/demap blocks.

Please do let me know what you think.

Regards,


texts: To what extent can we see signals that fall between frequency bins?

texts:
I have a simple problem I would like to figure out for fourier analysis of seismic data.

Let us say that we have a signal $z[n]$, of length $N$. If I take its (same size) FFT, I will get $Z[k]$, also of length $N$.

I know that zero-padding will not improve my resolution, however, what I am trying to figure out is: If I take an $N$ length FFT, is there ANY risk that I will be missing some information, that would have otherwise shown up had I taken a greater than $N$ length FFT instead?

The case I worry about is if my seismic signal has energy at a frequency that lies between frequency bins. How well would it show up - or not show up - if I do not zero-pad? I would not want to miss this signal should it in fact exist. Cheers.


texts: 80-tap Decimation Filter: divide into stages? / Cost of having a number of taps

texts:
I did a FIR filter hardware implementation with 80 taps (FPGA/VHDL). I will use it later as the decimation filter.
My questions:

Does the number of taps affect a cost of implementation of FIR?

FIR  filters  belong  to  the  class  of  linear  filters,  the  combination  of  N  lower  order  filters  can  create  the desired FIR filter of the higher order. So I was thinking If it makes sense to implement the  combination  of  N  lower  order  filters instead of a one 80 taps filter?

Is the decimation  implemented in one stage usually?

EDIT 1

What is a difference between "filter ( convolution)", " polyphase filter" and "polyphase filter bank"?

Honestly, I dont know ny difference in an implementation.


texts:
I am looking for a clear and precise explanation of how an OFDMA modulator in downlink LTE operates. I have many books that explain it but each has its own way and do not answer my questions completely. If you believe this questions better fits in another forum please let me know (maybe some PHY layer forum).

My understanding is that an OFDMA modulator consists of the following steps:

a block of bits for each user are first coded using a error correction code.
the stream of bits for each user are then mapped to symbols for example QAM symbols.
There is Serial to Parallel converter, now the QAM symbols for each user are parallel.
Subcarrier mapping ? ( I don't understand this step)
The QAM symbols are input to the L IFFT (L being number of subcarriers)

According to LTE specifications, resources are allocated to users in units of resource blocks over a subframe (12 subcarriers over 14 OFDM symbols) i.e, 168 resource elements.

What does this mean, is there where step 4 comes into place? So is each user's QAM symbols being transmitted over 12 subcarriers and not over all available subcarriers?
What happens in the next subframe? Then why do we perform L point IFFT? how does then one compute the rate for each user over a subframe or frame basis?


texts:
Flanging is defined as a mix of two identical signals where one signal is delayed in time by a small and gradually changing period, around 10-20 milliseconds.

Since delay in the time domain is equivalent to a phase shift in the frequency domain, could then a Flanging sound effect be done in frequency domain?

Could we do a DFT transform, make a copy of amplitudes and phases, shift phases (and gradually change the shift between -180 and +180 degrees), and add the result to original amplitudes and phases?


texts: Fourier Slice Theorem - Reconstruction Fourier Space

texts:
I've stuck in one problem. I need to perform Fourier Slice Theorem on sinogram of medical image.

I read a lot about this theorem. I write a matlab code but results are always non-sense after inverse fourier transform. But Fourier Space seems alright.

I fill Fourier space with converting polar coordinates to cartesian coordinates. I apply 1 Dimensional Fast Fourier Transform with ftt command on every sinogram lines. After for each angle (I used 180 rotation angle) and radius value I convert it to cartesian coordinates and for each corresponding values G(theta, radius) ==> F(x,y) I filled up Fourier Space. It seems logical but results is not. How can I correct my code to run this algorithm?

Circular shape is Fourier Space, other nonsenseless image is ifft. Original image is binary liver but I can't add it.

Thank you!

Plus, my matlab code!

[![I=imread('binaryliver.png');

% I = im2bw(I, 0.1);
%Sinogram was calculated before for 180 angle!
\[w,h\] = size(I);

theta = 0:1:179;][1]][1]

xorg = floor(h/2);
yorg = floor(w/2);  %for find origin of matrix

F = zeros(w,h);     %fourier space assigment

for i = 1:length(theta)

    E(:,:,i) = fft(sinogram(i,:));  %calculate FFT for each line of sinogram

end

for i = 1:length(theta)

    for r = 1: length(E(:,:,1)) %Convert polar coordinates to cartesian coordinates

        x = xorg + (r-h/2+1)*cosd(-theta(i));
        y = yorg + (r-w/2+1)*sind(-theta(i));

        if x == 0 && y == 0   %

        else
            yy = round(y); xx = round(x);

            if yy <= 0

                yy = 1;

            elseif yy > h
                yy = h;

            end

            if xx <= 0

                xx = 1;

            elseif xx > w

                xx = w;

            end
        value = E(1,r,i);
        F(xx, yy) = value;
        end
    end

end

Im2=abs(ifft2(F));
figure; imshow(log(1+abs(F)),[]);

figure; imshow(Im2, []);


texts: Methods to quantify randomness (or complexity) in a signal

texts: What are the methods through which we can quantify the randomness or complexity in a given signal. I know spectral flatness measure (geometric to arithmetic means) is one way to do it, but what are other common techniques?


texts: What are real-valued and complex signals and why is the Fourier transform of a real-valued signal Hermitian?

texts:
I have confusions in these concepts:

What are real-valued signals?
What is the difference between it and complex signals?
Why is it so that for real-valued signals, the spectrum of negative frequencies is the complex conjugate of the positive frequencies?


texts: Proof of properties of Fourier series in CT

texts:
I feel problem in understanding the proof of Fourier series properties

Time scaling
\begin{align}
b_k &= \frac{1}{T}\int_{T}x(t)e^{jk\omega_0t}dt\\
& = \frac{a}{T}\int_{T/a}x(at)e^{jk(\omega_0a)t}dt\tag{$\scriptstyle{a - \text{scaling factor}}$}\\
& = \frac{a}{T}\int_{T}x(L)e^{jk\omega_0L}\frac{dL}{a}\tag{$\scriptstyle{L=at}$}\\
&= \frac{1}{T}\int_{T}x(L)e^{jk\omega_0L}dL = a_k\\
\end{align}
For this I want to ask that how $T/a$ term in the integral changes to $T$, and $dt$ changes to $dL/a$?
Multiplication
\begin{align}
x(t)y(t)&= \sum^{+\infty}_{k\ =\ -\infty} a_k  e^{jk\omega_0t}\sum^{+\infty}_{k\ =\ -\infty} b_k  e^{jl\omega_0t}\\ &=\sum^{+\infty}_{k\ =\ -\infty} \sum^{+\infty}_{l\ =\ -\infty} a_k b_le^{j(k+l)\omega_0t}\\
&=\sum^{+\infty}_{m\ =\ -\infty} \left[\sum^{+\infty}_{l\ =\ -\infty} a_{m-l} b_l\right]e^{jm\omega_0t}\tag{$\scriptstyle{m=k+l}$}
\end{align}
I couldn't understand this last step, why the summation changes from $k$ to only  $m$? Shouldn't it be $m-l$ and also is it done here to prove the multiplication property? or there are more steps?


texts: Does gray coding bring improvement to SER of QPSK, compared with natural coding?

texts:
I understand gray coding contributes to BER of QPSK, yet really don't understand why it brings improvement to SER. According to the relationship of SER and BER, it should be improved. Actually, when mapping the symbol to constellation points, the minimum distance between two different points remains the same, and that induced the same SER. It really bothered me much.
Any comments would help!Thanks!


texts: Audio processing -- difference between block and sample-by-sample?

texts:
If a system operates on a signal with a time-domain IIR or FIR, why would an acquisition system chunk the audio into powers of two? I can understand filling a buffer by a power of two for an FFT operation. Is there a difference?

I am still confused by the difference between block processing and sample by sample processing. Some clarification would be greatly appreciated.


texts: What should be done if the mask-values are too small?

texts:
According to the research paper Multidirectional Scratch Detection and Restoration in Digitized Old Images, we have,

$$H(u, v) = \frac{1}{1 + 0.414 {. \sqrt[{2n}]{\frac {u^*}{D_u}+\frac {v^*}{D_v}}}} \tag{1}$$

where:

\begin{align}
u^* &= \cos \theta . (u + t_x) + \sin \theta . (v + t_y)\\
v^* &= -\sin\theta . (u + t_x) + \cos \theta . (v + t_y)\\
t_x &= \mbox{center}_x \times \cos \theta\\
t_y &= \mbox{center}_y \times \sin \theta
\end{align}

N.B. I have used an 128x128 8-bit-indexed gray-scale image and a 32x32 mask. I padded the mask. Then converted both the image and the mask to complex 2d array. Then I applied Fourier transform to both of them. Then I multiplied them. Then did the Inverse transform.

I have tested with values:

$\theta=0.9$ and $radian=0.9$
$D_u=2, D_v=2$
$CenterX=16, CenterY=16$ and $CenterX=-16, CenterY=-16$

The results are not coming as expected.

The convolution operation is generating a complete black image. My guess is, the kernel values are too small.

Is there any technique to magnify these data?

P.S I have actually corrected formula $(1)$


texts:
I am trying to quantify the average differences between several impulse responses over the frequency range and over octave bands.
So, I am doing (in Matlab):
NFFT = 2^13;
x_fft(1:NFFT,:) = fft(IRs, NFFT);
spData = (abs(x_fft(1:NFFT/2, :))*2)/NFFT;
refPa = 2*1e-5;
R = nchoosek(1:size(spData,3), 2); % Calculate all possible combinations
aC = 0;
for idxNote = 1:size(R,1)
    aC = aC +1;
    diffsRows(aC ,:)=abs((20*log10(spData(:,R(idx ,1))/refPa)) - 20*log10(spData(:,R(idx ,2))/refPa));
end

semilogx(freqs,mean(diffsRows))

I can see in a paper that this has been done by filtering the impulse response with an octave band filter, then by calculating the "RMS levels in dB" for each band of the impulse responses (IRs) and subtracting the levels from the levels of a reference IR. I believe I am doing the same in my code (mine is over the whole frequency range).
Can be the RMS of an impulse response considered as its amplitude in the frequency domain?
Is this the correct way to go?
Thanks in advance for your help!


texts: What are the optimal features for text line and table row discrimination in a handwritten document image?

texts:
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 red is the graphic part. That which is framed in blue represents the table row, but there is no ruling line in the table. I want to discriminate between line text and table row using line layout.


texts: Laplace transform of product of signal and impulse train

texts:
I'm reading 'Discrete Time Control Systems' book by Ogata and came across a few statements (specifically, (3-1) and (3-2)) which I have not been able to understand.

It is said that any continuous signal can be sampled and the output represented as
$$y(t) = \sum_{n=- \infty}^{+\infty}x(nT)\delta(t-nT) $$

Now taking laplace transform
$$\begin{align}
Y(s) &= \sum_{n=- \infty}^{+\infty}x(nT)\mathscr{L}\{\delta(t-nT)\} \\
  &= \sum_{n=- \infty}^{+\infty}x(nT)e^{-nTs} \\
\end{align}$$

Now I have a confusion:

Is the $\delta(t)$ function

the dirac delta function, so that $\mathscr{L}\{\delta(t-nT)\} = e^{-nTs} $ but then the signal representation makes no sense as there is infinite amplitude in the output signal at multiples of $nT$
or is it the unit impulse function (value $1$ at $t=0$ and value $0$ everywhere else) in which case how exactly has $Y(s)$ been evaluated?


texts:
I'm currently trying to perform analysis of a spectrogram, with the use of PCA.
I'm confused about what the dimensions of the result should therefore be. Currently, the dimensions are: 451x128. But I thought that it was a standard image, and therefore it should have 2 dimensions.


texts: How to make a Power Spectral Density Plot in R

texts:
I have a time series point process representing neuron spikes. I have computed and plotted autocovariance using acf but now I need to plot the Power Spectral Density.

Power Spectral Density is defined as the Fourier Transform of the autocovariance, so I have calculated this from my data, but I do not understand how to turn it into a frequency vs amplitude plot.

I have used the following code

# X is some set of Wait times between spikes, below is just an example
X <- c(56, 3, 4, 119, 3, 4, 121, 3, 3, 121, 3, 4, 120, 3, 4, 4, 115)
acf <- acf(X,type="covariance")
psd <- fft(acf$acf)

Now psd is a complex valued array across the default 24 lags from the acf function.

How do I turn this array into a PSD plot?


texts: How to effectively teach topic of frequency domain?

texts:
This is a soft question. The frequency domain has made revolution in the field of Mathematics,  Digital Signal and Image Processing etc. Some of concepts which are very difficult to analyse in spatial or time domain can be very easily understood in the frequency domain using theorems like Fourier transform & series, wavelets, Laplace transform, etc.

Well, I am doing under graduation in 4 years Electronics and Telecommunication Engineering. We have semester pattern system (2 semesters in 1 year). In the 3rd semester, we have subject named "Signals and Systems" under which the above topic is covered.

But my experience is that when it is being taught in the academic curriculum or course, it is not given as much importance as it has to be. Most of the teachers or professors don't know how teach this topic. They teach with the help of ready-made PowerPoint presentations (e.g. for Laplace transform, single PPT which is mostly downloaded from internet) and sometimes they take chalk in their hand. So the students like us get hardly any knowledge about the frequency domain in academic course compared to discussions in the forum like the very useful http://www.DSP.stackexchange.com and http://www.math.stackexchange.com.

So can anybody give explanation about how to effectively teach topic of frequency domain? You can also explain with the help of any subtopic like Fourier domain , Laplace or wavelets etc.
So that all of us would study this difficult topic with interest.


texts:
I need to transform this function:

$$
x(t) = 4\sin(20\pi t ) - 5\cos(24\pi t ) + 3\sin(120\pi t )
$$
into a sequence $x(n)$ given that the sampling frequency should be 50 Hz. So that means the sampling interval $T = \frac{1}{50} = 0.02\ s\ $. So would the sequence be:

$$
x[n] = 4\sin(20\pi0.02n ) - 5\cos(24\pi 0.02n ) + 3\sin(120\pi 0.02n)
$$

I dont know how to compare the CTFT of $x(t)$ and the DTFT of $x(n)$. Any idea ?


texts:
I think I must have misunderstood something regarding the relation between impulse and frequency responses.

I have calculated the Impulse Response Function, IRF, from the Frequency Response Function, FRF, by FFT and then I find some strange things, among these that my assumption that the IRF will always be real is not correct. I have in my code used only the real part of the result from FFT when defining the IRF. Then the amplitude response (and phase) are not correct when I convolve my signal with a sine wave. I expect no phase lag and a slight amplification of a sine wave with period 10 seconds, but get a signal with the wrong amplitude and a slight phase mismatch instead.

What should I do with the imaginary part of the IRF i get back from FFT?

Details for those with a lot of time:

I am using Python and NumPy to try to work out the response of a LTI system to an arbitrary response. I guess the same would apply to Matlab or any other numerical tool implementing DFT. I know a priori the frequency response function, FTR (called a Response Amplitude Operator, RAO, in my field, naval hydrodynamics). As a test case I define my FRF as follows:

# Define RAO
omegas = 2*pi / numpy.array([5, 9, 10, 11, 30])
rao = numpy.array([0, 0, 1.1, 0, 0], dtype=complex) # Fake "ship roll" RAO

The frequency response for my fake ship roll RAO is 1.1 for a wave period of 10 seconds and zero when you get more than one second in wave period away from the peak.

I am using numpy.fft to find the impulse response function, IRF. I interpolate my RAO and apply FFT:

def make_double(x):
    """
    Make a double spectrum by copying the input reversed
    Does not divide the results by two after the mirroring
    """
    return numpy.concatenate((x, x[::-1]))

def rao_to_irf(omegas, rao, tmax, dt):
    """
    Take an RAO defined for a set of (increasing) frequencies and
    compute the corresponding impulse response function by FFT.

    The RAO is inter-/extrapolated to the necessary delta omega
    required to obtain the wanted time step, delta t

    The RAO is assumed to be a complex array
    """
    assert omegas[0] < omegas[-1], "The RAO frequencies, omegas, must be given in increasing order"

    N = numpy.ceil(tmax/dt)
    dw = pi/N/dt

    omegas_long = numpy.arange(N, dtype=float)*dw
    rao_long = interpolate_complex_1d(omegas, rao, fill=0)(omegas_long)

    irf = ifft(make_double(rao_long))[:N]*N/tmax
    t = numpy.arange(N)*dt

    return t, irf.real

Now I have an IRF (?). To check the response I also implemented the inverse and see that the RAO/FRF calculated from the IRF looks similar to the input RAO (when interpolated to constant frequency spacing).

I can now combine my RAO/FRF with a wave spectrum and perform a time realization using FFT. I also make a realization of the spectrum to get the unmodified input wave signal. This signal I convolve with the IRF.

I get the expected result if my RAO/FRF is 1 for all frequencies (meaning I get the wave signal back). However the response to the peaked RAO defined above is not as I expect. The time realization from the wave spectrum multiplied by the RAO^2 is not the same as the result of the convolution. Should not these match. I am pretty sure our code to make realizations of response spectra works as it should and I have tested with wave spectra consisting of one pure sine wave and the response is as expected with an FFT of the response spectrum, but not when using convolution

Sorry for the convoluted question


texts: How Last Edge Image Can Be Achieved from Law Masks

texts:
as we know thechnique of law edge detection has 25 2d masks that is obtained form 5 different 1d filters. we can use each of those masks on image with convolution but how can we obtain final result? is that achieved from from some kind of fusion or it have to be chosen?

thank you


texts: Is there such a thing as a moving bandpass filter algorithm?

texts:
I am looking for an algorithm, preferably available in a Python library, which passes only frequencies of interest, with the center frequency continuously changing as it moves through an array of audio response data.

I need this because I am analyzing the result of an audio sine wave sweep from 20Hz to 20000Hz and the recorded data contains noise.  Since I am driving the system with a known frequency and am only interested in the system's response near that frequency, I would like to have a tracking bandpass filter.

I have Googled terms such as "moving bandpass filter" "tracking bandpass filter" to no avail. I would appreciate any suggestions.


texts: What Information Is Lost by Histogram Equalization?

texts: I cannot think of a way to restore an original image after histogram equalization. But this latter seems to "enhance" (= increase contrast of) the image's details. What information is then lost by histogram equalization, if any?


texts: Understanding the Difference Between MAP Estimation and ML Estimation

texts:
There are a number of possible criteria to use in making decisions.
Can someone elaborate on the difference between ML and MAP for a sequence of BPSK symbols impaired by Gaussian noise ?


texts:
I'm trying to write a simple script that should plot the spectrum in scilab, to test it I use a  sinus function with 440hz so that I get my dirac in this position , my problem is that it doesn't work and I don't understand why?
here's the code :

Fs = 8000;
f = 440;
t= 0:1/Fs:1;
y = sin(2*%pi*f*t);

nf = 1024; // number of point in the DFT
Y = fft(y)
f = Fs/2  * linspace(0,1,nf/2+1);
clf();
plot(f,abs(Y(1:nf/2+1)));

and this is what I get :

any idea why I get this ?


texts: Recognition of household objects ( image processing, pattern recognition ) using wide lens?

texts:
Camera setup: We have setup some stereo cameras in a living apartment. That is, the indoor environment is monitored. With the stereo cameras, wide lens (3.5mm) are used to cover a big volume.

The height from the floor is around 2.8 meters. The objects (such as mug, bottle, telephone) are at least 3 meters away. For instance, an object (75mmx102mm), which located 3 meters away from the camera, is represented by 15x20px in the camera image. Thus, the images are getting smaller in the far field.

I have around 30 different objects to be recognized.

I do not use the depth information, because it is not so accurate. I just use RGB values from a single camera. Image resolution is 1360 x 1024 pixels.

Approaches: 1. Point detectors/descriptors, matches (some models in the database, and check the match one by one) 2. Bag of visual worlds + SVM classification (5 object categories)

I had experiences with Haar-cascade but I never tried for my current issue.

What methods/approaches should I try to investigate?

Thank you in advance,


texts: Magnitude of intermodulation distortion products?

texts:
Assuming I have a set of frequencies $\mathbf F$, and I pick 2 frequencies $f_1$ and $f_2$ randomly from the set, generate sine waves for them, and pass the signals through a non-linear distortion process while adding them.

Is there any way for the harmonics or intermodulation distortion products to have a magnitude larger than the magnitude of any of the two frequencies, when calculating an FFT?
If yes, under what conditions, and how can I avoid that this happens?


texts: Calculating the volume of a triangular mesh?

texts: I have an unorganized point cloud with a bunch of 3d points. I use a certain surface reconstruction method to obtain a triangle mesh of the underlying surface. The surface could be closed or not. Can somebody point me out to how I would go about estimating the volume enclosed by such a surface (if its closed). If its not closed, then what would a way to "close" it and get a volume? I would appreciate if somebody could even point out C++ libraries that would help me do this.


texts:
I'm trying to implement a simple demodulator as an evening project (to understand how this works - my background is in physics not engineering) and was wondering if anyone has any advice.

To make a working demodulator I think I need to implement an:

Equaliser (I was thinking of using a steepest descent algorithm).
Channeliser (I don't know how to go about this)
A carrier (or phase-locked?) loop

Does anyone know of any (hopefully free) resources that will help me?


texts: Hilbert Transform, filters - two different phase graphs

texts:
Relationship between magnitude response and phase response for minimum phase is:

Phase plots are obtained from Hilbert transform of real magnitude values. Input to Hilbert transform was a vector (array) of real magnitude values in dB. Magnitude vs. frequency (Fig. 1.) is a raised-cosine function defining a Mesa filter with plateau.

I obtained phase values in two ways. In Fig. 2. the resulting phase plot (phase from the previous formula, not the phase from analytic signal) is obtained from SciLab using command x = -hilbert(xr), printing imag(x). Variable xr is vector holding magnitude values. In Fig. 3. the phase plot (phase from the previous formula, not the phase from analytic signal) is obtained from C implementation of Hilbert transform taken from ht.c file on the web. Hilbert transform here is implemented as convolution and the values are in xh[i].

Although similar, the phase plots on Fig. 2. and Fig. 3. are quite different. Any insights why I am getting two different graphs of phase?


texts: What are the limitations of Watershed Segmentation Algorithm?

texts:
I am developing an Android application using Opencv to detect objects from images.

I used Canny edge detector to detect the edges and extract contours, and it's working good so far.

But I need to understand the difference of usage of Canny and Watershed segmentation algorithm.

What's the difference between those two algorithms in terms of performance and accuracy ? Or it just depends on the application ?

And can Watershed works on a generic way? That means can it  detect unknown number objects from an image and detect objects with different colors ?


texts: How would PCA run on multivariate time-series data affect phase relationships across variables?

texts: I am running PCA on a multivariate time-series dataset using observations across time (i.e. w/out time as an explicit variable) as the design matrix. Given this setup, I've found that it is difficult for me to interpret the covariance matrix derived from such a design matrix. For instance, if two variables (e.g. signal A & signal B) positively covary, I think that means that--on average (across observations/time-points)--a positive amplitude of signal A predicts a positive amplitude of signal B. However, it seems evident that some amount of temporal information is lost when only looking at the covariance matrix in this manner. Given that PCA exploits info in the covariance matrix, I'm having trouble intuitively understanding how my end-result PCA components or "virtual signals" would accurately retain most of the phase relationships between variables in the design matrix. If PCA does impact phase relationships substantially, then I may be in trouble, because I am attempting to run VAR models on datasets that have had PCA applied to them. Is this a reasonable concern, or can someone convince me that phase relationships between variables are retained even after running PCA?


texts: How can I automatically find the boundary of a high intensity region inside an image?

texts:
I have an image I(x,y):

Red indicates high values and blue low values. Everything in black is drawn onto the image afterwards.
The black dot (xp,yp) represents a point clicked by an user and the black curve a boundary around the high value region around the user clicked point.

How can I automatically find this boundary?

As can be seen from the picture; I do not want the boundary to propagate through narrow gaps.


texts: What is the largest "safe" order for the digital Butterworth filter of a given signal?

texts:
Say I want to apply a zero-phase Butterworth bandpass filter, implemented in MATLAB using butter and filtfilt. So, for an order-$4n$ filter with passband $[f_{\mathrm{min}\,},f_{\mathrm{max}}]$, I believe the transfer function $H$ is given by
$$ H(2\pi if) \ = \ \frac{1}{1+\left( \frac{f}{f_\mathrm{max}-f_\mathrm{min}} + \frac{f^{-1}}{f_\mathrm{max}^{-1}-f_\mathrm{min}^{-1}} \right)^{\!2n}}\,. $$

    It seems that for any given digital signal $x(t)$ (other than the constant zero signal), there is a critical number $N_x$ such that:

    for any $n < N_x$ the results are fairly sensible;
    but for $n \geq N_x$, the results change considerably and are unreliable.

    (1) What is the cause of this behaviour? Is it due to numerical imprecisions that grow large when the stability of the filter is poor?

    (2) Is there a straightforward way to determine what this critical number $N_x$ is?

Let me illustrate the phenomenon with a couple of examples:

EXAMPLE 1

Consider the signal $x(t)=\sin(2\pi t)$, $t \in \{0,0.01,0.02\ldots,99.99,100\}$. (This signal has 10001 points altogether.)

Suppose I apply the Butterworth filter with passband $[f_{\mathrm{min}\,},f_{\mathrm{max}}]=[0.5,3]$. Of course, I expect my filtered signal $x_{\mathrm{filt}}(t)$ to be basically the same as $x(t)$, except:

there may be edge effects near the start and/or end;
for $n=1$ or $2$, the amplitude is likely to be slightly reduced, as the frequency of the sinusoid $x(t)$ is not very close to the centre frequency $\sqrt{1.5}$ of the filter.

For each $n \leq 5$, the results are as expected. E.g., for $n=5$ (corresponding to filter order 20), the result is as follows:

However, when I now take $n=6$ (filter order 24), I suddenly get a drastically different result:

A wavelet transform of the original and filtered signal for $n=6$ looks as follows:

For even larger $n$, the results simply blow up. For $n=7$, the filtered signal is equal to NaN for about the first two thirds of the duration, and then starts taking values of the order of $\,-10^{305}$, going up to a maximum value of about $4 \times 10^{231}$.

So in this example, $N_x=6$.

EXAMPLE 2

This is exactly the same as Example 1, except with the sampling frequency considerably reduced.

Consider the signal $x(t)=\sin(2\pi t)$, $t \in \{0,0.08,0.16\ldots,99.92,100\}$. (This signal has 1251 points altogether.)

Once again, suppose I apply the Butterworth filter with passband $[f_{\mathrm{min}\,},f_{\mathrm{max}}]=[0.5,3]$. For $n \leq 16$, I get sensible results. Here is the filtered signal with $n=16$:

I think the "early warning sign" here is that the slight inaccuracy of the filtered signal persists throughout the whole duration, not just at the start and end; for $n \leq 15$, the visible inaccuracy is only at the edges.

For $n=17$, I get quite a bad result:

In this case, Fourier and wavelet transforms are as follows:

Once again, for $n=18$, the results blow up:

(Please note that the values of the filtered signal are extremely large throughout, not just for $t<35$. At $t=70$, the value is about $-6.5 \times 10^{11}$.)

So in this example, $N_x=17$.

REMARK: In many (probably most) other examples, there is no intermediary $n$-value between the $n$-values giving consistent results and the $n$-values for which the filtered signal blows up to extreme values. In this regard (but only this regard), the above two examples seem somewhat exceptional.


texts: How to convert a sound file to any other data format which can be manipulated

texts: I know this is very basic question and i am new to this site. But can anybody help me with my question. How to convert a sound file to other data format say using some type of transform (FFT or DFT) with which i can manipulate the data of the sound. Lets say i get frequency values from the sound i should be able to manipulate or compare these values to another sound file which is again converted to the same format so i can compare these two. Are there any algorithms to do this.


texts: Multiplying signals in discrete-time vs continuous-time

texts:
Given two discrete-time signals $a[n]$, $b[n]$ and its product $c[n]=a[n] b[n]$. The ideally interpolated, continuous-time version of $c[n]$ is
\begin{align}
c_1(t)&=\sum_{n=-\infty}^{\infty} a[n] b[n] \operatorname{sinc}\left(\frac{t-n T}{T}\right) .
\end{align}
Now I would like to perform this multiplication in continuous-time using the interpolated versions of $a[n]$ and $b[n]$:
\begin{align}
c_2(t) &= \left(\sum_{n_1=-\infty}^{\infty} a[n_1] \operatorname{sinc}\left(\frac{t-n_1 T}{T}\right)\right) \left(\sum_{n_2=-\infty}^{\infty} b[n_2] \operatorname{sinc}\left(\frac{t-n_2 T}{T}\right)\right) \\
&= \sum_{n_1=-\infty}^{\infty}\sum_{n_2=-\infty}^{\infty} a[n_1] b[n_2] \operatorname{sinc}\left(\frac{t-n_1 T}{T}\right)   \operatorname{sinc}\left(\frac{t-n_2 T}{T}\right) .
\end{align}
Suddenly I end up with a double-sum and the cross terms $n_1\neq n_2$ are nonzero.
Why?
What do I need to do to arrive in a form similar as $c_1(t)$ with just one sum?


texts: Linear Predictive Coding example in MATLAB

texts:
I have some data that is highly correlated and I wanted to see if I could try and encode it using linear predictive coding (LPC). Here is how I've been understanding the process:

Encoding

Generate predictive filter coefficients
Filter signal with these coefficients to obtain and error signal $r[n]$.
Check if $r[n]$ is white.
If it is, store the variance of $r[n]$ along with the coefficients and you are done.
If not, increase order until (hopefully) $r[n]$ becomes white.

Decoding

With the encoding variance, produce a white signal.
Pass that white signal through the inverse filter.
You produce a signal $s[n]$ that has the same autocorrelation sequence and power spectrum as your original.

I've completed all the encoding steps - computed my coefficients, checked if my residual signal was white (autocorrelation is a delta function) and then stored its variance. However, the trouble comes during the decoding process. I took the variance I encoded, produced white noise, and filtered it with the inverse filter. Not only was my signal nowhere near a representation of my old signal, but the two signals had very different autocorrelation sequences as well. I've posted my code and my outputs below. I mainly just want to know if I'm misunderstanding something about LPC or if I'm implementing it wildly incorrectly.

load('amp.mat') %this gets loaded as the variable y with timestamp t

order = 15;
[a,variance] = aryule(y,order);
error = filter(a,1,y);

%Now check to see if error is white

[acs, lags] = xcorr(error,'coeff');
plot(lags,acs), grid;

noise = sqrt(variance)*randn(length(y),1);

%compare noise to error signal
plot(t,error,t,noise)

%synthesize signal
yrecon = filter(1,a,noise);
%actual signal, as produced by our residual
yact = filter(1,a,error);

plot(t,yrecon,t,yact);
title('Signal vs synthesized signal')

%check autocorrelation sequence of each and plot
[yacs, ylags] = xcorr(y,'coeff');
[yracs, yrlags] = xcorr(yrecon, 'coeff');
subplot(2,1,1)
plot(yrlags,yracs), grid
title('Autocorrelation sequence of reconstructed signal')
subplot(2,1,2)
plot(ylags, yacs), grid
title('Autocorrelation sequence of signal'}


texts: Frequency response of discrete PT1 in MATLAB

texts:
I want to calculate the frequency response of a discrete PT1 system with T=T1 and K=1. (the code is at the bottom of the question)
To validate the magnitude response, I want to use an sinusoidal input signal with linearly increasing frequency from 0 to fs/2.
The magnitude response should be the envelope of the transient response.
However, this is only the case if I change the line

u = sin(2*pi*f.*t);

to

u = sin(pi*f.*t);

Why? I assume that I have any kind of faulty reasoning here, but I can't find it.

Thanks in advance.

Full code:

clear

%% Input (linear frequency sweep)
Ts = .1e-3;
duration = 30;
t = (0:Ts:duration);
fs = 1/Ts;
f = (fs/2)*t/duration;
u = sin(2*pi*f.*t);

%% PT1-system continuous
T1 = 1e-3;
G = tf(1,[T1 1]);

%% PT1 discretized
H = c2d(G,Ts,'zoh');

%% PT1 trasient response
x0 = 0;
x = lsim(H,u,[],x0,'zoh');

%% PT1 freq. response
[h,~] = freqz(H.Numerator{1:end},H.Denominator{1:end},f,fs);

%% Plot
figure(1),clf(1),hold on
plot(u),plot(x),plot(abs(h))


texts: Calculation of Reverberation Time (RT60) from the Impulse Response

texts:
I have some confusions regarding reverberation time (RT60). I need to calculate reverberation time from a given power envelope.

This is what I get. As you might see the line is curved close to zero (at top left corner) and then becomes straight. Is t-intercept equal to RT60, or do I need to extend the straight line at the top then shift the line left so that I get a straight line starting from the top left corner and then see the t-intercept? Any help would be appreciated. Thanks in advance!


texts:
When you get a DFT of a signal, you use the basis functions as:

$e^{-j2\pi kn/N}$

Why is it so? Why don't we use the conjugate, $e^{j2\pi kn/N}$, or any other function?


texts:
Wavelet transform gives good time resolution for high-frequency events and good frequency resolution for low-frequency events.

=> I want to have complete opposite of wavelet transform, where I get good time resolution for low frequency events? Is there any known transform or specific window to get it?


texts: How to remove artefacts from this image?

texts:
There is some vertical banding near the tree trunks in the following image.

Is there a way remove this type of artefact, preferably using Mathematica?


texts: Smoothing in frequency domain and impulse reponse of the filter in time-domain

texts:
I have a low-pass signal in frequency domain, $$\left[f_{min}=0, f_{max}=20\,\mathrm{GHz}\right]_{n=100}$$

After re-configuring the input signal as
$$X=\left[-f_{max},\ \dots\ -f_{min},\ \mathrm{DC},\ f_{min},\ \dots\ f_{max} \right]_{2n+1}$$

and constructing a Hamming window of length $2n+1$ as win = hamming(2n+1),

Now the question is, how to perform smoothing and eventually get the impulse response of the filter?

Another confusing point is whether I should convolve the input signal with the window function?

-or-

Is it the multiplication between the input signal and the window function? Like X.*win?

In this context do I need perform fft(hamming(length(2n+1))) on window function?

time            = 5; % in nano-seconds
z0              = 50;
A               = importdata("sparameters_lowpass.dat");
M               = 2048;

freq            = A(:,1);
freq_neg        = -1.0*flip(freq);

realPart        = A(:,2);
imagPart        = A(:,3);

s11_freq        = realPart + imagPart*i;
s11_conj        = conj(flip(s11_freq));

F               = [freq_neg(1:end-1)', freq(1),     freq(2:end)'];
X               = [s11_conj(1:end-1)', s11_freq(1), s11_freq(2:end)'];

win             = (hamming(length(X)));

freq_multip     = X.*win';

s11_time        = ifft(freq_multip);

z_in            = z0 * (1 + s11_time)./(1 - s11_time); % input impedance

Any help to the correct approach is very helpful.


texts: Why use a gaussian low pass filter, when we can convolve with gaussian kernel

texts:
Sorry if this question is too simplistic, but I am new to image processing and after successfully writing two programs, a convolution program and a low pass filtering program, I noticed that for approximately the same output, the low pass filtering method takes 4 times the time!

Lets assume that the image is a square of side N. When convolving we can use an arbitrarily small kernel (out to $3\sigma$ for example) and put a Gaussian in it, say of size M=$3\sigma$. We then have to simply pad the image and the kernel into an N+M-1 side square array and run DFT onit, multiply it and run IDFT.

But for low pass filtering we have to create a padded square array of width 2*N. There is one less DFT required, but the one DFT and the IDFT on the array with 4 times the elements will take a significantly longer amount of time because the padded array is huge (look at Gonzalez&Woods Fig.4.36 as an example)! Since the DFT of a Gaussian kernel is also a Gaussian, then why should we use a Gaussian low pass filtering at all when it takes nearly 4 times the time (look below)?

Source code: I have put the source code in github.

I am adding some timings in my program to show what I mean. The image was 233*233 pixels. My CPU is clocked at 3.07GHz.

For a low pass filter, note that the FFTs and IFFTs are done on an array of size 466*466:

Gaussian low pass filter timing:

Padding:                0.002564 (seconds)
FFT:                    0.018210 (seconds)
Applying filter:        0.006686 (seconds)
IFFT:                   0.017254 (seconds)
Time for final step:    0.000550 (seconds)

Total:                  0.047424 (seconds)

For a convolution of the same image with a kernel of size 9*9, note that the three FFTs and IFFTs are done on arrays of size 241*241:

Gaussian convolution timing:

Making the kernel:      0.000077 (seconds)
Pad both to same size:  0.001389 (seconds)
Padded image FFT:       0.002699 (seconds)
Padded kernel FFT:      0.001866 (seconds)
Multiplying:            0.000384 (seconds)
IFFT:                   0.002241 (seconds)
Crop from padded:       0.000574 (seconds)

Total:          0.011149 (seconds)


texts: How does the Magnitude of an FFT relate back to the Time Series wave it was created from?

texts:
Alright, to start out I am a mechanical engineer with very little circuits and digital signal processing background. So please excuse my ignorance as this is far out of my usual territory.

When looking at the magnitude of an FFT of a signal, I understand that the magnitude is in the units of the time signal (in my case it is Volts). I also understand that you need to divide the FFT results by the transform length in order to normalize.

What I don't completely understand is how the magnitude of the FFT result relates back to the time signal. From what (I think) I understand it should be related to the amplitude of the time signal. From my MATLAB code that I made (posed below) it seems that it returns 1/4 of the amplitude of the signal. Is this correct? What is the physical meaning of it?

And then on a related note, if it is related to the amplitude of a time signal, what is the sampling rate needed to get a decent measure of the amplitude. I know the highest resolvable frequency for an FFT is the nyquist frequency, but I haven't been able to find anything about accurate measurements of a signal's amplitude.

Thanks in advance for any and all help on this.

MATLAB Code:

f_s = 20;              % sampling (hz)

f_w = 2;                % frequency of wave (hz)
A = 5;                  % amplitude

d_t = 1/f_s;
t = 0:d_t:2-d_t;
n = length(t);

% Creating the time signal
time_signal = A*sin(f_w*2*pi*t);

% Generating and applying a hanning window on the time signal
window = hann(n)';
windowed_time_signal = time_signal.*window;

% Taking FFT of windowed time signal
raw_fft = fft(windowed_time_signal);

% Frequency resolution of FFT
d_f = f_s/n;

% Frequency spectrum for full FFT
f_spectrum_full = (0:n-1)*d_f;

% Only first half of FFT contains useful information
half_fft = raw_fft(1:(n/2));

% Frequency scale for half FFT
f_spectrum_half = (0:n/2-1)*d_f;

% Magnitude of the half FFT
magnitude = abs(half_fft);

% Normalized version of the magnitude
normalized = magnitude/(n);

figure (1)

subplot(2,1,1)
plot(t,time_signal)
title('time wave')

subplot(2,1,2)
plot(t,windowed_time_signal)
title('windowed time wave')

figure (2)

subplot(3,1,1)
plot(f_spectrum_half,magnitude)
title('magnitude')

subplot(3,1,2)
plot(f_spectrum_half,normalized)
title('magnitude')


texts: Trying to implement MATLAB $\tt pwelch$ in Python

texts:
I'm implementing an existing MATLAB script in Python and noticing some differences in the behaviour of MATLAB's pwelch function compared to scipy.signal.welch.

From the docs, scipy.signal.welch uses a default window size of 256, whereas MATLAB's pwelch doc says:

  By default, x is divided into the longest possible segments to obtain as close to but not exceed 8 segments with 50% overlap".

Both use Hamming windows and overlap by 50%, so I assume the differences I'm seeing are due to window sizes.

However, if I set the same window size for both, I still see different frequency resolution in the results. e.g. for data series of length 6144, sampled every 0.292969 seconds, and set window size as follows:

n = 1000
freqs, power = signal.welch(timeseries, fs=1.0/0.292969, scaling='density', nperseg=n)
print(freqs[2]) # output 0.0034

n = 1500
freqs, power = signal.welch(timeseries, fs=1.0/0.292969, scaling='density', nperseg=n)
print(freqs[2]) # output 0.00227555370371

for MATLAB:

n = 1000;
dt = 0.292969;
[psd,freq] = pwelch(timeseries,n,[],[],1/dt);
freq(2) % output 0.0033

n = 1500;
[psd,freq] = pwelch(timeseries,n,[],[],1/dt);
freq(2) % output 0.0017

For higher window size the difference in output resolution is quite stark, and results in quite different amplitudes for peaks in the spectrum. Am I missing some other parameter which needs adjusting?


texts: Optimal Level of Wavelet Decomposition for Denoising

texts: If a certain mother wavelet is defined and the optimal threshold shall be defined via Donoho, how can I define the optimal decomposition level to achieve the best denoising results.


texts:
I am interested in denoising accerelation measurements, recorded in ambient vibration tests. Such tests consist in recording the vibrations of a mechanical structure, say a table for example. So say I put an accelerometer on the table and measure the signal without touching the table. The objective is to retrieve the dynamical properties of the table, i.e. its dominant natural frequencies.

The signal is a combination of the table dynamics response under a random excitation, plus some measurement noise. The sought frequencies correspond to peaks in the PSD, but for some other reason I would like to denoise the measurements.

The typical range of frequency can be estimated for a structure. Let's assume it is [10,20]Hz in the present case.
The first thing I do is bandpass the signal with a bandpass of [10,20]Hz. Then, I decimate the measurements down to 50Hz, so that 20Hz is below the Nyquist frequency. But this does not suffice for my needs, so I am wondering how I could improve the preprocessing / denoising.

I am considering using wavelets to denoise the signals (i.e. have nice peaks in the |DFT| vs frequency plot), but I am not sure if it's a good idea. It would probably be if the input was highly unstationnary, but that's not very likely. Another possibility could be using correlation with some sines of appropriate frequencies, maybe... So the question is to the experienced DSP people, can you think of anything which I could use to improve the denoising?

Please do not hesitate do ask for clarifications. I tried to make my question simple enough to not discourage readers, but had to remove some details.


texts: List of Fourier coefficientes to simulate musical instruments

texts:
I'm trying to find a list of Fourier Coefficients (frequencies/amplitudes, ie, spectral data) to simulate different musical instruments using additive synthesis. Are these data published somewhere? This is for a Math class: I just would like to add more frequencies and listen how the sound generated compares with the real sound.

Thanks!


texts: Is There a Sparse Representation for Noise?

texts:
Is there sparse representation for stationary noise and nonstationary noise?
How can I learn dictionary for each noise class?
(my mean of noise is noises with which speech signals are often contaminated such as white gaussian noise, car noise, babble noise, impulsive noise....)


texts: Vector length output of discrete time convolution

texts:
Suppose that the impulse response of a discrete time filter is $h[i]$ where $i=0,1,2,...,N-1$ and the input sequence to the filter is $x[i]$ for $i=0,1,2,.., M-1,$ what would be the length of output vector length?

I have concluded it is $N$  because  according to discrete time convolution

\begin{align}
y[0] &= x[0]h[0]\\
y[1] &= x[0]h[1]+x[1]h[0]\\
y[2] &= x[0]h[2]+x[1]h[1]+x[2]h[0]\\
\vdots &=\vdots\\
y[N] &= x[1]h[N-1]+x[2]h[N-2]+...+x[N]h[0]
\end{align}

Is this correct?


texts: What Are the Differences in Four Different Types of Third Order Image Moments (Skewness)?

texts:
I am attempting to analyze images using the third order image moment (aka skewness), but I am having trouble figuring out how to do so. As it turns out, there are four different types of third order image moments:
$$
\begin{array}{rcl}
\mu_{21} &=& M_{21} + 2\bar{x}M_{11} - \bar{y}M_{20} + 2\bar{x}^2M_{01}\\
\mu_{12} &=& M_{12} + 2\bar{y}M_{11} - \bar{x}M_{02} + 2\bar{y}^2M_{10}\\
\mu_{30} &=& M_{30} - 3\bar{x}M_{20} + 2\bar{x}^2M_{10}\\
\mu_{03} &=& M_{03} - 3\bar{y}M_{02} + 2\bar{y}^2M_{01}
\end{array}
$$
$$
\begin{array}{rcl}
M_{p,q} &=& \mbox{Raw moment of order}\ (p+q)\\
\mu_{p,q} &=& \mbox{Central moment of order}\ (p+q)\\
\end{array}
$$
Formulas pulled from: https://en.wikipedia.org/wiki/Image_moment
It's been very difficult to find out what the differences are between these 4 (if there are any) on the internet. If there's anyone here that could explain in layman's terms how they differ, I would greatly appreciate it.
This question is most likely asking something that's more fundamental to the calculation of moments themselves than specifically with regard to image moments. However, I have seen several questions about them here, so I figured it would be a good place to start.


texts:
I am reading the paper Selective Search for Object Recognition here. In Section 3.2, they give a similarity measure between two regions of an image based on the texture of the regions with what they refer to as "fast SIFT-like measurements". On page 4, bottom right side of the page, they write:

We take Gaussian derivatives in eight orientations using

  $\sigma = 1$ for each colour channel. For each orientation for each colour channel we extract a histogram using a bin size of $10$.

I understand that a derivative of Gaussian filter is the filter of size $n \times n$ consisting of a discrete approximation of the derivative of a bivariate gaussian function of mean $0$ with some standard deviation.

What do the authors mean by "with eight orientations"? Is this some kind of modification to the filter? Any insights appreciated.


texts:
I have been studying the adaptive filters lately and now when I am at RLS (Recursive Least Squar) Algorithm I came across the term used in the weighting function of the RLS called forgetting factor ($\lambda$). This term ‘memoryless’ itself confuses me. My doubt is:

How is memoryless RLS different than the standard RLS? Does it involve some specific value for lambda (as in, it is said that if $\lambda$ $= 1$, system has infinite memory).

I would be glad if anyone could help.


texts:
We as a group are new to signal processing and speech recognition. We have stored .wav sounds of three different words and we are trying to record a new .wav sound and have the system compare the sound to these three pre-recorded sounds to see which one correlates the most to the newly generated sound.

We have altered the .wav sounds in various ways trying to figure out how we should tackle this problem. Thus far, we have been stuck on this issue for a while now and are only able to achieve sound comparisons with just two different sounds.

How should we tackle this problem? We would be very grateful for some general directions, thanks in advance.


texts: Train a Cascade Object Detector in MATLAB

texts:
I am trying to train a cascade object detector in MATLAB using the built in functionality from the Computer Vision Toolbox.

I’ve taken 500 photo’s of the sole of my shoe.  Every photo is taken from the same angle, so there is very little shifting in rotation and scaling from all of the images.

For the negative images I am using 500 photo’s of the background that is behind the shoe in the positive images.

The reason I am using the background as the negative photo’s is to train the classifier to overlook the background.

After I train the cascade classifier with these positive and negative images and apply it to another image of my shoe (taken from the same angle as one of the positive images) the detector does not detect the shoe!

What am I doing wrong?

Here are two of the photo's I am using for the negative and positive image (with bounding box shown).

Here is the code I have written that performs this task:

% Load Positive Images with Bounding Boxes from the "Training Image Labeler App"
data = positiveInstances;

% Load Negative Images
negativeFolder = fullfile('C:\shoes\neg');

% Train Detector
trainCascadeObjectDetector('detector.xml', data, negativeFolder);

% Use Detector
detector = vision.CascadeObjectDetector('detector.xml');
test_image = imread('C:\shoes\test.jpg');
bbox = step(detector, test_image);
detectedImage = insertObjectAnnotation(test_image, 'rectangle', ...
                                       bbox,       'shoe');

figure;
imshow(detectedImage)


texts: Situations where complexity is too big to exceed linearity and gaussianity

texts:
I'm studing about Kalman Filter and Particle Filter in multiple target tracking in computer vision (tracking pedestrians). Reading sientific papers I'm colliding with a lot of sentences like:

  The assumptions of linearity and Gaussianity of the Kalman Filter
  cannote manage complex scenario.

Now.. I'd like to find some real example of scenario where those assumptions are exceeded. Because I don't really understand where I should use Kalman Filter or not. Can anyone give me some example?

Real videos (like youtube or similar) are very good example.


texts:
Currently, I'm working on removing 50 Hz power line interference from an ECG signal. Before trying out notch filters, I decided to try out a simple lowpass filter with a cutoff less than 50 Hz. Here's the MATLAB code I used to make the filter:

Fs=500; %Sampling rate in Hz
Ast = 120; %Stopband attenuation
Ap = 1; %Passband ripple
Fp = 30; %Passband end
Fst = 45; %Stopband beginning
Hd=fdesign.lowpass('Fp,Fst,Ap,Ast',Fp,Fst,Ap,Ast,Fs);
d=design(Hd,'butter'); % Design a butterworth filter with the given characteristics
fvtool(d);

The magnitude response of the filter is:

As you can see, the filter has around a 180 dB attenuation at 50 Hz and even more at higher frequencies.

Now, I run this filter on my data. Here's the original data, in the time and frequency domain:

And here's the data after applying the filter:

As you can see, the attenuation at 50 Hz is nowhere near the 180 dB that the filter advertised. For a better look, here's the plot of the magnitude response computed by taking the ratio of the FFTs of the signal before and after filtering:

Clearly, the attenuation is nowhere near the level it is supposed to be at. Is this the way it's supposed to be or am I doing something wrong in the implementation?

Thanks in advance for all the help!

Edit : Here's an enlarged view of a single beat of the ECG after applying the filter. Note the 50Hz noise right after the tall peak.


texts: Measuring the frequency of the Analog input signal of an ADC, which is operated by Raspberry PI

texts:
I'm building a monitoring package for a sensor via a raspberry PI and an ADC, which reads the analog signal (for the moment from a DC power supply instead the real sensor) and transfer it to my raspberry as a digital value. The problem is that the analog signals fluctuate a lot and as well the digital values.
I want to measure the analog frequency via a python code and make a plot for it. But I don't know how to store those values in an Array and make a plot of that.
Thanks a lot!


texts: can $e^{j\phi_0}$ be incorporated into the sine and cosine terms?

texts:
This is from "communication system" by Carlson fifth edition page 109:
If transfer function of a channel be like this:
$H(f)= Ae^{j\phi_0}e^{-j2\pi ft_g} $
and input to this system be:
$x(t)=x_1(t)\cos(\omega_c t) - x_2(t)\sin(\omega_c t)  $
will output be like this?
$y(t) = Ax_1(t-t_g)\cos[\omega_c (t-t_g)+\phi_0] - Ax_2(t-t_g)\sin[\omega_c (t-t_g)+\phi_0]$
my problem is with this sentence in the book:

$e^{j\phi_0}$ can be incorporated into the sine and cosine terms...

Edit:
picture from book:


texts: Does one ever store audio in mp3s with one channel being inverted?

texts:
As far as I am aware this is something one does for analog processing, not in digital, and one only does it during the actual processing and not in storage (for example in an mp3).

Is my thinking correct?


texts: MATLAB: Compute pole-zero diagram of FIR using only impulse response

texts: Given a discrete time impulse response $h[n]$ of a system, is there a way to plot its poles and zeros in MATLAB? The input impulse response can be variable, so I can't compute its transfer function before hand. I have seen several options where given the $H(z)$ you can plot the Pole-Zero diagram but couldn't find any which computes it using just $h[n]$.


texts:
This question pertains to frequency domain filtering. I'd like to multiply an IIR filter's frequency response by a buffer of samples that have been FFT'd. I get how I'd evaluate an FIR, I'd FFT and zero-pad it (is this assumption correct?).

For an IIR would I just evaluate the impulse response of the IIR for a sequence 1 followed by N zeros where N is the length of the FFT, and then FFT that impulse response. Is this the right approach? Don't want to go too far down the rabbit hole without catching any caveats beforehand.


texts:
Take:

  $$
(u*v)(k) = \sum_{i=-\infty}^\infty u(i)v(k-i).
$$

  The $k$ is there, it's because you want to define
  $$
\ldots\ldots, (u*v)(-3), (u*v)(-2), (u*v)(-1), (u*v)(0), (u*v)(1), (u*v)(2), (u*v)(3), \ldots\ldots
>$$
  etc.  The number in the parentheses is $k$.  Thus, for example, when $k=4$, we have
  \begin{align}
(u*v)(4) = \sum_{i=-\infty}^\infty u(i)v(4-i)
\end{align}
  $$
= \cdots\cdots+u(-3)v(7)+u(-2)v(6)+u(-1)v(5)+u(0)v(4)+u(1)v(3)+u(2)v(2)
>$$
  $$
\phantom{={}} {}+u(3)v(1)+ u(4)v(0) + u(5) v(-1) + u(6)v(-2)+u(7)v(-3)+u(8)v(-4)+\cdots>\cdots.
>$$

Could you give examples of what the 'k' value could stand for?
Can it only be time offset?

Could you give an intuitive explaination why you need to multiply u(-3) [a point left from the y-axes] with v(7) [a point right from the y-axes]! And not u(-3) with v(-3) for example? With a diagram for example.


texts: The difference of downsampling an image and smoothing an image?

texts:
I am, at the moment, trying to read up on some simple computer vision elements, in which i have become a bit comfused on the terms downsampling and smoothing, and whether there is a difference between those two terms.

I know that downsampling means to reduce the resolution (DPI) of an image to a lower value. Which will result in a smaller image compared to the original.

But what about smoothing? Or convolution? Would it not result in the same thing? Or am i misunderstanding something?


texts:
Given this system:

I need to show the $\mathcal Z$-transform of $y[n]$ as a function of the $\mathcal Z$-transform of $x[n]$.

Now I know that for downsampling alone:

$$Y(z) = \frac1M\sum_{m=0}^{M-1} X\left(e^\frac{-j2\pi{m}}M\cdot z^\frac 1M\right)$$

And that for upsampling alone:

$$Y(z) = X\left(z^M\right)$$

My problem here is that I don't quite understand how upsampling would affect the downsampling equation. Say we call the point between downsampling and upsampling $w[n]$, we get:

\begin{align}Y(z) &= W\left(z^M\right)\\
W(z) &= \frac1M\sum_{m=0}^{M-1} X\left(e^\frac{-j2\pi{m}}M\cdot z^\frac 1M\right)\end{align}

I'm not sure if I will be getting:

$$Y(z) = \frac1M\sum_{m=0}^{M-1} X\left(e^\frac{-j2\pi{m}}M\cdot z\right)$$

Or:

$$Y(z) = \frac1M\sum_{m=0}^{M-1} X\left(e^{-j2\pi{m}}\cdot z\right)$$

Or even something else.

I'll be very happy for some clarification on this subject because I'm very baffled by it and I cannot find a solution anywhere, thank you.


texts: What is the result of fourier transform of an image

texts:
I am new to computer vision and Fourier transform concept. I have examined some codes. In those codes, an image is performed Fast Fourier transform by using the function np.fft.fft2(). As a result of invoking this function, we get a two-dimensional array filled with complex values.

What do these complex values refer to ?

Are they frequency values ?


texts: will always periodogram produce correct frequencies?

texts:
let say we have  some data,some signal written in this form

$x(t)=s(t)+\epsilon(t)$

where  $s(t)$ is pure signal and  $\epsilon(t)$ is  white noise  with mean zero and some variance  ,question is that if we have enough sample data,should  periodogram always  estimate frequencies  correctly?let say we have following sinusoidal data

$y[t]=A_1(sin(\omega_1*t+\phi_1)+A_2*sin(\omega_2*t+\phi_2)+....+A_p*sin(\omega_p*t+\phi_p)$+$z(t)$

i know that there is problem of variance increasing related to periodogram,but will it affect on frequency estimation?also i know that  resolution of periodogram is $1/N$,but let us suppose that  two frequency are not so close to each other,then will periodogram produce correct frequency estimation?variance is not important for me know


texts: How do i detect if an image has a gradient or not?

texts:
I have coloured images, some may be just clipart, some may be artwork, both could be with or without gradients.

Before i run a colour counting algorithm on them, i want to detect if the image has only solid block colours, or gradients in it.(Technically all compressed images will have small gradients in the form of anti aliasing, but i want to detect the gradients that were there in the original image)

I'm thinking of an approach in which i could plot a historam(of rgb or hsl values, or even grayscale) and if it has peaks that are smooth and not steep, then that indicates that the image may have an area with a gradual colour shift, with all colours of one hue appearing more or less equally(like the image of a sky would have gradual changes from blue to lighter blue to white).
Does this sound right?
Any other approaches for doing this?
Thank you.


texts: I am trying to create a linear panorama (a series of images taken from the same plane but not the same location and not rotated) but was not sure which transform is appropriate for this task.  I know a homography is used to stitch images together from a rotated point.  I think a transform is necessary but I am not even sure of that.


texts: Removing the Multiples of Decrease and Increase in a Spike

texts: I have a signal shown below. I got this signal from a glove, where I want to detect the movement of a finger. What I am planning to do is to threshold the signal, so I can get a binary signal indicates the presence of the spike. My problem is that I have multiple increase and decrease within a single spike. So, using threshold technique will produce a "fluctuation" of zeros and ones for each spike. This means that the finger was moved multiple times within that time interval, which is uncorrect.I tried using statistical measures to solve this problem, and I also tried to get the envelop of the signal. However, none of them was able to remove those increases and decreases. What do you suggest to solve this problem