texts: Block code error control with $d \ge c+u+1$

texts:
This is about error control coding formula

$$ d \ge  c+u+1$$

of a block code, with

$c$ being the number of correctable errors,
$u$ being the number of uncorrectable errors, and
$d$ being the distance of the code.

Per my understanding, this is applicable for all the block codes - linear or not. Now let us dissect the repeat code with respect to this formula.

Repeat code with $k=1$, $n=7$: Let us say we repeat each bit 7 times. $\mathrm 0$ is sent as $\mathrm 0000000$ and $\mathrm 1$ is sent $\mathrm 1111111$.  $d = 7$ in this case.  We conclude that all these combinations below are possible:

$$\begin{array}{|c|c|}\hline
 c & u \\ \hline
6&   0\\
5&   1\\
4&   2\\
3&   3\\
2&   4\\
1&   5\\
0&   6\\\hline
\end{array}$$

Now let us consider $c=3$ and $u =3$.  With respect to the repeat code we are discussing above, what does it really mean?
Can someone kindly explain with examples ?
How does the explanation change with one or two more of the above combinations?


texts: Stability of an unstable system using nonlinear element. Is it possible or not?

texts:
Say there is a system with open-loop transfer function
G(s)=1/(s−1)
. The system is definitely unstable.

If I put any nonlinear system in cascade with G(s) and from the output, a negative unity feedback. Is it possible to make the system close-loop transfer function is stable? It is assumed that the higher order harmonics are filtered in the close loop path.
electrical-engineering


texts: Verifying the computation of a convolution

texts:
I have an input signal $$x(n)=\left(3,-5,4,3,-1,-2,6,8\right), n=-3,..,4$$ and impulse response $$h(n)=(1,-1,1,-1,1), n=-1,...,3.$$

The convolution between $x(n)$ and $h(n)$ is

$$x(n)*h(n)=\sum_{-\infty}^\infty x(k)h(n-k)$$
If I'm not mistaken, I can reduce this to the finite sum
$$=x(-3)h(n+3)+x(-2)h(n+2)+x(-1)h(n+1)+x(0)h(n)+x(1)h(n-1)+x(2)h(n-2)+x(3)h(n-3)+x(4)h(n-4)$$

So, if I were to calculate the sum by hand, I would proceed by first evaluating

$x(-3)h(n+3)=3h(n+3) = (3,-3,3,-3,3)$ for $n=-4,...,0$
$x(-2)h(n+2)=-5h(n+3) = (-5,+5,-5,+5,-5)$ for $n=-3,...,1$
etc...

Then I would only add up the terms whose position $n$ aligns (that is, add all terms at n=-4 together, all terms at n=-3 together, etc...).

Is my approach to evaluating the convolution correct?


texts: How to apply a mel-filterbank to a signal?

texts:
I found this description. According to this, the next step is a "binning" where

  binning means that each FFT magnitude coefficient is multiplied by the corresponding filter gain and the results accumulated.
  What is the exact procedure they are describing?


texts: Pitch Detection: avoiding frequency doubling / halving

texts:
I am working on a tuning app. I have so far tried 3 different libraries with a number of different algorithms. However, when I compare to other tuner apps, I seem to be getting frequency doubling on certain notes with certain instruments. Sometimes frequency halving depending on other factors. I have tried adjusting the buffer size (size of array of samples) and also the sampling frequency.

Algorithms include: Auto-Correlation, YINFFT, Dynamic Wavelet.

Is there sometimes a need to filter the signal before hitting the algorithm?


texts:
I am new to the subject of Kalman filtering and therefore my question might seem trivial.

I see that there is a tight connection between Kalman filter and EM algorithm when one wants to predict the next state of a given signal. My question is what is the connection and how we can combine them in the prediction process?

Thanks


texts:
In my filter specs, the passband gain is given as 6.02db. How do I achieve this?

Usually all texts give the passband gain as 0db (as well as passband ripples if any).


texts:
Given is the illustrated circuit diagram of a linear, time-invariant, time-discrete system:

How do I show that the total system has the impulse response $h[n] = aδ[n] + bδ [n - 1] + cδ [n - 2]$ and determine the constants a,b and c?

with the following impulse responses of the subsystems:

$h_1[n] = δ[n] + (1/2)δ[n − 1]$

$h_2[n] = δ[n] − (1/2)δ[n − 1]$

$h_3[n] = −δ[n]$

$h4[n] = − (1/2)^n σ[n]$

So what I have done:

$h_{3||4}=−δ[n]−(1/2)^n σ[n]$

and than:

$h_{3||4+2}=\sum_{k=-\infty}^{\infty}(δ[n-k] − (1/2)δ[n-k − 1])(−δ[n]−(1/2)^n σ[n])$

$h_{3||4+2}=−δ[n]−(1/2)^n σ[n]-\frac{1}{2}(−δ[n-1]−(1/2)^{n-1} σ[n-1])=−δ[n]-\frac{1}{2}^nδ[n]+\frac{1}{2}δ[n-1]$

$h_{3||4+2+1}=(\frac{1}{2})^nδ[n]-δ[n-1]$

But the solution is $a=1$ and $b=-1$. How is $a=1$?


texts:
This question is really related to - is there any need for IFFT in the first place?

If we want to send a bunch of complex-numbers (vectors), then most OFDM discussions involve presenting those numbers to an IFFT block, and the output of the IFFT block will then have a bunch of complex numbers for which to transmit in a queued fashion through a QAM block.

Can I ask ----- is the IFFT block really necessary? Instead of using the IFFT block, is it possible to just place the original set of complex numbers (vectors) on the queue....and then transmit those numbers (real and imaginary components) - one at a time - through a QAM block?

The signal (without using IFFT) is still going to be OFDM, right?

Thanks for any comments/advice!


texts: Exponential average with time constant of slow, fast and impulse

texts:
I have been studying about exponential average.  There are enough explanations about this at Internet, but they do not explain about the time constant.

I have one channel with a $T$ seconds time signal with sampling frequency $f_s$.

If I want to do average of this time signal, we need to use either linear or exponential method.  Linear average method is quite simple so there is no trouble for applying.  However, if I try to apply exponential average method, there are some problems.

If time signal varies quickly, we prefer to use fast time constant 125 ms.  Also, the time signal varies slowly, using 1000 ms of slow time constant is better, but in this situation, I do not know how can I apply this time constant with time signal.

Is there any explanation or any example for doing exponential average with time constant?


texts:
I have some telephone voice audio with occasional "blips" in the audio.  The blips appear to come from an IP link buried in the PSTN (this is a conceptual explanation, so don't worry about things like packet loss concealment).   When a packet is dropped, there isn't a gap In the audio, instead, the audio has been spliced together causing a small discontinuity.

I am looking for a way to identify the discontinuities programmatically.  The most important feature of the identification is accurate time localization.  Also it isn't critical that all discontinuities be detected.  Even half would be sufficient.  My goal is to identify the time differences between detected discontinuities.  I can use this information to consider what processes may be involved in the errors.

I've tried all kinds of spectral / wavelet analysis to look for the discontinuities, but these methods have been no more effective that scanning the data (in a wave viewer) in the time domain and making judgments about the signal values.  Occasionally conditions are just right so you can clearly identify a discontinuity in the time domain.  In general the identification is very difficult.

So I've thought about another approach.  The audio signal is human voice, so the correlation characteristics are well defined.  I'm thinking I can take advantage of this and look for “outliers” in the data.

So here is the basic problem:

I have human voice that has been transmitted over a band limited channel with BW [200-3600Hz].  The sample rate is 8KHz, the audio encoding is 16 bit linear PCM.

Lets say I have data that runs for 10000 samples, call that number N and the data samples x[n].

I would like to create an estimator that scans through the data, working on M samples at a time and advancing through the data in 1 sample increments.

M is in the order of 10 to 100 samples.

Given samples x[n] to x[n+M], I want to estimate x[n+M+1].

This seems like a standard estimation problem, but I'm not trying to estimate x[n] in the presence of AWGN, I am trying to predict x[n] from previous M values given the known correlation between samples of a human voice signal.

Call the estimate e[n].  I will then compare e[n] with x[n] and use a threshold to identify if the data is probably an outlier.

So the punch line is ...  $$\text{What is a good algorithm for producing e[n]}$$

The estimator parameters can be approached in two ways...
1) derive parameters from the data
2) impose the parameters based on the known characteristics of human speech

As for a priori information:

PSD for male or female voice (average/typical) is available
 Probability distributions for modeling human voice are available

I'm just looking for some direction on the estimation approach.

I have Mathematic to crunch numbers and try out various approaches and assumptions.

Thanks.


texts: Is the expansion of this expression correct?

texts:
\begin{align*}
&(\delta[n]+\delta[n-1])*(\delta[n]+\delta[n-1])\\ \\
=\;&\delta[n]*\delta[n]+2(\delta[n]*\delta[n-1])+\delta[n-1]*\delta[n-1]\\ \\
=\;&(\delta[n]+2(\delta[n]*\delta[n-1])+\delta[n-1])
\end{align*}
I am not sure if its true that $\delta[n]*\delta[n]=\delta[n]$ and $\delta[n-1]*\delta[n-1]=\delta[n-1]$ for discrete signals but I proceeded with this assumption. Furthermore, how do we compute the convolution $\delta[n]*\delta[n-1]$?


texts: Does scaling property imply superposition?

texts: For a system to be linear,it follow the principles of scaling and superposition.Does scaling imply superposition?If so why are two different conditions given for linearity?If not can u specify an example for which only one of them is satisfied.


texts: Lynn's integer filter has a linearly increasing trend

texts:
I have a PPG signal sampled at 50Hz and I want to filter the signal using Lynn's integer filter. I.e

\begin{equation}
  H(z)=\frac{(1-1/z^m)^2}{(1-1/z)^2}
\end{equation}

Cutoff frequency is 5Hz, so this gives value of $m \approx 3 $ (it's a 3db cutoff) and hence the difference equation is

\begin{equation}
y[n]-2y[n-1]+y[n-2]=x[n]-2x[n-3]+x[n-6]
\end{equation}

Now applying this filter to the signal, my signal is filtered but there is some linear component that's making baseline to increase linearly.

Any suggestion where I am going wrong?

Data is processed on cortex M0 based bluetooth module and transmitted to phone. I am plotting csv file in Matlab.

Code of cortex M0:

float process_ppg_iir(uint16_t raw_data_ppg)
{
    int b0=1, b1=-2, b2=1, a1=-2;
    int a2 = 1;

    if( global_sample_counter <= 7-1 )
    {
        ppg_raw[global_sample_counter] = raw_data_ppg;
        if(global_sample_counter <=3-1)
        ppg_processed[global_sample_counter] = raw_data_ppg;
        global_sample_counter++;
    }
    else
    {
        // sfit values to left

        int i=0;

        for(i=0 ;i <=5;i++)
        {
            ppg_raw[i] = ppg_raw[i+1];
        }

        ppg_processed[0] = ppg_processed[1];
        ppg_processed[1] = ppg_processed[2];

        ppg_raw[6] = raw_data_ppg;
        ppg_processed[2] = (b0*ppg_raw[6]+b1*ppg_raw[3]+b2*ppg_raw[0])- a1*ppg_processed[1]-a2*ppg_processed[0];

    }
        return ppg_processed[2];
}


texts: High-pass filter with quantized (fixed-point) coefficients

texts:
I have a high pass IIR filter with numerator
b = [0.997688673703782,-1.995377347407564,0.997688673703782];

and denominator
a = [1,-1.995372005171182,0.995382689643947];

the frequency response seems ok with fvtool(b, a). However, the response changes a lot after the coefficients are converted to fixed point numbers by
bb = round(b * 32768) / 32768;
aa = round(a * 32768) / 32768;

The frequency responses are as follows

How do I design a fixed-point digital filter with specific low frequency response? For example, a high pass filter with a desired cut off normalized frequency. Thx!


texts: From my understanding our ears have hairs/cilia in the cochlea that resonate at frequencies within our hearing range.  To me this means we are hearing in the frequency domain as opposed to the time domain. But does that mean we are constantly ifft-ing the sound in order to process it?


texts:
In BPSK,
the constellation consists of 2 points (equiprobable) spaced at distance of $\sqrt{E_b}$ each from the origin.

So the average power from the constellation can be obtained by:

For BPSK, $P = \frac{E_b+E_b}{2} = E_b.$
For QPSK, 4 points which are equiprobable are spaced at distance of $\sqrt{2E_b}$ from origin each, that is they are placed on vertices of a square of side $2\sqrt{E_b}$. So, for QPSK, $P = \frac{2\cdot4\cdot E_b}{4}=2E_b.$

So, does this mean that the power required for QPSK is more than BPSK when the probability of error is same for both?

Note: $E_b$ is the energy per bit and $P$ is the power which is assumed as proportional to the distance of the signal point from origin in the constellation.


texts: Blind source separation from microphone array

texts:
I was following this article and I wanted to "borrow" their Idea for my own work.

The difference is that I am using a microphone tetrahedral array and not a binaural microphone. I have two different questions I guess:

First, I would love an intuitive explanation behind their pre-processing step. I could not figure out the intuition of going from a single dimension $\theta_{t,f}=\angle(X_{t,f}^{(0)},\overline{X_{t,f}^{(1)}})$ to two dimensions $\cos(\theta_{t,f}),\sin(\theta_{t,f})$ and back to a single dimension $\phi_{t,f}$ using PCA. What do these quantities represent?

Second, How can I apply a similar method for a tetrahedral microphone array? Is there a better\easier way? Is there a toolbox I can use?

The dataset I am working with contains 4 channels and can be downloaded here.


texts:
I want to know how can I achieve this effect:

https://www.youtube.com/watch?v=DQg9M_47c3A

Do I need to use a filter? And what can I use for the crackling, poping effect?
Thanks in advance!


texts: Haar Training with object Blacked out in Negative Samples

texts:
I am wondering if there is any downside to blacking out the target object when it appears in negative samples during Haar Cascades training.

Basically, If i want to detect a human nose. Can I just get lots of face images and black out the nose for the negative samples. I would then get lots of cropped pictures of the nose for positive samples.

I was wondering if there is a downside or problem with having lots of negative samples with the same non-nose feature e.g. a black rectangle. Is this going to train the cascade to expect a black rectangle in the negatives....????

Sorry if this questions seems naive but I have not done haar training before and the answer might help others who are investigating the training process...


texts: Getting a part of the invert of Si function

texts:
I'm working on an algorithmus that sould  need the inverse of the SI function.

since this last once isn't oviouse to calculate, I'm trying to get only the parobla part from the SI function, to be clair , say I have this figure :

I'm only interessted in the part from the max of each curve tell the point of intersection with the following one. So my question what is the fomula for the "parabola part " in si function.

the ploted function are all : si(3pi X /4)

thanks for any help.


texts: How/why are the $\mathcal Z$-transform and unit delays related?

texts:
The $\mathcal Z$-transform uses the same notation as the unit delay $z^{-1}$, but in $\mathcal Z$-transform $z$ is a complex number.

What's the relation between the $\mathcal Z$-transform and the unit delay concept?
Also, is there a complex number interpretation of unit delay?


texts: What are the keywords to find an algorithm that detects embossed text from a 3d model?

texts:
Currently I am doing an acadmic research about an idea which came into my mind lately.  I have a 3d model and I want to extract embossed text .. anyone knows any papers? or if it is already proposed? . I tried to research different keywords but nothing popped up which is relevent.

The text are bulging out (by a few millimeters)


texts: The role of GPS in INS/GPS navigation systems

texts:
Ideally, a gyroscope and an accelerometer would be enough for a complete navigation solution (attitude + position), using dead reckoning. This comprise the Inertial Navigation System, INS. In non-ideal world, we would couple the INS with GPS. The GPS helps 'fix' the navigation solution at certain times, to help mitigate the drift in the INS output.

My question.
Suppose I have no access to a GPS, but have access to a Spirit level instrument with associated camera and image processing algorithms. This system serves to provide an absolute values of pitch and roll angles, but with slower update rate and lower resolution. Still, it is assumed to be drift-free. Can such a system be used in place of normal GPS to achieve dead reckoning solution?

P.S. The reason for not using GPS is that I am trying to find a self-supporting navigation solution...


texts: The Nyquist formula for digitally sampling and recovering a continuous waveform is well known. Are there any mathematical formulas that show that it is computationally infeasible (or impossible) to reconstruct a waveform if you go below a certain sampling frequency?


texts: Relation between Kalman filter and Sequential linear MMSE estimation

texts: Are the results of applying  Kalman filter and  recursive linear MMSE estimation process the same ?


texts: Real Fast Fourier Transformation (FFT) in 2D changes with changing the axes order

texts:
I am using Python to calculate the real FFT for a 2D array. I found that the real FFT function does not return an array with the same size as the input array, rather, it returns an array with the same size as the first axes and half of the size of the second axes or vise verse based on the axes order that we choose.

I attached the complex FFT, real FFT with axes order (0,1), and real FFT with axes order (1,0) of an array with size(1400x144). See the difference between the second and the third image. Any idea why that happens, and what does it mean in terms of the linear property of the FFT. Thanks


texts: Extract repeating structure from an image

texts: I want to find repeating structures from the image .But I have no idea how to do it.Please help me.Actually i want to find how many lines and oval shapes look like similar and mark these by separate color.


texts: What factors should I consider in choosing an edge detection algorithm?

texts: I've learned about a number of edge detection algorithms, including algorithms like Sobel, Laplacian, and Canny methods. It seems to me the most popular edge detector is a Canny edge detector, but is there cases where this isn't the optimal algorithm to use? How can I decide which algorithm to use? Thanks!


texts:
I am using pwelch function of Matlab which returns the power spectral density (PSD) estimate. This got me confused about DFFT size and Windows size. Here my code:

% N = 94144
% fs = 44100
[data,fs]=audioread(filename);
segmentLength = 4410; % window size
overlappedSamples = 2205; %  50% overlap
[pxx3,f3] = pwelch(data,segmentLength,overlappedSamples,segmentLength,fs); % in this case pxx3 returns vector of 2206 values

% second parameter: the length of the Hamming window to be used
% fourth parameter: number of FFT points to be used

So here my Window size is 4410 and I am using 4410 DFFT points but I am still confused about the difference between the two? How come if I change the overlap from 50% to 0% I still have 2206 values in pxx3 vector?

Apologize in advance for any possible obvious explanation that I missed.


texts:
I am working on a position controller for a marine vessel. I have a measurement signal containing the y-position of the vessel that consists of both low frequency (<.1 rad/s) and high frequency (>.6 rad/s) motions. I am currently using a state observer that separates that combined motion in two separate states (a LF and WF states). The gains are calculated using the discrete time Kalman filter algorithm.
At every timestep I receive a new incoming measurement and my state observer corrects the predicted state with the measurement.
I want to compare the performance of this approach with using a low pass filter on the measurement signal instead of using an Kalman filter. The theory seems to be that a Kalman filter has a much lower phase lag, but I am seeing some amplifications in the magnitude bode plot of my outgoing LF signal compared to the incoming measurements and the filter thus amplifies motions that are between the LF and the WF frequencies...
I need some advice on how to implement a nth-order low pass filter in such a discrete time system. Is there an algorithm to filter the incoming measurements at every time step, or do i need to take the entire time trace of the measurement and filter that signal? I am using Matlab.
Any tips are more than welcome,
Scott


texts: I understand that with a standard filter, higher order will yield sharper frequency selection at the cost of increased phase delay. However, with so-called zero-phase-distortion filters like that provided by scipy.signal.filtfilt, will a higher order get you sharper frequency selection "for free"? (I know higher order filters take more computation time, but let's ignore that)


texts: Remove brighter regions in an image on frequency domain

texts:
I'm newbie and maybe this is not the right place to ask this question, or this question has no sense.

I'm very interested in working on filtering images on frequency domain. I have found a few filters on frequency domain and I wondering if it is possible to remove bright regions on an image (with white colour) using filters on frequency domain.

Imagine you have a greyscale image and you want to remove the pixels with white colour.

How can I do that?


texts: Impulse response of the system image processing

texts:
In case of the signal, when we plot an impulse response we have our x-axis - samples (or time), y-axis - amplitude, but in case I work with image processing?
x-axis is pixels? and y is still amplitude?


texts: Efficient implementation of spike removal

texts:
I have implemented the moving median absolute deviation (moving MAD) and it seems like bit-exact to Matlab's implementation. Nevertheless, I am sure that it is not efficient.
The usual median filter should be implemented with 2 heaps. The moving MAD can not be implemented this way since the absolute deviation vector for each element is completely different from one sample to another. This forces us to use the quick-select for every sample - which make the calculation very long...
function M = myMovmad(x, xmedian, windSize)
M = zeros(size(xmedian));
for iX=1:length(M)
   ind1 = max([iX - (windSize - 1) / 2, 1]);
   ind2 = min([length(x), iX + (windSize - 1) / 2]);
   M(iX) = median(abs(x(ind1:ind2) - xmedian(iX)));
end
end

Somehow, Matlab managed to implement moving MAD with computation time only twice the median filter. This suggests that they somehow managed to use a double median filter. Any ideas on how to implement it?
Seems like the Hampel filter is part of a more general group of filters called Recursive Median Filters (also related to Robust Scale Estimates). Several filters from this group have a C implementation in the GNU Scientific Library based on the linked article. Yet, their implementation seems to be very similar to the presented above - which is not satisfactory. Is there any better implementation or more efficient spike removal out there?


texts: Suppose I have a sinusoidal signal of the form $x(t) = a\sin\left(2\pi b(t-c)\right) + d$.  I understand $a$ is the amplitude, $b$ is the wave number, and $c$ is the phase shift.  I know that the term $d$ shifts the entire signal vertically, but does it have a specific name in signal processing?


texts: What is the point spread function and optical transfer function and what uses are they in image processing

texts:
So I seem to really be struggling with the concepts of the point spread function (PSF) and optical transfer function (OTF) and what they are used for in image processing.

Everything I seem to google on the concepts seems to come back with telescopes and microscopes or I seem to get information about Delta functions and impulse response of a system and how this relates to convolution, but nothing seems to tell me about what PSF or OTF actually do or measure.

From what I have gathered so far is the following.

You start with a linear time invariant (LTI) system you then apply a signal which can be broken down into Diracdelta functions ($\delta(x)$), aka the impulse. The (LTI) then outputs a response aka the impulse response ($h(x)$) and according to some web sites this is the PSF. Now I can follow the maths to a degree and see how the convolution between the impulse and the impulse response, but what I can wrap my head around is what the PSF is actually useful for.
Why is it useful for imaging systems? From a video that I glimpsed at on you tube the PSF spreads the Dirac delta function so in terms of image processing is this effectively telling us how much blur will be in the image itself? Is the the only thing the PSF tells us?
Moving on to the OTF, so this is the Fourier transform of the PSF and that as far as I have gotten, as I don't fully understand what the PSF dose for an imaging system. I really cant figure what the OTF does for an imaging system.
What's more confusing is now, I keep thinking of the OTF as a kinda of filter function when I see the convolution equation in the frequency domain, dose the OTF itself play a role in frequency filtering if so how?

Fundamentally could someone explain the concepts of PSF and OTF and what they actually tell me about the system in terms of image processing.


texts: How to separate two signals which have same frequency and phase but generated from different positions? For example, the EEG signals, we assume there are only two positions, position A and position B are separated but they generate electrical signals at same frequency and phase with different amplitude. When we measured the signal, the signal is the combine of signals from A and B. How to separate these two signals? Anyone has some idea? Many thanks.


texts: What methods can be used to remove ringing artifacts in the output of a digital filter?

texts:
I'm using digital filters to apply spectral mangling-type special effects to audio.

When using a digital filter (vsts/standalone DSP programs/outboard digital filter, etc.), especially when using narrow transition bands/brickwall filters, are there any effective ways to remove ringing artifacts introduced by the filter?  Please bear in mind I am new to DSP and my level of understanding is very basic.


texts: Samples per symbol and number of symbols for QAM

texts:
I am trying to understand the terminologies in QAM. This is the information that I have:

number of symbols -
bits per symbol -
samples per symbol -

I understand bits per symbol but I am confused with number of symbols and samples per symbol. I read that samples per symbol is sampling rate but what is the purpose of it.

Any link or explanation is greatly appreciated.

Thanks.


texts: Can we use beamforming to make sure that the signal will not make interference together in Full duplex?if yes,why?

texts:
To avoid signals will make interference to each other in full duplex,there are two methods to solve this problem.

Time-division duplexing and Frequency-division duplexing,they just use different frequency or time slot to transmit and receive the signal,so these two method can make sure that  signal won't have interference.

However, i want to know if there are two MIMO devices(two devices  are both with multiple received antennas and multiple transmitted antennas) in full duplex.

Can we use SVD to design the beamforming of these two devices to avoid their transmitted signal won't be the interference to each other in the same frequency and time ?

For example:A want to transmit signal to B ,and B want to transmit signal to A,so there will be two channel $H_{AB}$ and $H_{BA}$.So when i do SVD,and get the beamforming direction,$v_{ab}$ and $v_{ba}$,how do i prove that these beamforming can help the signal to avoid becomeing the interference of other signal?

Here is my thinking ,but i don't know right or wrong,the  $H_{AB}$ and $H_{BA}$ are random,so it is nearly impossible to let $H_{AB}$ be equal to $H_{BA}$,so it is impossible to let $v_{ab}$ be equal to  $v_{ba}$ or $v_{ab}=-v_{ba}$ ,so indeed  these beamforming can help the signal to avoid becomeing the interference of other signal.Is my thinking right?


texts: Efficient computation of Chirp Z Transform

texts:
Chirp Z Transform (1, 2, 3) is more powerful than zooming techniques (I use it to actually trace non-stationary chirp signals) and very usable in signal processing, but it's flexibility comes at price - the general CZT needs $3 \times FFT$, using Bluestein convolution algorithm.
Although generaly one if them can be precomputed - I have to perform full three rounds.

Is it possible to perform general Chirp Z Transform faster than using Bluestein algorithm (namely faster than $3 \times FFT$)?


texts: Connection between filter equation in frequency domain and difference equation in time domain?

texts:
I know that the frequency response of a filter is described by equation:

H(w) = 1-1.176*e^(-jw) + e^(-j2w) , where w is the angular frequency.

Then in time domain I have a filter that is described by difference equation:

y(k) = x(k)-1.176*x(k-1)+x(k-2)

Now I'm asked to explain the connection between these equations and why the coefficients for the both equations are the same [1 -1.176 1]?

I've been reading books and trying to find information around the internet but without any solutions for this. Could someone explain me the connection of these equations? Why are the coefficients same?

I have an idea that these two equations might represent the same filter but in different domains (time and frequency). Does convolution have something to do with this?


texts: Intuitively, what is fourier series representation of a signal? Also intuitively what is frequency response?

texts: I know these formulae and can solve problems mechanically but i never got the core concept. Please help me out with this.


texts: I am looking for an analytic description of a continuous-time Butteworth High-pass filter in the time domain (=impulse response)

texts:
having derived the Butterworth Lowpass Time domain response, I am now struggling to find a similar function for a Butterworth Highpass filter. I understand you need to replace s by 1/s. But this leads to a transfer function with as many zeros as there are poles. So you can no longer use the Heaviside 'cover-up' method to decompose the individual exponential functions, to arrive at the time domain response.
Is there perhaps someone who stumbled on the same problem and arrived at a solution ?
The ultimate goal is to arrive at a Butterworth bandpass filter whereby the lowpass and high pass sides can have a different order (slope). So I still need to convolve the LP- with the HP-filter. . .


texts: How to use wavelet decomposition for feature extraction (of fMRI images)?

texts:
I have a dataset consisting of fMRI images (from mice) which are divided into 4 groups (different drug dose levels applied). Each fMRI image is 4D, that means each voxel is a time series. For each fMRI image I want to extract one feature vector.

Now I want to use wavelet decomposition for feature extraction. In Matlab there exist no 4D wavelet decomposition, so I turn the 4D images into 3D by taking the average of the time series. Then I could apply 3D wavelet decomposition and taking the LL component as features, that means doing something like that:

WT = wavedec3(fMRI, 4, 'db4');
LL = WT.dec(1);
temp = cell2mat(LL);
feature_vector = temp(:);

Of course afterwards feature selection algorithms (like recursive feature elimination) could be applied to reduce dimensionality.

Another possibility would be to to the 3D wavelet decomposition for each 3D volume and extracting the LL component. This I could do for each time point and then stacking up the LL components to get a big feature vector.

What do you think of this approach? Are there better approaches?

Edit: Here is an image: https://www.dropbox.com/s/50gr2f1c66stcq4/tCut10_4D1c0_iso2238-brain.nii.gz?dl=0
I have found the following approach in a paper:

  we decided to use the concatenation of the high-order sub-band
  coefficients from each decomposition as a feature vector in k-nearest
  neighbor classification

How can I get the high-order sub-band coefficients in Matlab (using e.g. wavedec3)? And what do they mean with each decomposition?


texts: Non Uniform DFT Algorithm by Dutt & Rokhlin

texts:
I have implemented Dutt & Rokhlin's FFT algorithm [1] for non-equispaced data but for some reason I am getting very large errors ($E_2=0.04$ and $E_\infty=0.1$). I was wondering if there are any freely available implementation of this method so I can compare my implementation.

[1] Dutt, Alok, and Vladimir Rokhlin. "Fast Fourier transforms for nonequispaced data." SIAM Journal on Scientific computing 14.6 (1993): 1368-1393.


texts: Phase Correlation - Poor Performance on Noisy/Blurred Images?

texts:
I have successfully tested 1D phase correlation algorithm to determine vertical shift between two synthetic images.

When I moved to real images, however, it is not able to detect translation at all (the peak is located at 0, which is wrong result).

I have the following images:

And resulting phase correlation (Magnitude, Real, Imaginary):

The first scanline of the image is completely white, but the shift is obviously larger (20 pixels).

The expected result is white line on 20th row which happens only on synthetic images or light noise.

My algorithm is very simple - for each image column:

Compute 1D FT of source and target image columns (a=FT(A), b=FT(B))
Compute cross-power spectrum (cross_power = a *. conj(b) / |a *. conj(b)|) - *. denotes pointwise mutliplication, conj(x) denotes complex conjugate
Compute phase correlation (phase = IFT(cross_power))
Find maximum magnitude in every column of phase.
Find consensus peak location (e.g. median of detected peak locations)

Can you please advise me how to improve baseline phase correlation algorithm to deal with real-world (noisy) images?

Should I rather use NCC (Normalized Cross Correlation) instead of FFT-based phase correlation?

UPDATE

I was experimenting with zero padding to rule out errors introduced by circular shifting (only simple linear shifting of images is desirable) and tested this on original images from Wikipedia:

The single peak is clearly there as it should be:

However - if I perform slight smoothing (Gaussian blur) to reduce noise and actually improve the result, the phase correlation comes out totally mangled:

Here is the enhanced version - the original peak is weaker (why??) and there appeared new peaks around zero shifts (why??):


texts:
I have some clarifications required in this topic
So initially I know that to shift a signal $X(f)$ by $f_0$ we need to take its inverse fourier transform and multiply it with a factor of $\exp(−j2\pi f_0)$.

Now as I understand it, in the frequency domain the spectrum is shifted by the value of $f_0$  from its original frequency, correct?
So therefore, is the frequency of my original signal $x(t)$ actually increasing/decreasing?(depending again on the value specified by $f_0$)

Now coming to my problem at hand, I'm trying to design a receiver which compensates for doppler effect.

And as I've read up a doppler shift is nothing but an increase in frequency so am I on the right track in considering a frequency shift or should I actually consider a frequency scaling approach?
Or can someone tell me what exactly does a Doppler shift in frequency have an effect in the time domain?


texts: How to estimate octave and size for visual features positioned at Harris corners

texts:
I am currently working with and comparing the performance of several feature detectors provided by OpenCV as basis for visual feature matching.

I am using SIFT descriptors. I have accomplished satisfactory matching (after rejecting bad matches) when detecting MSER and DoG (SIFT) features.

Currently, I am testing my code with GFTT (Good Features to Track - Harris corners) to get a comparison, and also because in the final aplication, a set of GFTT features will be available from visual feature tracking process.

I am using cv::FeatureDetector::detect(...) which provides me with a std::vector<cv::KeyPoint> filled with detected features / keypoints / regions of interest. The structure cv::KeyPoint contains basic information about feature's location, as well as information about size and octave in which the keypoint has been detected.

My first results with GFTT were terrible until I compared the typical size and octave parameters in different types of features:

MSER sets the size (between 10 and 40px) and leaves the octave to 0
DoG (SIFT) sets both the size and the octave (size/octave ratio between 20 and 40)
GFTT the parameters are always: size = 3, octave = 0

I presume that is because the primary purpose of GFTT features was not to be used in matching but only in tracking. This explains the low quality of matching results, since the descriptors extracted from such tiny features stop being discriminatory and invariant to many things, including small, 1-pixel shifts.

If I manually set the size of GFTT to 10 - 12, I get good results, very similar to when using MSER or DoG (SIFT).

My question is: is there a better way to determine how much to increase the size (and/or octave) than just-go-with-10-see-if-it-works? I want to avoid hardcoding the size increase if possible and determine it programmatically, but hardcoding is okay as long as I have some solid arguments backing up my choices of the new size / size increase / size estimation algorithm.


texts: How to extract features of individual spikes in non-negative signal?

texts:
I have data of non-negative (in the sense there's no signal below baseline) spiking waveforms, which are in the form of a 1D array of numbers:

Spikes that cross some threshold are considered real signal events and I want to be able to measure the properties of individual events such as their amplitude, rise-time, decay-time, duration, and half-width.

The signals are pretty clean so I imagine I don't need some fancy machine learning algorithm. Would a wavelet transform approach give me the results I need? If not, what's the best and simplest approach here?


texts: I have a channel bandwidth $B_c$ and a signal bandwidth $B_s$ with $B_s<<B_c$. What is the problem when the signal bandwidth is smaller than the channel bandwidth? For example, my channel bandwidth is $B_c=20$ kHz and my signal bandwidth is $B_s = 10$ Hz.


texts: Why is it easier to design an IIR filter in the continuous time domain than in the discrete time domain?

texts:
Given that the goal is to approximate the ideal filter with an IIR filter, why would it be easier to design it in the continuous time domain than the discrete?

This paper says:

  Discrete
  time IIR filter design can be a very complex procedure in discrete time domain. Therefore, transformations have been
  developed to use well known design methods in continuous time domain.

This may be a very trivial question (sorry if it is), but I don't see why it is easier.

Perhaps I could be asking this in a better way:
Why do we need to translate filter specifications from discrete to continuous time and then do the calculations in continuous time? Why not directly in discrete time?


texts: Oppenheim and Willsky Signals and Systems Solutions

texts:
Hi All: This list has been great for me as a beginner but I decided to work my way through Oppenheim and Willsky and Mahab  "Signals and Systems" book since I still get sometimes confused by even basic questions asked on this list.
I also do some of the problems but sometimes I get stuck. So I've looked and found solutions manuals on the internet. The solutions are okay but sometimes pretty succinct. So, does anyone know if the manual written by Oppenheim himself (it can be purchased on Amazon but it's not cheap ) is better than the ones on the internet ? Amazon doesn't have a "look inside" feature for that book so I can't tell. Thanks.
I forgot to include that I am using the second edition.


texts:
In signal processing, when you sampling an analog signal,
the sampling theory says that the sampling frequency needs to be at least twice the maximum frequency in the analog signal content.

I understand that if the sampling frequency is smaller, then it can cause
a data loss, but what if the sampling frequency will be exactly as the maximum frequency
of the analog signal? Why should it be twice as great as the maximum frequency of the
analog signal?

How can I know what the maximum frequency of the analog signal is?


texts: How can i know the full duplex does work from the Shannon's theorem?

texts:
There is a full duplex system below,two user are $A$ and $B$,according the definition of full duplex ,$A$ and $B$ have to transmit and receive the signal at the same time.that is, transmitted signal will become a noise for  the received signal,and there are some formulas below to show the SNR

Let $t_A$ is the transmitted signal from $A$,and $t_B$ is the transmitted signal from $B$.

Now,$A$ receive the $t_B$ from $B$ and transmit $t_A$ to $A$.So the SNR for $A$ to receive the $t_B$ is

$\text{SNR}_{A \text{ decode }t_B}=\frac{\text{power of } t_B }{\text{power of } t_A \ + \text{power of channel noise} + \text{decode noise}}\label{SNR}\tag 1$

And according to the wiki: https://en.wikipedia.org/wiki/Shannon–Hartley_theorem

How do i make sure that $A$ can do decode the $t_B$?

I know the $C_A=\log_2(1+\text{SNR}_{A \text{ decode } t_B})$, but in most of paper, they all also call $C_A$ as a rate, so I think $C_A$ will not be equal to $R_A$.

So how can I know $C_A \ge R_A$,so the $A$ can really receive and decode the  $t_B$?


texts: Practical implementation of Expected Value?

texts:
If i compute the average power of my input signal random variable $X(t)$ as
$$R = E[X^2(t)]$$
i.e. as the expected value of a random process, is this really just an estimate of average power? More generally, is it true that we don't have (cannot compute) the Expected Values of actual input signals, because we have only one instance of a random signal to work with? And so we are stuck with just estimates of Expected Values, instead of the real, actual Expected Values?
thanks,
js.


texts: What do the filter coefficients in a digital filter represent?

texts:
I designed a digital filter using fdatool of matlab and obtained the filter coefficients from the tool.

The problem is that i designed a 4th order filter. This gave me 5 filter values

h[] = {0.1930,0.2035,0.2071,0.2035,0.1930}
x[k] = Discrete time input signal

Now on using the formula

Output = h[k]*x[n-k];

Output represents the final filtered value.Although the results are coming fine, but I am not able to find out how those coefficients are obtained by matlab and how mere multiplication(convolution) gives the final filtered response for any sample.

Any link or explanation will do. I wish to know the complete back-end working of filter coefficient calculation.

Please comment if i am unclear in my doubt somewhere.

Thanks :)


texts: Irregularities in tone generated using FFT data

texts:
I am implementing a simple program to generate tone in MATLAB using FFT/iFFT by zeroing all frequency bins except for the one frequency that I'd like to generate a tone in.

Sampling frequency is 16000 Hz.
I am using a 32 point FFT which gives me 16 frequency bins.

FFT data * Equalizer -> iFFT

If I want to generate a frequency of 1000 Hz, After FFT, using the Equalizer, I'd Zero all frequency bins except for frequency bin 2. This will generate a 1 kHz signal.

If I want to generate a frequency of 4000 Hz, After FFT, using the Equalizer, I'd Zero all frequency bins except for frequency bin 8. This will generate a 4 kHz signal.

I implemented this program.  Here are the results

For 1 kHz,

For 2500 Hz,

For 5500 Hz,

As you can see from the figure above, the 1 kHz is a clean signal. But as I try to generate higher frequencies, the signals are less smoother. The spectral figure shows that the correct frequency is generated, but i'm wondering if the irregularity is due to Harmonics or an other phenomena?

So how can I generate a more clean signal in the higher frequencies ? And if possible also the reasoning behind these 'irregularities'?


texts: Efficient frequency offset estimation of known signals

texts: Let's say that my receiver will be receiving known data signals that range from the very simple (tone) to the complex (known data sequence that is modulated (PSK/QAM/OFDM/etc.)).  What are the most computationally efficient ways to get a reasonably accurate estimate of the frequency offset?


texts:
I am new to the signals area and have been reading through a lot and have some questions.

Suppose I have a saved audio file on my computer, .wav file. I can view the time domain of the signal by identifying the sampling rate and bit depth. The resulted domain signal is a discrete signal, since everything stored in a computer is numbers.Now, I can convert this discrete signal into the frequency domain using the Fourier Transform algorithm. Since it is discrete, I must be using DFT equation below

Now, I can view the spectrogram of either continuous or discrete using the STFT, which computes the Fourier Transform over segmented windows of the whole signal (where we use FFT for DFT to reduce the complexity). The STFT equations of the continuous and discrete signals are:

My questions are:

1- Is my understanding correct?

2- Can we apply Hann Windowing on discrete signals?


texts: Calculating bpm from machine sound (not music)

texts:
I have a hydraulic breaker on a excavator that hammers with a dynamic bpm. I have recorded this sound so that it is in a mp3-file and would like to determine the momentary bpm for the length of the file.

I have tried using processing with beat detection from the minim-library but so far without any good results.

Is using beat detection with energy mode in a selected band the preferred way to go? I have had troubles getting good information about where, in terms of frequency, the beats are.

An example of the sound could come from http://www.youtube.com/watch?v=596Dtm95Txo


texts:
I am trying to compare power spectral density values (obtained from dsp.SpectrumAnalyzer) with PSD values obtained from hardware which has a VSA.
MATLAB's documentation says that " The power spectral density is the magnitude squared of the spectrum normalized to a bandwidth of 1 hertz." and expressed in dBm/Hz

whereas the hardware expresses PSD in units  dBm/RBW per 100 kHz    So,I'm assuming that it is normalized w.r.t 100Khz bandwidth
This is an example snippet of hardware's vsa( not my actual output)

Do I need to do any kind of conversion or something in terms of PSD ?
For ex:  dBm-->mW--> multiply by 100e3  something like that to properly compare? Kind of confused with these units.
MATLAB's output is off by approx 20 dBm

Here is the output comparison

EDIT>>>

0)  RBW is set to 100KHz on hardware and in MATLAB too
 1) I'm guessing there is a factor 100 which I need to multiply to PSD in mW to make it similar, but not sure why I need to do that

2)The reference load for matlab is set to 1 ohm by default, whereas  hardware (litepoint ) reference impedance is 50 ohms

3) Updating basic specAnalyzer code in matlab if that helps in understanding

nSpectralAverages = 3;
specAnalyzer = dsp.SpectrumAnalyzer('SpectrumType','Power density',...
                              'SampleRate',fs);
specAnalyzer.FrequencySpan = 'Span and center frequency';
specAnalyzer.Span = psdSpanLpVSA;
specAnalyzer.SpectralAverages = nSpectralAverages;
% Resolution Bandwidth
specAnalyzer.RBWSource = 'Property';
specAnalyzer.RBW = resolutionBandwidthHz;

specAnalyzer.AveragingMethod = 'Exponential';
specAnalyzer.ForgettingFactor = 1;
% Run the spec An and get collective result
specAnalyzer(WiFi_iqData_bw20MHz);
specData = specAnalyzer.getFramework.Visual;

I'm using exponential averaging method as its pretty clean and similar to litepoint's output

4) My other question is: Can I even compare outputs directly like this? Or should I just add the difference in spectrum peaks and then compare (after adding 50 Ohms to the MATLAB's output)

EDIT 5)
 I have converted dB/Hz (which matlab provides) to dBm/100Khz for comparison and also calculated power values for 50 ohm

Pwr in dBm/Hz --> convert to mW --> multiply by 10000/50 (100e3 for 100KHz and 50 for 50 ohms conversion)  --> then reconvert to dBm

Here is the output

Any comments /suggestions

Thanks


texts: Relative performance of RLS and LMS filters

texts:
It's known that the RLS filter converges faster than the LMS filter in general, but that if you're tracking time varying parameters the LMS algorithm can perform better.

My question is under what conditions does this hold? I understand that the LMS filter is like a point estimate, but the RLS uses more data - when would using less data be helpful?


texts: aliasing to a 50 Hz sine wave sampled at 5000 Hz sampling rate?

texts:
I sampled a 50Hz sine wave (its not perfectly a sine wave, it's a data coming from current sensor using Arduino).

Using real time graphing technique by sending the data from Arduino to the PC I managed to reconstruct the signal as attached here

The second experiment I logged my data into an SD card, my sampling rate was 5000 and when I tried to reconstruct the signal in MATLAB, I got this graph which doesn't construct the original signal back, but rather its strange as bellow:

Notice the maximum values for the both graphs.

Why the signal is not correctly reconstructed? I sampled it at 5000 Hz which is almost 10 times the original signal frequency and it meets Nyquist criteria ... And as a result of wrongly constructed signal the FFT is indicating the frequency of zero not 50 Hz.

The MATLAB code

filename = 'C:\Users\Sabir\Desktop\internship Sri Wawasan\testFFT.csv';

% thee file

fid = fopen(filename,'rt');
[data]=textscan(fid, ' %f',...%the values of the sensors as cell array
       'delimiter',',')  ;
fclose(fid);

sensorMatrix=cell2mat(data);

% the values of the sensors as matrix

%taking some point from the sensors matrix

y=sensorMatrix(1:3000,1);% array of one chanel

 plot (y)

L=length(y)

Fs = 5000;                    % Sampling frequency

T = 1/Fs;                     % Sample time              % Length of signal

t = (0:L-1)*T;                % Time vector

plot(Fs*t,y)

and finally here is the FFT, it has 100 Hz and 150 Hz components


texts: Obtaining impulse response by means of cross-correlation between input and output

texts: Having a system with an input (sound emitter) that is defined as a unit-variance white noise sequence, and I get the output (sound receiver) so I can measure cross-correlation functions between them, how could I employ the correlation function to obtain the impulse response h[n], which defines the media?


texts: Pretrained networks with Adam optimizer?

texts:
I have tried different pretrained networks with Adam optimizer, and obtained high performance. However, when I tried it with Alex network, the performance was poor. Could you please help me understanding the reason?
Thanks


texts: How to simulate a signal of a particular frequency according to the number of points in a period of the signal?

texts: I have one period data ($n$ points in total) of a signal. I want to generate a periodic signal with a total of $m$ points and corresponding signal frequency of $F$ according to this data. How do I do that? Besides, I want to design a low-pass filter according to the simulated periodic signal, $F_s$ and $F_{stop}$ need to be set in fdatool. How to calculate $F_s$? Thanks!


texts: How Can an Object Move by Less Than a Pixel Between Two Consecutive Frames?

texts:
I think video is a series of picture frames. Consider a black & white scenario (no RGB). A picture frame is a 2D array of pixel. Each pixel has a single color.
A pixel can't be half black or half white. It will be filled completely with one shade of color.

Consider 2 consecutive frames of video - let's say frame 1 and frame 2 .
Suppose frame 1 has a square-shaped object with coordinates $(x_1,y_1)$, $(x_2,y_2)$, $(x_3,y_3)$ and $(x_4,y_4)$ (top-left, top-right, bottom-right and bottom-left, respectively).

Now, if the object moves to the right then in frame 2 its coordinates can be $(x_1+1,y_1)$, $(x_2+1,y_2)$, $(x_3+1,y_3)$ and $(x_4+1,y_4)$ (top-left, top-right, bottom-right and bottom-left, respectively).

How is less than that possible?


texts: Multiple-image dense point cloud reconstruction with camera extrinsics/intrinsics

texts:
I have the following data available:

Images from different angles
X, Y, Z, pitch, yaw, and roll for each camera/image, together with the timestamp
Lens distortion parameters and intrinsic camera parameters such as focal length and CCD width

On my dataset, OpenSfM produced poor reconstructions and I realized that it tries to figure out camera extrinsics, which I already know.

My question: I am trying to produce a dense point cloud. Is there a name for this problem when I have such prior information? Which publicly available libraries can help me accomplish this task? Can someone point me in the right direction?

Thanks!


texts: What would be the best way to estimate velocity from a video?

texts:
I am not from an EE background, so I am looking for answers to some open-ended questions.

I want to calculate how fast water is flowing during a flood. With or maybe even without debris in it. I have footage video from which I can extract sec by sec images of changing landscape.

It can be considered analogous to a car velocity estimation problem, except the "object" in the case of flood becomes much more complicated.

So far I know about Optical Flow: http://www.mathworks.com/discovery/optical-flow.html

What are the latest advances in the field that might help me to accomplish my goal?

Any tips at all?


texts: Is a "Spectral Tilt Filter" the best way to get an arbitrary slope and cutoff LPF?

texts:
I need an arbitrary slope audio LPF for which both the cutoff frequency and slope in dB/oct can be smoothly modulated in real time.

Is the "Spectral Tilt Filter" described by Julius Smith the correct or best way to do this?

https://ccrma.stanford.edu/~jos/spectilt/

https://ccrma.stanford.edu/~jos/spectilt/spectilt.pdf

If so has anyone implemented this in C++ before or would it be hard to do?


texts:
There are two kind of average power I encountered in random signal class and textbook:

definition 1: average power =$$E[|x(t)|^2]=R_{xx}(0)=\int^\infty_{-\infty} S_{xx}(f)\,df$$
definition 2: average power =$$\lim_{T\to\infty}\frac{1}{2T}\int^{T}_{-T}|x(t)|^2\,dt $$
It seems that the two definition is different unless the signal is ergodic in $x(t)^2$. By the way, our teacher keep using the term "assuming average power of white noise $n(t)$ is $\sigma_N^2$" in test. But from the above definition, the average power is infinite for continuous white noise. I think in discrete white noise the average power can be well-defined but in continuous one I am wondering our teacher may take the definition wrong.


texts: Removing a sinusoidal artifact from a set of movie frames

texts:
I am doing some post-hoc analysis of a dataset consisting of a series of movie frames that are contaminated by a strongly periodic artifact. I would like to remove this artifact from my frames.

For ease of plotting I've just reshaped my array M of pixel values to [nframes, npixels], then averaged over all pixel values to give me a 1D vector m. Here's what this signal looks like in the time domain. You can see the oscillation quite clearly in the zoomed inset.

I then made a periodogram by taking Fm = rfft(m), and plotted abs(Fm)**2 against frequency. I see a very sharp peak at ~1.5Hz:

As well as the temporal periodicity, there also seems to be a weaker spatial component to this artifact, since at the exact peak frequency value there seems to be a smooth variation in phase across the x-axis of my frames, so that pixels on the right tend to lag pixels on the left:

As a brute force approach, I've tried just filtering each pixel in the time domain using a notch filter centred on 1.5Hz. I used an order 4 Butterworth filter with critical frequencies 1.46 and 1.52Hz (I'm not well versed in filter design, so I'm sure there may be more appropriate choices).

Here's what the mean pixel signal looks like after filtering:

And the corresponding periodogram:

The notch filter does a reasonably good job of reducing the artifact, but since it basically looks like a pure stationary sinusoid I can't help but think that I could do better than just attenuating that part of frequency space.

My initial (very naive) idea was to do something like:

Get the frequency, phase and amplitude of the oscillation from the Fourier spectrum for each pixel in the movie
Reconstruct the oscillation in the time domain
Subtract it from the movie frames

I realise this isn't something people usually do, since interference usually isn't so spectrally pure and temporally stationary, but I wonder if it might make sense in my case?

Data

Full 16bit TIFF stack (~2GB uncompressed)

Spatially decimated 8bit version (~35MB uncompressed)


texts:
I have 4 systems which are represented in z domain like this:

Where I know the poles and zeros.

Then I compute Partial Energy Sequence of impulse response of all these system using this formula:

And I get this result:

And I want to observe minimum energy delay property of the minimum phase systems can be specified as:

If I am right, the formula above tells us that minimum phase system has a bigger or equal at least partial energy but, unfortunately, you can see in partial energy sequence plot, the minimum phase system has the smallest partial energy!

Am I interpreting the minimum energy delay formula wrong or what am I missing here?


texts:
I'm writing a Code for STFT in matlab and I am in the initial stage. Right now I have managed to do the FFT of a small chunk of a time signal. I used zero padding.

The problem I am facing is that after FFT there are 3500 bin frequencies. (In total there were 7000, I took half of them). My sampling frequency was 1000. So that equates 1 Bin = 10/35 Hz.

When I plot the data, I have the bin values in the X-Axis. In this was my Signal seems to have amplitudes in the 421st Bin or 60Hz.

How can I make my X-Axis such that it progresses by 10/35 and shows the spike in the correct place at 60 instead of 421. Thanks.


texts: Length of Matlab Raised Cosine Filter Output Complex Vector

texts:
If I instantiate in Matlab a filter, a vector, and use them in the following way:

vector = (complex(randn(1,k), randn(1,k)))';
filt = comm.RaisedCosineTransmitFilter('RolloffFactor',sdrqpsktx.RolloffFactor,'FilterSpanInSymbols',sdrqpsktx.RaisedCosineFilterSpan,'Gain',1,'OutputSamplesPerSymbol',sdrqpsktx.Interpolation)

  comm.RaisedCosineTransmitFilter with properties:

                     Shape: 'Square root'
             RolloffFactor: 0.5000
       FilterSpanInSymbols: 10
    OutputSamplesPerSymbol: 2
                      Gain: 1
output = filt(vector);

output will be a k*2 x 1 complex double. This is because of the OutputSamplesPerSymbol setting. The documentation on this function states that

  The raised cosine filter has (FilterSpanInSymbols x
  InputSamplesPerSymbol + 1)  taps.

So this filter has 2*10+1 = 21 taps. How then is the output computed? If you take the convolution of the coefficients of filt and vector you will get a (k+taps-1)x1 complex double, which makes sense to me because the output of a FIR filter is the convolution of its impulse response with the input signal. How then is output a k*2 x 1 complex double?


texts: I'm trying to create a filterbank whose frequency response is generally flat when summed in parallel. Are there any tips to choosing center frequencies and bandwidths for a filterbank of overlapping bandpass filters? Does a gammatone filterbank sum up to a flat response?


texts: What are considered key EM signal measurements to help identify unique emissions?

texts:
I plan to conduct an EM study which hopes to identify unique signals emitted from a device.
While in acoustic signals, features which can be extracted include the likes of spectral centroids, etc. which can help identify acoustic sources -- so I was wondering what features are prominent when capturing EM emissions from a device and what makes them useful for identifying uniqueness? :)


texts: algorithm for segmenting cheese microstructure

texts:
I'm trying to get the internal geometry of cheese from images of its microstructure:

I tried the canny edge detector and otsu thresholding but neither of these worked very well. I'm guessing that I might need something more powerful but I'm not sure what as I'm new to the field of image processing.

In particular, I'd like to get the distribution of the distances between the pores and the spatial distribution of pore size from the image. Those are the two things I'm most interested in obtaining from the picture.


texts:
I'm trying to get a Hough transform to work in MATLAB, but I'm having problems. I have a really bad way of detecting peaks that needs to be fixed, but before that I need to be able to reverse the hough transform to create the lines again properly. This is the type of stuff I'm getting right now:

looks like its rotated by 90 degrees, but I'm not sure why. I'm not sure if it's my Hough space that's wrong, or if it's the way I de-Hough and draw the lines. Also could someone help improve my peak detection? The images used in the code are here

%% load a sample image; convert to grayscale; convert to binary

%create 'x' image (works well)
a = eye(255);
b = flipud(eye(255));
x = a + b;
x(128,128) = 1;

%image = rgb2gray(imread('up.png')) < 255;
%image = rgb2gray(imread('hexagon.png')) < 255;
%image = rgb2gray(imread('traingle.png')) < 255;
%%% these work
%image = x;
%image = a;
image = b;

%% set up variables for hough transform
theta_sample_frequency = 0.01;
[x, y] = size(image);
rho_limit = norm([x y]);
rho = (-rho_limit:1:rho_limit);
theta = (0:theta_sample_frequency:pi);
num_thetas = numel(theta);
num_rhos = numel(rho);
hough_space = zeros(num_rhos, num_thetas);

%% perform hough transform
for xi = 1:x
    for yj = 1:y
        if image(xi, yj) == 1
            for theta_index = 1:num_thetas
                th = theta(theta_index);
                r  = xi * cos(th) + yj * sin(th);
                rho_index = round(r + num_rhos/2);
                hough_space(rho_index, theta_index) = ...
                     hough_space(rho_index, theta_index) + 1;
            end
        end
    end
end

%% show hough transform
subplot(1,2,1);
imagesc(theta, rho, hough_space);
title('Hough Transform');
xlabel('Theta (radians)');
ylabel('Rho (pixels)');
colormap('gray');

%% detect peaks in hough transform
r = [];
c = [];
[max_in_col, row_number] = max(hough_space);
[rows, cols] = size(image);
difference = 25;
thresh = max(max(hough_space)) - difference;
for i = 1:size(max_in_col, 2)
   if max_in_col(i) > thresh
       c(end + 1) = i;
       r(end + 1) = row_number(i);
   end
end

%% plot all the detected peaks on hough transform image
hold on;
plot(theta(c), rho(r),'rx');
hold off;

%% plot the detected line superimposed on the original image
subplot(1,2,2)
imagesc(image);
colormap(gray);
hold on;

for i = 1:size(c,2)
    th = theta(c(i));
    rh = rho(r(i));
    m = -(cos(th)/sin(th));
    b = rh/sin(th);
    x = 1:cols;
    plot(x, m*x+b);
    hold on;
end

  Linked:
  How to do De-Houghing of a Hough transform'ed Image?


texts: Signal is not audible after frequency re-sampling

texts:
I'm trying to change the frequency of an audio signal from 22050hz to 500hz. I'm using librosa to read the wav audio and pass the custom sampling rate as 500. Once read, I'm saving it back to audio file. The frequency of the signal has been updated (verified using fft) but the problem is that new signal is inaudible (no sound).
It works fine (audible) for 8000hz as well as 4000hz. But as soon as I go below 4000, it becomes inaudible.
I've attached the plots for both signals (original: 22050 and modified: 500hz). Each plot shows time domain and frequency domain respectively.
Kindly let me know if I am doing something wrong or missing some DSP basics...]]


texts: How to find H(z) from just zeros and poles

texts:
I have a system with a DC gain of 8, poles at z = +- j/2 and zeroes at e^+-j5, I need to find the H(z).
I have tried this but not sure if it is right.
$$
H(z) = G_o * z^{-1} \frac{(z-z_0)(z-z_1)}{(z-p_0)(z-p_1)}
$$
which would be
$$
H(z) = G_o * z^{-1} \frac{(z-e^{j5})(z-e^{-j5})}{(z-\frac{j}{2})(z+\frac{j}{2})}
$$
Am I going about finding H(z) right and would the ROC be between two "circles"?


texts:
If somebody could clarify why everywhere is written that the interpolation filter should have gain $L$ where $L$ is upsampling factor.

What this gain actually means?
Does it compensates for the amplitude scaling inherent to upsampling?
If I would hypothetically have an "interpolation" filter which is not attenuating spectral replicas (let's call it unity filter) would this filter still have gain $L$, or in other words is gain $L$ something what is by the definition within the interpolation filter and then the filter coefficients which define how well the replicas will be attenuated is something which depends on the design/quality of the filter?


texts:
I'm trying to analyse a series of CT scans of coral samples, but am fairly new to this sort of image processing.

The problem I've hit is that a lot of the coral is hollow (in the images), and even worse, a lot is hollow but open sided (ie incomplete holes). For the complete circles I can use a Fill Holes process, which tends to work well.

But, since most of the coral holes are only semicircles the software cannot detect it's true shape. Is there something that might interpolate the missing coral and then fill the internal structure.

As seen in this image, some of the coral structure creates a complete circle (eg bottom right), but others are just semicircular shapes, or even hollow tubes (mid-right, top-right, all over the place...).

This may be further confused by the fact that in reality it is trying to fill a volume (as opposed to an area) because the images stack up into a 3d structure.

I am trying to use ImageJ, but am willing to try other tools if there is a way around this.

Thanks,
Chris


texts: How to determine if the system is invertible

texts:
Is there any systematic way to determine if the system is invertible?

My general approach is first trying to find the inverse system by using mathematical method; that is, solving for the output in terms of input. If this is difficult, my guess would be that the system is non-invertible, and the goal is then to sit and think of the two inputs $x_{1}(t)$ and $x_{2}(t)$ that generate the same output $y(t)$.

However, I was just wondering if this method is 100% correct:

If we can find the input $x(t)$ in terms of output $y(t)$ (by solving mathematically), does that always mean the system is invertible?
Is there any possibility that can lead to the failure in reasoning?

For example, determine if the following system is invertible:
$$ y(t)=\int_{-\infty}^{t}e^{-(t-\tau)}x(\tau)d\tau $$

Firstly
\begin{align}
y(t)&=e^{-t}\int_{-\infty}^{t}e^{\tau}x(\tau)d\tau\\
e^{t}y(t)&=\int_{-\infty}^{t}e^{\tau}x(\tau)d\tau\\
\frac{d}{dt}\left(e^{t}y(t)\right) &= e^{t}x(t)\\
x(t)&=\frac{1}{e^{t}}\frac{d}{dt}\left(e^{t}y(t)\right)
\end{align}
So the inverse system is:
$$ y^{-1}(t)=\frac{1}{e^{t}}\frac{d}{dt}\left(e^{t}x(t)\right) $$


texts:
I have general theoretical questions:

Is it true that an adaptive filter with two inputs (one normal and one delayed by the single time increment) can completely get rid of any single frequency noise?
Is it then true that a three-input adaptive filter can (completely) get rid of a noise consisting of two harmonics, etc.?

Maybe there is a theorem for this, any pointers would be appreciated.


texts: How to calculate auto-correlation of a bpsk modulated signal or how to calculate expectation value of complex exponential function

texts:
How to calculate auto-correlation of a bpsk modulated signal, or how to calculate expectation value of complex exponential function manually not by using matlab or any other software?

For example, if

$$x(t)= a\exp(i2\pi ft)+n(t)$$

how would you solve

$$\mathrm{E}[x(t)]=?$$

and

$$R(t,t_1)= \mathrm{E}[x(t+t_1/2)x'(t-t_1/2)]=?$$

where $a$ is either $+1$ or $-1$ mapped from the binary representation of the ASCII value of any text message.


texts:
I read this paper and need  your help to understand it.

Object Tracking with Improved Detector of Objects Similar to Target

In paper,  particle at the frame $t$ is represented by:
$$c^{(i)}_t(i=1,\ldots, N)$$
and after that say let $c^{(i)}_t$ used by the proposed method be defined as

$$(x^{(i)}_t, y^{(i)}_t, u^{(i)}_t, v^{(i)}_t, w^{(i)}_t, h^{(i)}_t)$$

where $(x^{(i)}_t, y^{(i)}_t)$ represents the center position of the target object, $(u^{(i)}_t, v^{(i)}_t)$ represents the velocity of it and $(w^{(i)}_t, h^{(i)}_t)$ represent the width and the height of the rectangle which involves the target object.

I can't understand if $c^{(i)}_t$ is particle and a particle is a pixel. How a particle in Particle Filter can have width and height?

How to set $x$,$y$ of the target for a particle?


texts: Interpreting the amplitude of signals in fourier transform

texts:
I totally understand the concept of fourier transform, but one thing thats bothering me is the amplitude that we plot in the frequency domain. What does that amplitude of each frequency signifies? Is it the amplitude of that particular signal component in the input signal, as it is for the frequency? Is there any other meaning or any other way we can infer the amplitude?

Thank you for your time.


texts: Digital Image Processing - Contemporary Research Topics

texts:
I need to propose a masters degree topic, and I'd like it to be in digital image processing. What are currently relevant topics in this area?

I suppose that I'm looking for some kind of optimization, either in hardware (like parallel processor architecture for image processing maybe) or software (image processing alogrithms optimization of some sort, maybe even in signal processing domain).

I'm leaning towards a software topic, because I think I can manage mathematics and algorithms better than computer engineering, compared to other people I guess.

Please suggest some contemporary topics and areas you believe are suitable for possible optimization, that could be achieved in a masters program :)


texts: Deriving time-scaling property for Fourier Series

texts:
thanks for taking the time to help with this problem!

I have to prove the time-scaling property:

$$
x_{(m)}[n] =
\begin{cases}
x[n/m], & n=0,\pm m, \pm 2m,...\\
0, & otherwise
\end{cases}
$$

First, for part (a), Show  that   $$x_{(m)}[n]$$ has  a  period  of $$ mN$$

Then, for part (b), Show  that   if $$\\x[n]=v[n]+w[n]\\$$ then$$\\x_{(m)}[n]=v_{(m)}[n]+w_{(m)}[n]
$$

There's a bit more to the problem after this, but I'm mostly concerned with these first two pieces. I know that for a periodic function $$x[n]=x[n+N]$$

Am I supposed to somehow prove that $$x[n/m+mN]=x[n/m]$$
using the Discrete Fourier Series analysis equation? What is a rigorous way to prove this.

For part (b), I'm unsure of how to prove the linearity in a way that doesn't seem trivial.

Thanks!


texts: Understanding legacy code: Algorithm to remove radial lens distortion

texts:
The method below to remove lens distortion from a camera was written more than ten years ago and I am trying to understand how the approximation works.

void Distortion::removeLensDistortion(const V2 &dist, V2 &ideal) const
{
 const int ITERATIONS=10;
 V2 xn;
 xn.x=(dist.x - lensParam.centerX)/lensParam.fX;
 xn.y=(dist.y - lensParam.centerY)/lensParam.fY;

 V2 x=xn;
 for (int i=0;i<ITERATIONS;i++) {
   double r2 = Utilities::square(x.x)+Utilities::square(x.y);
   double r4 = Utilities::square(r2);
   double rad=1+lensParam.kc1 * r2 + lensParam.kc2 * r4;
   x.x/=rad;
   x.y/=rad;
 }
 ideal.x=x.x*lensParam.fX+lensParam.centerX;
 ideal.y=x.y*lensParam.fY+lensParam.centerY;
}

As a reminder:

lensParam.centerX and lensParam.centerY is the principal point
lensParam.fX and lensParam.fY is the focal length in pixel
lensParam.kc1 and lensParam.kc2 are the first two radial distortion coefficients. This is $k_1$ and $k_2$ in the formula below.

The formula to add lens distortion given the first two radial distortion parameters is as follows:

$$
x_{distorted} = x_{undistorted} \cdot (1+k_1\cdot r^2 + k_2 \cdot r^4) \\
y_{distorted} = y_{undistorted} \cdot (1+k_1\cdot r^2 + k_2 \cdot r^4)
$$
where $r^2=x_{undistorted}^2+y_{undistorted}^2$ and $r^4=(r^2)^2$

In the code above, the term $(1+k_1\cdot r^2 + k_2 \cdot r^4)$ is calculated and saved in the variable rad and the distorted x is divided by rad in each of the ten iterations.

All of the cameras we use have a pincushion distortion (so $k_1<0$)

The question is how is this algorithm approximating the undistorted image points?
Do you know if there is any paper in which this algorithm is proposed?

The opencv undistortion may be a bit similar, so that link may be useful but it is not quite the same though.


texts: What is the rule for manipulating the boundaries of a summation?

texts:
When working with DTFTs or $\mathcal Z$-transforms, we sometime get summations that do not go from $n=0$ to $+\infty$.
For example, suppose we have the sequence $x(n) = -\alpha^n u(-n-1)$. To find the $\mathcal Z$-transform:
\begin{align}
X(z)&=\sum_{n=-\infty}^\infty x(n)z^{-n}\\
&=-\sum_{n=-\infty}^{-1} \alpha^nz^{-n}
\end{align}

I understand this, the step function(which was shifted and inverted) causes the sequence to exist for all values from $-\infty$ to $-1$, and is $0$ everywhere else. However, the next part of the solution confuses me:
$$=-\sum_{n=0}^{\infty} (\alpha^{-1}z)^{n+1}  $$
I am not sure how they managed to change the boundaries.

From my interpretation of the result , a flip of the boundaries $\sum_{n=-\infty}^{-1}$ to $\sum_{n=-1}^{\infty}$ for any sequence will cause the sign of $n$ to change. Is this true?
Then, to get from $\sum_{n=-1}^{\infty}$ to $\sum_{n=0}^{\infty}$,do you just need to add $1$ to wherever here is an $n$?
Should you always first flip the boundary (when necessary) and then only change the index afterwards?


texts: Aliasing in digital communication system

texts:
In a digital communication system, is it possible to counteract the aliasing problem by properly tuning the constellation order $M$ and/or the carrier frequency?

Here is my train of thought, please correct me if I'm wrong:

The sampling rate needs to be 2 times the signal bandwidth. This is because we need to cover all the frequencies in which the signal operates. If the signal breaks the Nyquist criterion we'll only get a part of the signal. So if I look at a fix sampling rate and try to tune the constellation order $M$ up and down it won't help, because the signal will still have the same bandwidth. The only thing that will change is the transfer rate $r_b = \log_2(M)/T_s$, where $T_s$ is the sampling rate. Also tinkering around with carrier frequency will only move the signal up or down the frequency. So neither of these solutions will counteract the aliasing problem. The only solution is to somehow reduce the signal bandwidth. I'm thinking of using an RRC filter on the transmitter (to shrink the bandwidth) and then using another RRC filter on the receiver to counteract the ISI.


texts: How to measure acoustic pressure level under water with a hydrophone?

texts:
this is my first post here and I am also new in signal processing.

Let's say I have a hydrophone with amplifier which is connected to a sound card plugged in to a computer. I gather the sounds to a WAV file every 3 seconds and analyze each file in a Python program. The system is supposed to detect loud events which are dangerous for sea animals.

I would like to know how to reliably measure acoustic pressure (loudness?) of events occuring under water based on WAV data. I am not sure if I should use exactly the same formulas as measuring SPL in air. I do not have the hydrophone yet so I can not really tell anything about it at this moment, but I am pretty sure the catalog notes of the hydrophone will be available for me when I finally get it.

It would be good enough if the measurement had an error under 5 dB SPL. It does not have to be perfect, I just want it to be relative and adapted to under water characteristics.

Could the simple measurement be calibrated by shifting measures by single constant in dB?

I found a similar solution in Determine Sound Intensity in SPL. But the problem is I do not know if I will be able to have all the data needed for this, mainly about amplification levels. Would the calibration-like solution be good in this case? How can I do it?


texts: ARMA & MA methods: how do you know the error terms?

texts:
Reading the ARMA model for the first time, and I'm confused.

Let's say I have a time series

x = [1, 2.1, 2.9, 3, 4.1]

According to the ARMA model, $X_t$ is a linear combination of previous values and errors, something like

$$\sum_i \phi_i X_{t-i} + \sum_i \theta_i \epsilon_{t-i}$$

But, what are $X_i$ and $\epsilon_i$??

is $X_i$ the actual value of the series at $t=i$? Eg, in my example $X_2 = 2.1 ?? (with 1-based indexing)
if so, what are the error terms?

The same question for the simple moving-average model, where all the $X_i$ values are remain unused.


texts: AWGN and Rayleigh fading in slow flat fading channels in MATLAB

texts:
I wanted to add Additive White Gaussian Noise (AWGN) and involve effect of slow flat fading on my transmitted signal in Matlab.

I created noise with zero mean and variance of one by

awgn_noise = random('norm',0,1,1,NoOfSamples);

Then I created Rayleigh fading by

rayleigh = sqrt( (random('norm',0,1))^2 + (random('norm',0,1))^2 );

As far as I understand, the rayleigh values will attenuate the whole signal while gaussian noise values will be added to each sample of transmitted signal as:

received_signal = (transmitted_signal*rayleigh) + awgn_noise;

Am I doing it in a right way?


texts:
I am unsure about which approach is "better" (less time good accuracy) for classifying gestures:

The system is a doppler radar that returns I and Q signals

Approach 1:
Have several subject perform gestures and label all gestures
Then train a ML model (KNN, SVM) cross-validate etc...
This approach requires that I collect a lot of data from several subjects

Approach 2:
Use peak analysis, finding the number of peaks that represent a gesture
I also use the distance between peaks as a characteristic of a gesture
This requires no training data but rather looking at the raw data determining peaks and distances between peaks and mapping that to some criteria for a gesture
This saves a lot of time and I don't have to collect so much data from subjects

It seems as though the solution is always to use machine learning, but I could easily do this by observing peaks.

How can I determine what approach to use?


texts: Estimating variance in arbitrary, periodic signal

texts:
I have a periodic signal $x[m], m \in [0;M-N+1]$ made of modulated templates $s[n],~ n \in [0;N-1],~ N \ll M = NK$ of finite energy and support (i.e. zero outside of its defined interval, which does not extend to infinity). For simplicity, we write thus

$$
x[m] = \sum_{k=1}^{K}A_{k}s[m-n_{k}] + w[m]
$$

with $n_{k}$ the $k$-th repetition of the template modulated by $A_{k}$. The noise term $w[m] \sim \mathcal{N}(\mathbb{0},\sigma^2_{w})$ sums over the whole signal (not just one template) and can be considered i.i.d for each realization.

Is it possible to estimate the variance $\sigma^2_{w}$ of the noise, given this setup? For one, I have seen methods that try to obtain some portion of the signal $x$ where the template $s$ is absent, but in my practical case, that is impossible to obtain. What DSP tricks can be applied in order to obtain this information?


texts:
I have a matrix in (x,y,z) coordinates and also i have a transformed version like (x_new,y_new,z_new).

I need to calculate a transformation matrix that can transform (x,y,z) to (x_new,y_new,z_new). But i have really no idea is there any kind of technique?


texts: Fast Fourier Transform showing the same results but with different files?

texts:
so I'm pretty sure that I'm plotting the wrong frequency domain against my FFT values because I keep getting basically the same graph shape every single time. I think that I just don't comprehend the context of some of the values, as I'm quite new to signal processing. Attached below is the frequency domain I'm attempting to use, which is what I'm seeing on most websites. Is T the actual period of your data? It doesn't really matter whether or not I have user input or hardcode a value in, the same graph shape remains. Same goes with completely different data sets, always the same shape remains.

import matplotlib.pyplot as plt
from scipy.fft import fft, ifft

transform = fft(data)
per = input("What's your period: ")
T = int(per)
f = np.linspace(0, 1 / T, N)
plt.plot(f, np.abs(transform)*(1/N))


texts: Identifying filter type from Difference Equation?

texts:
So I am given a filter with the following DE:
$y(n)=0.9051y(n-1)-0.598y(n-2)+0.29y(n-3)-0.1958y(n-4)+0.414x(n)+0.862x(n-2)+0.414x(n-4)$
How can I determine what kind of filter it is?
Right away, by looking at the equation, I want to say it's an IIR filter. To double check, I took the z-transform and found its poles and zeros:

Poles:
0.667
-0.003 $\pm$ 0.57j
Zeros:
$\pm$0.867j
$\pm$1.154j

Since the poles are not at zero, then the filter must be IIR.
Moving onto the magnitude and phase response. Using freqz in MATLAB, I get the following frequency response:

and then plotting the magnitude and phase separately I get:

To me it looks like a band-stop filter from the magnitude response and the shift in phase.
Is this correct? Is there a systematic way of determining what kind of filter it is from the DE?
Thank you!


texts: Detecting a Signal Inside a Time Series Using MATLAB's $ \tt xcorr() $

texts:
I would like to find the exact replica of signal A in time series B. I am working with the simple toy example below, in which A is located starting at the 4th position in B.

I thought that using xcorr would achieve this but I am clearly failing somewhere. xcorr doesn't seem to be the right function despite the MATLAB help notes on xcorr and comments such as:

  Cross-correlation is usually the simplest way to determine the time lag between two signals. The position of peak value indicates the time offset at which the two signals are the most similar.

A = [1 2 1];
B = [0 9 8 1 2 1 7 3 1 0];
[c, lags] = xcorr(A,B)
lags(c==max(c))
c =
Columns 1 through 12
  0.0000    1.0000    5.0000   14.0000   18.0000   11.0000    6.0000   12.0000   26.0000   26.0000    9.0000    0.0000
Columns 13 through 19
  0.0000    0.0000    0.0000   -0.0000   -0.0000   -0.0000   -0.0000
lags =
  -9    -8    -7    -6    -5    -4    -3    -2    -1     0     1     2     3     4     5     6     7     8     9
ans =
  -1     0

The max correlation values are located at lags of -1 and 0, which doesn't match the offset required to get A to match B. This leads me to ask:

When is xcorr useful for finding the exact signal in another signal? 2. And what function should I be using to find the location of A in B?

Ideally I would like to test this method on more complicated signals as well as look for methods of detecting "similar" signals inside other (longer) signals.


texts:
I was doing some research on filters, So I designed butterworth filter based on pole locations. I applied to a simple sine signal to check for the outputs. I cannot find the reason for what I noticed.

Why does higher order filter have alot of phase shifts. Is it trying to adjust for more noise reduction? If, Yes how is it mathematically possible? I have only changed the order of the filter, I have kept cut off frequency same


texts: Image Contrast Enhancement Threshold Selection

texts:
I have a a set of 24bit images with bright reflective spots washing out the underlying detail. While I'm interested in tone mapping algorithms, since these bright spots are purely noise I would like to threshold them out and render the rest. The histogram of the image looks like:

and is slightly bimodal in the tail where the overexposed pixels form a slight bulge. Sometimes this bulge is larger or smaller, but it's never dominate and the tail of valid pixels is fairly long.

Is there an efficient approach to identify the boundary of a bimodal distribution (even in this challenging case)? I recall an algorithm that iterates to identify a midpoint between two unbalanced "chunks" of a distribution but cannot recall its name. Ideally, the algorithm would find a theshold of about 3500 so that the very bright pixels are thresholded off.


texts: How to solve this equation (about complex envelope)?

texts:
I am a beginner of digital signal processing. In my research project, I need to calculate this equation which is below.

$$ e(t) = \Re \Big\{z(t) \, e^{j \omega_0 t} \Big\} $$

I know the $e(t)$ and I want to know how to calculate $z(t)$ and $\omega_0$. And I also want to know what's the meaning of $\omega_0$, if it's the same as the center frequency of $e(t)$.

I am sorry about that this question is very basic. Thanks!


texts:
I've been working much with numpy.fft lately where just like the documentation says:

  When the input a is a time-domain signal and A = fft(a), np.abs(A) is its amplitude spectrum and np.abs(A)**2 is its power spectrum. The phase spectrum is obtained by np.angle(A).

Then I took a look at DCT, but I could not figure out how to derive the phase from the results, because only real values are contained, so the np.angle() will be $0$. From the FFT results I can take out interesting elements, calculate amplitude, phase and plot them as cosines:

[A*np.cos(2*np.pi*f*t + ph) for t in range(N)]

where A is the amplitude, f is the frequency, ph is the phase-shift and t is the variable, i.e. time. So my question is: can the same be derived from DCT results and how?


texts: How can I improve the resolution of a spectrogram of a low-frequency signal with high sampling frequency (Python)?

texts:
Imagine you have signals $x_1(t)$ and $x_2(t)$ that contain a limited number of periods of low frequency oscillations and are sampled at 44100Hz (coming from an external source) and you want to obtain their spectrograms.

I chose nperseg=8820 to capture one period of 5Hz (44100/5=8820) in an analysis window and noverlap=1 to move in steps of one sample.

As shown in the figure below, after zooming the frequency axis, the frequency resolution in this low-frequency region is poor. Are there ways to improve this resolution? By setting special parameters of the spectrogram function or by downsampling for instance?
And why does the spectrogram of $x_2(t)$ change color over time?

import numpy

import scipy.signal
import matplotlib.pyplot as pplot

fs = 44100
t = numpy.linspace(0, 100000, 100001) / fs
x1 = numpy.sin(2*numpy.pi*5*t)
x2 = numpy.sin(2*numpy.pi*5*t**2)

f1, t1, Sxx1 = scipy.signal.spectrogram(x1, fs, nperseg=8820, noverlap=1)
f2, t2, Sxx2 = scipy.signal.spectrogram(x2, fs, nperseg=8820, noverlap=1)

pplot.figure(1)
pplot.clf()
pplot.subplot(2,2,1)
pplot.plot(t, x1)
pplot.subplot(2,2,2)
pplot.plot(t, x2)
pplot.subplot(2,2,3)
pplot.pcolormesh(t1, f1, Sxx1)
pplot.ylim([0, 30])
pplot.subplot(2,2,4)
pplot.pcolormesh(t2, f2, Sxx2)
pplot.ylim([0, 30])
pplot.show()


texts:
My question is probably very stupid, but I've been strugling for a while on it now...

In need to find the Fourier transform of $1+\cos^3(2\pi ft)$.

I wrote that :
$$\cos^3(2\pi ft)=\frac{\cos(6\pi ft)+3\cos(2\pi ft)}{4}$$
And so I have:
$$\delta(f) +\frac 18 \bigg[\delta(f-3f_0)+\delta(f-3f_0)\bigg] +\frac 38 \bigg[\delta(f-f_0)+\delta(f-f_0)\bigg]$$

So, on my spectrum, I should have a dirac at $0$, a smaller one at $f_0$ and a smaller at $3f_0$...

But when I process it with matlab (using fast fourier transform), I get this :

(With a frequency of $10\textrm{ kHz}$).

So the dirac I thought would be at $3f_0$ is in fact at $\frac{f_0}{2}$. What am I missing ?


texts: What should the amplitude be when plotting 1-sided Amplitude Spectrum?

texts:
I have a continuous signal x(t) such that

$x(t)=12cos(6\pi t)+6cos(24\pi t)+3cos(30 \pi t)$

and is asked to sketch a 1-sided Amplitude Spectrum of the signal x(t) if sampled above the minimum sampling rate.

because $w=2\pi$, i worked out that the three signals are 3Hz, 12Hz and 15 Hz.

I'm just wondering, when I plot the Amplitude Spectrum should the Amplitude just be the corresponding coefficients? ie. 12 for 3Hz, 6 for 12Hz and 3 for 15Hz?

EDIT: Additionally, what's the difference between 1-sided Amplitude Spectrum and 2-sided Amplitude Spectrum? Does one offer any more benefit over the other?


texts: How can I detect when a signal deviates from a flatline?

texts:
I apologize if this is not the correct forum, but I thought I'd ask.

I have an array of signal samples and I want to detect (retroactively, once I have measured the time/magnitude values) if there are any spikes / deviations during a sampled real signal
How would I do this intelligently?

I've been computing the mean of all my sets and the standard deviation and seeing if any of the individual samples greatly deviate from the mean, but I'm thinking there must be a more established method or approach


texts: What would be the outcome of the convolution of two images?

texts:
Lena

Mask

I have written a C# code which produces the following output.

Is my output correct?
Am I padding in the correct way?


texts: Geometric Transformation in Gradient Domain Possible?

texts:
I work with images in gradient domain because I sometimes need to manipulate image gradients (i.e. Laplacian filter responses) rather than intensity values.

However, I need to apply a geometric transform (distortion) to an image already in gradient domain.

Is is then meaningful to reintegrate the distorted image back to spatial domain?

Here is my earlier question related to gradient domain reconstruction with some images.


texts: How does shift and scaling inside of a function affect its Fourier Transform?

texts:
The properties aren't entirely clear to me, sorry for the basic question.

I know the Fourier Transform of one function.  Say, $\text{rect}(x,y) \Leftrightarrow \frac{\sin \pi u}{\pi u} \frac{\sin \pi v}{\pi v}$.  Now, I have some related function and I want to easily get the FT based on simple properties.

For example, now I have something like $\frac{1}{3}\text{rect}(8x - 4, 4y - 2)$.  How does this shift and scale inside the function affect its (continuous) Fourier Transform?


texts: Given an experimental FFT plot, how to find the best match from a set of generated FFT plots?

texts:
What I'm trying to do is, given some experimental data and it's (magnitude normalized to 1) FFT, match the FFT with one of say 1000 other (magnitude normalized to 1) FFT plots. Please note that the experimental/generated plots all have the same bin width/count.

Initially what I'm doing is taking the normalized cross correlation between the experimental FFT plot and each of the generated FFT plots, and then saving only the zero lag value. Then the highest of these values is found at the end which tells which plot correlated best..

This actually works pretty well, but it doesn't seem like something that is done often.. so

Does this make sense? Is it something that's ever done in the DSP community? Are there better methods of doing this which I'm oblivious to? (Note I have tried an MSE metric with limited success).
If what I'm doing is okay, are there any improvements I can make to it. I have two small problems. The first is computational time, I can compute the zero lag correlation by hand in Matlab as sum(x.*y)/scalefactor (scalefactor = sqrt(sum(x.^2).*sum(y.^2)) ) or I can use xcorr(x,y,0,'coeff') to grab the zero lag value. I'm not sure if these are optimized as well as they could be...  The second issue is that if any of the set of generated FFT's are large, say a constant 1 over f=0 to 0.5, the cross correlation metric will be large despite the experimental FFT being much "different".  This actually makes me think cross correlation is not the right metric to use, so, any thoughts?

UPDATE: So thinking about this some more, I determined what I was doing was equivalent to just taking the two sequences and performing a circular convolution on them and saving the maximum value. This is the same as computing the FFT of the sequences and then cross correlating them and saving the zero lag value.

With this method I end up doing something like ifft(fft(x).*conj(fft(y))) to do the circular correlation quickly, although I'm still trying to determine if this is more efficient than what i was doing before...


texts: Constant used to determine the minimum samples in Compressed Sensing

texts:
A key result in compressive sensing states that, with high probability on the random
draw of an $\ m × N$ Gaussian or Bernoulli matrix $\ A$, all $\ s$-sparse vectors $\ x$ can be reconstructed from $\ y = Ax$ using a variety of algorithms provided

$\ m ≥ Cs\ln(N/s)$,

where $\ C > 0$ is a universal constant (independent of $\ s, m,$  and $\ N$). This bound is in fact optimal.

In practical terms, how does one interpret/find $\ C$?

source: http://www.cis.pku.edu.cn/faculty/vision/zlin/A%20Mathematical%20Introduction%20to%20Compressive%20Sensing.pdf


texts: Relationship between real and imaginary part of a real-valued and causal system

texts:
I have one question about the real part of a real-valued and causal system with the imaginary part of its Fourier transform given by

$$\textrm{Im}\big\{X(e^{j\omega})\big\}=3\sin(2\omega)-2\sin(3\omega)$$

How can I obtain the real part of the Fourier transform?

i have simulated this by octave here:

>> w=[1:100];
>> Im_X=sin(2.*w)+sin(3.*w);
>> plot (Im_X);

Is it possible to solve in by the Octave/Matlab?


texts:
If I have:

$$ y = x_r+jx_i + n_r +j n_i$$

with $n_r$ and $n_i$ Gaussian with mean 0 and variance $\sigma^2$, what is the pdf of the envelope |y| and phase(y)? Is it still Rayleigh-distributed and uniform, respectively?


texts:
Why is the Laplace transform commonly taught as the unilateral Laplace transform?

I mean, for the Fourier transform, we commonly have the bilateral transform... if the signal is 0 for $t<0$, then it turns into a unilateral Fourier transform. Why not have this same convention for Laplace transform? Why specifically introduce the unilateral version?


texts: Having difficulty checking for time invariance of discrete system

texts:
A system is given with the following equation:
$$y(n) = 3y^2 (n-1) - nx(n) + 4x(n-1) - 2x(n+1)$$
I need to check for the linearity and time invariance of the system.

By just looking at the equation I can guess the system is both non-linear and time-variant. But I am having hard time proving it.

I know that a system having output $y(n)$ for input $x(n)$ is linear if the weighted linear combination of the input signals produce weighted linear combination of the output of those individual input signals. On the other hand, a signal is time invariant if a particular delay in input signal causes equal delay in the output signal.

In my example, I did the linearity part using the proof by contradiction technique.

For the time invariance part, I'm having a little trouble. If I delay the input by $k$ samples and call the corresponding output as $y(n,k)$, then
$$y(n,k) = 3y^2(n-1,k) - nx(n-k) + 4x(n-k-1) - 2x(n-k-1) \tag{1}$$

Now if I delay the output by $k$ samples and then call the corresponding output as $y(n-k)$ then,
$$y(n-k) = 3y^2(n-1-k) - (n-k)x(n-k) + 4x(n-k-1) - 2x(n-k-1) \tag{2}$$

My confusion here is that how can we say these two equations are different, since we cannot compare them term by term since the first term in both equations have totally different meaning. I may have not seen something plain and simple here, please point that out to me.


texts: Gonzales Digital Image Processing and the Laplacian Operator

texts:
In Gonzalez' book Digital Image Processing, third edition, he writes on page 182 that

  It can be shown that the simplest isotropic derivative operator is the laplacian operator

where the Laplacian is given by
$\nabla^2f = {\frac {\partial^2 f }{\partial x^2}} + {\frac {\partial^2 f }{\partial y^2}}$, and the particular paper he links in reference is not available for free.

It is :
Rosenfeld A, Kak A.C. Digital Picture Processing, vols. 1 and 2, 2nd ed., Academic Press, New York.

I was looking for insights to why:

a)The Laplacian is isotropic

b) What he means by "simplest". I am assuming this means in terms of computational complexity of things like how many differentiation operations, additions ops, multiplication ops, etc.

Any help appreciated.


texts: Encounter 0 when calculating log power spectrum

texts:
To convert power spectrum to a log-scaled one, how to define log10(X(k)) if X(k)=0 for some k?

For sake of illustration, I brief my process as follows which is a convention one:

Calculate the magnitude spectrum X(k) of the time-domain signal x(n) by X(k) = abs(fft(x(n))).
Convert the magnitude spectrum or power spectrum to db by 20*log10(X(k)) or 10*log10(X(k)**2), respectively.

My problem arises when there is X(k)=0 when computing log10(X(k)) which is either not defined or -inf. How to deal with this?


texts: What is the definition of small/large signal bandwidth?

texts:
What is the definition of 'small signal bandwidth' and 'large signal bandwidth'?
If I google them, I only encounter them in an electrical context (transistors etc.). However, I am looking for a general definition (for any time signal).