texts: How does MATLAB recover picture from magnitude spectrum alone?

texts:
This is the transformation I did.
The code fft2() the Lena picture than ifft2() it back to the original. Add some abs() so it actually displays it.

According to this post an image cannot be reconstructed without the phase information, yet I see no indication of phase being used anywhere here.

I'm guessing MATLAB still uses it but keeps it out of sight for convinve. If so is it possible to view the phase component of a given picture as well as the magnitude spectrum?

CODE:

[x,map] = imread('PATH'); %import image
i = ind2gray(x,map);   % to greyscale

I = fft2(i); % 2D FFT

I = fftshift(I); % centre

ir = ifft2(I);

figure(1); imshow(abs(i),[]) % original
figure(2); imshow(log(double(abs(I))),[]) % original
figure(3); imshow(abs(ir),[]) % original

I guess I worded this really badly. How do I see the phase plot of the image's transform? I guess that sounds less stupid.


texts: Understanding Ergodicity and Ensemble Averaging

texts:
Literature says that a stationary signal is ergodic, if its ensemble average = time averages. Should it be the statistics computed by time averaging = statistics computed by ensemble averaging?The way I understood from the book in the link is as follows :

Case1: There are N samples in a time series I compute the mean1,skewness1,kurtosis1 .

Case2: Next, with the N samples, T experiments are conducted and in each of the experiment is calculate the statistics. After, T experiments are done, we calculate the average of these statistics - mean_avg,skewness_avg, kurtosis_avg. This is called as Ensemble averaging or Probabilistic averaging.

If mean1 = mean_avg and so on, the the process/signal is ergodic. Is my understanding correct?


texts:
I'm developing a singing game and I want to output player's voice through speakers. I'm using portaudio for that, I acquire the input signal and just write it to the output buffer. The problem is the voice is bare audible. I tried to write to output buffer multiplying by a constant but that distorted the voice.

How would I do that?

Thanks.


texts: Are there any other libraries for Image Processing using hadoop?

texts:
I have been looking for libraries for Image Processing using hadoop, but by now, only have been able to know about hipi, and to some extent hadoopy. Are there any other libraries for the same?
Hipi uses java programming, so I am looking for some sort of python-integrated programming with Hadoop? Kindly help!


texts: $N$ point moving average filters in state space

texts:
I am new to this filter, I did read about them, but could find out a state space notation of these:

$$y(n)=\frac{1}{N}\sum_{m=0}^{N-1}x(n-m)$$

Are moving average filters an LTI systems?
And how do I represent them in state space representation? i.e with $A,B,C,D$ matrices.


texts:
I am having trouble understanding exactly how the matrix interleaver. I have read the following page from MathWorks. In it, it gives the following example where "123456" is interleaved as "142536." Basically, it split every pair. Now, send the first packet as "123456" and 2nd packet as "142536" will allow one to correct any single deletions in each packet with the lower bound being 6 undecodable combinations(i.e. the same character is deleted in both packets).

Now, this is fine for a single deletion, but what if there are more than one deletion in each packet, will the matrix interleaver take this into account and generate a different pattern?
Is there a benefit to having one pattern over another? It seems interleaving is just increasing the entropy.

So, consider the following 2 patterns: 142536 and 531642. I would argue that the 2nd pattern has more entropy as every 3 bits have no adjacent characters(e.g. 531, 316, 164, 642).


texts:
I'm now processing PCM codes extracted from .wav file and want render the spectrum myself. First I try to read a spectrum on my foobar2000 player as below.

My problem with this spectrum is: what do x-axis and y-axis represent? IIRC, the x-axis represents different frequency(or angular speed) and the scale should be whole-number times of fundamental, i.e. 50. However, when I divide next by its preceding, e.g. $94\div 69$, the outcome is roughly always 1.37. As to the y-axis, why the scale is negative? What is the calibrated value, i.e. $P_2$ in $10\log_{10}{\frac{P_1}{P_2}}$.

If I want to render the amplitude spectrum with PCM code, should some normalization be first taken(I know the original 8-bit PCM code ranges from -128 to 127, even normalized range is -1.0 to 1.0. It seems I can't use these values directly to represent amplitude of the signals)?

Thanks and Best Regards!


texts: Intuitive explanation of tracking with Kalman filters

texts:
I would much appreciate an intuitive explanation for (visual) tracking with Kalman filters.
what I know:

Prediction step:

Dynamic system state $\mathbf x_t$: target location at time $t$
Measurement $\mathbf z_t$: the image at time index $t$ (??)

Based on images/measurements $1\rightarrow(t-1)$ I want to predict state $\mathbf x_t$? (using dynamic equation) Is that correct ?

How can I interpret the correction step into those terms (image, target location) ?


texts: Is the frequency spectrum dependant on frequency, or on imaginary angular frequency?

texts: The frequency spectrum of a time domain signal x(t) can either be written as X(f) or $X(j\omega)$. But how is the later correct? I mean, the frequency spectrum is clearly dependant on the frequency, not on a $j\omega$ part, is it?


texts:
I'm very new to the idea of signal processing, could someone point me in the direction of of a program to toy with images, below is a link to 2 taken a split second apart that showed up on my Amazon app. I've been making decimated images recently in Photoshop and want to play with images in a way that may have more effect like this

The second image is sort of pixelated but not totally decimated image of the first image, an almost plain book cover. It's a split second of the lower one of this pixelation  then snaps into the regular image. How can I take original images and process them with different signals to this effect. Notice there's banding on the top and bottom so it's not just a simple rescaling in Photoshop which I'm very familiar with.


texts: how to extract a radio signal features with python?

texts:
I have a dataset of radio signals that i want to classify. So, I decided to extract features. After some googling, I have noticed that I have to calculate moments, cumulants, Kutosis and skewness to use them as features.

for the moments I found that there is a function called scipy.stats.moment/. But then, I found another code :

def moment(sample, p, q):
    m = np.mean((sample**(p-q)) * (np.conjugate(sample)**q))
    return m

what is the difference between the 2 functions? and do I calculate the cumulants basing on the moments?

for the skewness and Kurtosis what do they really represents?
Are there any other features that could help?


texts:
I have data from an experiment and apply a lowpass filter (digital Butterworth filter, in Matlab).

My question ist what happens if I apply the same filter e. g. 2 times on the data?

What is changing? Is it like I have the double order?

The question refers to the filtfilt function in Matlab:

http://www.mathworks.de/de/help/signal/ref/filtfilt.html

The source [1] says on page 336:

  In many filtering problems, we would prefer that the phase
  characteristics be zero or linear. For causal filters, it is
  impossible to have zero phase. However, for many filtering
  applications, it is not necessary that the impulse response of the
  filter be zero for n < 0 if the processing is not to be carried out in
  real time. One technique commonly used in discrete-time filtering when
  the data to be filtered are of finite duration and are stored, for
  example, in computer memory is to process the data forward and then
  backward through the same filter.

[1] Oppenheim, Alan V., Ronald W. Schafer, and John R. Buck. Discrete-Time Signal Processing. 2nd Ed. Upper Saddle River, NJ: Prentice Hall, 1999.


texts:
Is the system $y[n] = x[n] - x[n-1]$ stable or unstable ?
If unstable, can you please give some examples of input signals for which the system becomes unstable?


texts: How to validate an estimated model in case of output-only data (in frequency domain)?

texts:
Before moving to the actual question, I would like to emphasize on the following points (maybe they are obvious to some of you, but I still would like to list them, since they make the difference):

I don't have any reliable information on the input, thus I have only
the measurements of the output $y(t)$.
I have only 1 set of recorded data, thus no repetitive measurements are in this case available.

Objective: Identifying a reliable transfer function model for this data in the frequency domain (e.g. rational fraction polynomial with numerator $B$ and denominator $A$)

Question: After obtaining a transfer function model, how does one validate this model and thus can be assured that it does not contain any systematic/modelling errors? Please, keep in mind the above 2 points!

To my limited experience, calculating the uncertainty of the transfer function residuals will be not possible, since the missing information on the input (and thus also not having the variance of the input). A second approach that I thought of is to do a 'simple' whiteness test of the residuals (sum of squares due to errors (SSE) or the R-square both mentioned in the Matlab manual), but is this approach even significant? I mean, sure... One obtains a result, but it's complex valued due to the data ($Y(k)$) which is also complex valued. Consequently, there is always an imaginary part which makes it fail the criterion (i.e. model is ok if SSE is close to 0). Any thoughts/solutions on this? Or am I mixing things up?

Any help, advise/guidance (tips) or references that I can consult in order to solve this issue is very much appreciated! Because I'm really lost and totally confused.


texts:
I was looking into proof and find something strange:

The last part we obtain from DFT definition.
$$X[k] = \sum^{N-1}_{n=0}x[n]W^{kn}_N, \quad\text{Where}\quad W^{kn}_N = e^{-j\frac{2\pi}{N}nk}$$

So, looking at $W^{-k}_NX[N-k]$ we can see that when $k = 0$ we will have $W^{0}_NX[N]$ and we know that our DFT coefficients only can be from $[0,N-1]$.

So my question is: what does it mean when we have $X[N]$ DFT coefficient? Or did i understand something wrong?


texts: What does the one-tap equalizer used with OFDM accomplish?

texts:
I've read that OFDM normally uses a one-tap equalizer.  It seems that a one-tap equalizer could only scale and delay a signal.  Why is this useful?

I thought multipath was handled through the cyclic-prefix and by choosing a symbol width that is large compared to the delay spread.  Why is an equalizer needed at all?


texts: method to detect frequency sweep in audio

texts:
I have search a bit to try to find a similar questions, but I have not been able to find any leads.

There are techniques to programmatically detect steady tones in audio, such as the Goertzel algorithm. I have been trying to find a way to detect a frequency sweep of some kind. My specific application is to monitor the audio from a security camera, and detect, say, when a door prop or car alarm is triggered. If it matters, one can assume that the sound will repeat many times, and that the frequency is a smooth sweep, and not discreet tones.

I don't want to base it strictly off of amplitude, since the frequency response is sometimes very non-linear on these cheap cameras, and other noises can be a source of false alarms. Also, the alarm source may be distant.


texts: Algorithm to compute the Variance of the signal?

texts:
I have 6.4 sec recording of a discrete signal on 40Hz frequency (256 values).

How can I compute the variance of the signal?
Please, share an algorithm in pseudo-code or in an actual programming language.


texts: Automotive Audio Question: IIR Filters and minimum phase

texts: In a car, does matching the EQ of both the left and right side using IIRfilters mean that I'm matching the phase of each side? I have someone telling me that the car's environment is mostly minimum phase and that matching the left and right side will match its phase response. I have never heard of such a thing. I know they would match amplitude but would highly doubt they're matching the phase which is something an FIR filter would actually do. Any help would be appreciated.


texts: Need an Identity for CTFT Polynomial Raised to an Exponent

texts:
I need to the find the inverse continuous time Fourier transform for unitary angular frequency of the following signal:

$e^{a\omega^2 - b\omega + c}$ where $a$ and $b$ and $c$ are real numbers and I want to find the corresponding time-domain signal.

I was able to get the $e^{a\omega^2 + c}$ term transformed, but I was unable to find a transform for $e^{- b\omega}$ that didn't result in a distribution.

Without doing math and looking at the symmetry, I want to say that the $e^{- b\omega}$ term does a complex time shift, but now my mind hurts. Can somebody look up the identity?

--edit--
This spectrum doesn't need to be symmetric, or causal, so expecting some solutions to have imaginary time could be correct. Can somebody comment on this?


texts: Finding the four corners of each quadrilateral shapes in an image

texts:
I am working on some image processing application using Matlab. The image after segmentation will look (more or less) like the figure below.

Now I want to find the four corners of each shape to crop it (I can access each using shape using its pixels as they have the same label after segmentation). I though of using a corner detector like harris, but it gives me many additional corners (as the sides of the shapes are not really straight due to discretization. for example, a straight line in an image will look like the image below, and hence will introduce many corners.

In even worse cases, due to the imperfection of the image segmentation, the corners may actually be lost and look like a curved line as shown below, even though the image before segmentation had these clear 4 corners.

Another approach that I thought of is first to crop each shape, and then to use the line information (using a line detection algorithm) of the 4 sides and find the intersection of each adjacent sides. However, the line information, again due to imperfect segmentation, may not exist (as a single straight line per side, a side could be detected as multiple non-connected lines). Moreover, again due to imperfect segmentation, the 4 sides may have some artifacts which will hinder proper line detection.

Any suggestions?


texts: Numerical differentiation on circular data

texts:
I have multiple time series of position data (x, y, z) and orientation data expressed as Euler/Tait-Bryan angles (yaw, pitch, roll) obtained from a head tracking device.
I need to obtain velocity information from this data to understand the average and maximum head speed of the users.

Since a first-order differencing amplifies high-frequency noise, as discussed in this answer, I consider applying smoothing and particularly, a Savitzky-Golay filter, to get less noisy estimates of the velocity. For the position components, e.g. $x$, I can compute the smoothed derivative easily using the Scipy's implementation:

vx = savgol_filter(x, window_length=29, polyorder=4, deriv=1, delta=dt)

where dt=0.005s is the time interval between my samples.

However, I'm not certain how I should compute the angular velocities from the Euler angles because the data contains discontinuities at the boundaries $\pm{180}$ degrees. Consider for example this portion from the yaw component:

import numpy as np
alpha = np.array([-178.06, -178.48, -178.91, -179.37, -179.83, 179.72, 179.3, 178.88, 178.46, 178.04])

As a workaround, I first computed the first-difference and set the erroneous values to 0 that are caused by the discontinuities (I didn't bother to compute the correct values for these because the effect on average/maximum velocity is negligible given that I have thousands of samples). Then I applied the SG filter to the corrected first-difference and scaled by my sampling time. See below:

alpha_diff = np.diff(alpha, 1)
alpha_diff[np.abs(alpha_diff) > 180] = 0
v_alpha = savgol_filter(alpha_diff, window_length=29, polyorder=4)
v_alpha *= 1/dt

Is this a valid approach to smooth circular/spherical data like Euler angles that continuities discontinuities at the boundaries? I'm just not sure if this workaround conceptually makes sense.


texts: FIR filter design and implementation meaning

texts:
What is the output of the convolution meaning which is used in the FIR filter?

how can conclude the output of the FIR filter in the output according to the input $x[n]$?


texts: Finding baseline (reference) of nosiy data and lag/lead between 2 signals

texts:
I have 2 datasets which vary with time as shown in the figure - Sa – Red  ,  Sb – BLACK . I am doing the analysis in R. The entire dataset and a segment of data from 30 - 31 s are shown below -
 -

As you can see from the figures, the datasets appear similar but one dataset  leads (or lags) the other dataset in time. The downward peaks appear to be slightly shifted in time for one of the signals wrt the other.  I would like to determine the following –

The baseline value (reference) for the two signals –
Is there a statistical method to find out this? Is there some signal processing techniques that need to applied before determining the baseline? For Sa, the baseline is more noisy and shifts up and down – so it seems difficult to assume a constant reference line
The time lag / lead between these two signals –
I tried to make the reference line constant by removing data points above an approximate baseline and replacing it with the approx baseline value. Then I found out values sa1, sa2, sa3, sa4, ..etc.  Similarly, I found sb1 ,sb2, sb3, sb4,… etc.

2a. Is there a way I can map sa1 to sb1, sa2 to sb2..and so on? The idea is to calculate (sa1-sb1), (sa2-sb2),… and find out the average time lag/ lead for the two signals over the entire dataset. I understand that this method is very approximate, since the resolution is lost while assuming a baseline based on just eyeballing.

2b. Is there another method for calculating the time lag/ lead? Or the exact times sa1,sa2.. etc  at which the signal drops below the reference line and comes back to its reference line?    Will a  cross correlation work? How do I use it for noisy signals?

3.The frequency of the downward peaks


texts: Yule-Walker PSD Estimate of an AR Process

texts:
I am trying to implement a Yule-Walker PSD estimation in Python but my results are not up to the expectations. In MATLAB, I would normally implement my functionality as follows:

pxx = pyulear(x,order,nfft)

The process is the same in python using the Pyuler module as follows

data = (data - data.mean()) / data.std() # Normalize to a zero mean signal
order =16
p = pyule(data, order, NFFT=256)
p.run()
Pxx= p.get_converted_psd(sides='onesided')
Pxx =np.abs(Pxx)**2 # I want to plot the square of the PSS
Fxx=p.frequencies(sides='onesided')
plot (Fxx, Pxx)
show()

I tried the following similar approach but I am getting a wrong output as well

ar, P, k = aryule(data, order, norm='biased')
psd = arma2psd(ar)
# Get just one side of the psd
Pxx = psd[len(psd):len(psd) / 2:-1]
Pxx =np.abs(Pxx)**2
plot(Fxx, Pxx)

Compared to the expected values (from a trusted third party software), my script's output is on average 7587764 times bigger than the expected. When I plot my expected vs the actual value, I get the following picture

My question are:

What I am doing wrong?
The documentation says that the sequence should be a white noise process of zero mean and variance. Can this be achieved this approach

      data = (data - data.mean()) / data.std()

Does anyone know of any Python modules that implement the Yule-Walker PSD like MATLAB does?


texts: What is the 2D Fourier Transform of this function?

texts:
$
f(x, y) =
\begin{cases}
1,\hspace{30px} x > 0 \\
0,\hspace{30px} else\\
\end{cases}
$

i.e. $f(x,y)$ is a bi-variate function which is zero everywhere to the left of the y-axis and one everywhere to the right of the y-axis.


texts: How to locally quantify the 'sharpness' of an image?

texts:
I am trying to quantify how much sharpness (or acutance) is in a picture which has some bokeh (out of focus background).

I am using the Python scikit image for that. Here is my naive approach:

import matplotlib.pyplot as plt

from skimage import data
from skimage.color import rgb2gray
from skimage.morphology import disk
from skimage.filters.rank import gradient

cat = data.chelsea() # cat is a 300-by-451 pixel RGB image
cat_gray = rgb2gray(cat)

selection_element = disk(5) # matrix of n pixels with a disk shape

cat_sharpness = gradient(cat_gray, selection_element)

plt.imshow(cat_sharpness, cmap="viridis")
plt.axis('off')
plt.colorbar()

plt.show()

So here is the picture (notice the background not in focus)

And here is the gradient, which actually measures the difference in contrast:

This difference in contrast problem is more obvious if one uses the Lena image:

Here, the background is caught as well due to the difference in contrast (there is a black frame on the top right)

Any ideas about how to give an scalar value where only the focused areas are highlighted?


texts: Beginner Attempting FFT Signal Filtering With Numpy

texts:
I've tried looking around for information on this, but I'm really out of my league here. I'm a guy who likes to fool around with Python, and I wanted to make a program that would filter an audio file. I'm using Python and NumPy, with the scipy.io.wavfile module for importing and exporting Wave files. I've gotten it messing around with volume, but not filtering. Here's what I have so far.

rate, data = wavfile.read('./TriLeftChannel.wav')

filtereddata = numpy.fft.rfft(data) # FFT Filtered data
freqdata = numpy.fft.fftfreq(data.size) #Frequency data
filtereddata = AudioFunctions.Filter(filtereddata, freqdata, data, rate) # Filter the data

def Filter(filtereddata, freqdata, data, rate):

    #fftchunks = (rate / 2)# + 1

    x = freqdata[:len(data) / 2]

    for f in range(len(x)):

        if x[f] > 0.1:
            filtereddata[f] = 0.0
            filtereddata[len(data) / 2 + f] = 0.0

    return filtereddata

In that function, filtereddata is the FFT'd data, freqdata is the frequency data that I got with fftfreq(), and data is the wave file itself, 'bare'. Rate is the sampling rate (though I don't use it). This function doesn't actually filter the frequencies (although I know it's a hard filter and no filter should really be this harsh). After I'm done, I output the file with

filteredwrite = numpy.fft.irfft(filtereddata)

filteredwrite = numpy.round(filteredwrite).astype('int16') # Round off the numbers, and get ready to save it as 16-bit depth file (?)

wavfile.write('TestFiltered.wav', rate, filteredwrite)

Since I'm kind of struggling even just to have gotten this far, I was wondering if anyone could give me any pointers or a kind of beginners' tutorial for FFT? Of course, any help would be greatly appreciated.

EDIT: Fixed indentation issues.


texts: Properties of projected 3d points (to 2d), Principal component analysis (PCA)

texts:
This question is a little theoretical. Say I have 3 points that are bound within a certain 3D volume of some shape (i.e. box, cylinder, cone, etc). By using PCA, I find the most two dominant directions and reduce the data dimension to 2D.

All of this is done by the following:

Compute 3x3 covariance matrix of the 3D data.
Take eigenvectors and eigenvalues of the covariance matrix.
Sort by eigs by descending order of eigenvalues.
Take first two largest eigenvectors and multiply them with the data. The data is now 2 dimensions.

My question is: What properties are maintained through the projection? For example, if the original 3D data was bound by a radius of size r (say in the X and Y directions only), does this apply also to the 2D data? What happens to the range of the data? The distances? What can I infer about the new 2D data from knowing the characteristics of the 3D data?


texts: Build discrete IIR from a transfer function which is not in terms of $s$

texts:
Firstly I should state that my maths knowledge is limited.

I'm currently designing an acoustics modelling application which uses a rectilinear FDTD grid for modelling pressure variations - but I've become stuck upon trying to implement a fibrous layer boundary.  From Kowalcyzk 2008, the fibrous boundary model is defined as a frequency domain continuous impedance filter $\xi_w(\omega)$:

\begin{align*}
 \rho(\omega) = 1.2 + [-0.0364({{\rho f} \over {\sigma}})^{-2} - j0.01144({{\rho f } \over {\sigma}})^{-1}]^{{1} \over {2}}
\end{align*}

\begin{align*}
 K(\omega) = 101320{{j29.64 + [2.82({{\rho f} \over {\sigma}})^{-2} + j24.9({{\rho f } \over {\sigma}})^{-1}]^{{1} \over {2}}} \over {j21.17 + [2.82({{\rho f} \over {\sigma}})^{-2} + j24.9({{\rho f } \over {\sigma}})^{-1}]^{{1} \over {2}}}}
\end{align*}

\begin{align*}
 Z _w(\omega) = [\rho(\omega)K(\omega)]^{{1} \over {2}}
\end{align*}

\begin{align*}
 \Gamma(\omega) = j2\pi f[{{\rho(\omega)} \over {K(\omega)}}]^{{1} \over{2}}
\end{align*}

\begin{align*}
 \xi _w(\omega) = {{Z_w(\omega)} \over {\rho c}} \coth [\Gamma(\omega)d]
\end{align*}

Boundaries are implemented in the grid edge nodes as discrete time domain IIR filters of arbitrary order.  The few resources I've read on the subject have transfer functions that consist of a ratio of polynomials in terms of $s$ or $z$ - so I have no idea where to start on converting this filter, any clues?

I read this post, but I don't know if there's simpler solution for my circumstance.


texts: A 23 kHz sine wave sampled at 48 kHz, then FFT

texts:
A 23 kHz sine wave sampled at 48 kHz with 100 samples. Then do a 64 point FFT of the sampled signal. Why is the FFT of the signal not a delta function at 23 kHz. Or why does the  FFT also have values at other frequency?

I think it has something to do with 23kHz / 48 kHz * 64 samples not being an integer. I just couldn’t think the logic through. Please help me! Thank you!!

Edited: sorry guys, i meant 23 kHz


texts: Say there is a communication system, which can manage sampling frequency up to 4 MHz (given by software). Can the system be able to process signals with maximum frequency more than 2 MHz? Because according to sampling theorem sampling frequency > 2*maximum frequency.


texts: Transform a data set by exploting the vectorfield

texts:
I am somewhat new in the field of Digital Signal Processing / Image processing.
As shown in the figure, I have 4 straight lines $f_i(x)$ with $i = 1,\dots, 4$ that pass through $g(x)$.  Similiarly there are $4$ sample points $\mathbf{x}_i$ that lie on $g(x)$. The vectors $\mathbf{v}_i$ are the vectors obtained by joining the sample points $\mathbf{x}_i$ and the intersecting points between the lines $f_i(x)$ and $g(x)$.
The values of $\mathbf{x}_i$, $f_i(x)$ and $g(x)$ and hence the vectors $\mathbf{v}_i$ points are known.
If so, is it possible to find $g'(x)$ just by exploiting the information (direction and magnitude) contained in $\mathbf{v}_i$ such that the sum of the square of the magnitude of the vectors $\mathbf{v}_i$ is minimized?
My goal is to exploit the 1d-vectorfield and find a transformation matrix that maps $g(x)$ to $g'(x)$.
In the example above since $\mathbf{v}_1$ is pointing downward and $\mathbf{v}_4$ is pointing upwards (see $g(x)$), then intuitively, $g(x)$ must be translated about positive $x-$axis followed by some rotation. What is the best way to solve this problem?


texts: Decomposition of a signal to slow and fast components

texts:
I am currently recording biological responses which are triggered by different events. The figure below shows the original signal (black) and the occurrence of input events (colored dots). There is typically few seconds of a delay in  response to different events, and only some of the events generate a response. These phasic responses occur simultaneously with slowly changing fluctuations (tonic component), which are also biologically important (rather than measurement noise). So it is important to come up with a model that can decompose these signals with few constraints that are biologically plausible: signal = tonic + phasic.

In this system, phasic responses can be well modeled with typical linear system characterization methods based on impulse response function. Also note that, these phasic responses are always positive, that is biologically speaking there is no inhibition. For this reason, if there were no slow fluctuations in the recordings, the recorded signal would never go below zero, except for measurement noise.

What is more problematic is to account for baseline shifts (the tonic component). I would like to come up with a method that can be used to model the tonic component and phasic responses simultaneously based on the following assumptions:

1/ tonic component changes slowly.
2/ phasic component changes fast.
3/ phasic component is always positive, that is: signal - tonic should contain as negative values as possible.

The problem boils down to extracting slow and fast components of a signal. I have already 4 methods in mind, and I would like to see what you think is best suited or come up with an alternative.

The first thing that comes to mind is to low-pass filter the signal to obtain an estimation of the tonic component (see blue line). The main problem here is that the estimated tonic component violates the above-mentionned constraint #3. According to this assumption, no points in the recorded signal should be below the tonic component. Instead the tonic component should pass through all the data points where the phasic response is close to zero (schematically shown with the red curve in the figure below).

Another approach would be to make an assumption about the duration of phasic response. In doing so, one could use recorded samples that are at least as far as the duration of phasic response as keypoints and interpolate using cubic splines for the remaining data points. This is actually how I have drawn the red curve, but I feel like the interpolation of data points between the key points is problematic, because there are not many key points.

A third approach would be to work on first or second derivative space and characterize the system in this domain, as it is supposed to be less sensitive to low-variations.

A fourth approach consists of extracting slow components. One could use rely more on the history, when the signal is changing fast, and update the history with new data when the signal changes slowly. I am not sure though how to mathematically tackle this one.


texts: Is there a method to combine speech signals recorded by different microphones?

texts:
I have 3 speech files of the same speech recorded by 3 different microphones at the same time.

I'm only concerned to improve the speech quality (in terms of SNR and intelligibility) by combining the 3 speech files that I have.

Is there any method to solve the problem? What is the term used for it?

The techniques that I found involving multiple microphones was related to microphone array, but I'm interested to work with randomly placed microphones.


texts: Relationship between DFT input sequence and magnitude

texts:
Assuming there is a sequence that could look like this:

$$ x[n] = \{1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0,1, 1, 0, 0, 1, 1, 0, 0,1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0\} $$

Using this sequence, I want to perform a DFT manually, the connection between $x[n]$ and $|X[k]|$ is important to me.

Now there is only one problem: my sequence contains 32 values, so the DFT by hand would be very complicated. Is there a faster way to see the connection/relationship between the original signal (sequence) $x[n]$ and the magnitude $|X[k]|$.

One can recognize a period in the sequence, perhaps that could be exploited, the question being, how?

To make it short: Assuming I have a sequence (e.g. the above given), how can I infer the magnitude $|X[k]|$ from it?

I hope my question is understandable so far. Thanks for coming answers!


texts: what is difference between structure image and texture image

texts: I am working in Computer Vision. One thing is confusing me, the difference between structure image and texture image. Both are looking same. but i read few papers, which showing that both are different. Someone tell me how they are different, and how can we said either this is structural or textural, or either both.


texts: What factors determine synchronous signal transmission ability of a channel?

texts:
So I am Designing a system which would be able to send and receive stereo voice signals.( like a telephone but with full-band stereo voice signals)

here is an example to make my question clearer.
In a music recording studio two microphones are foreseen, one for singer's voice and the other for the guitar's sound. The combination of these two voice signals will result into a Stereo signal.At the same time there is a live conversation with another end which is supposed to receive music studio's signals as stereo and be also able to send back stereo signals.
If Bluetooth were to be used to transmit voice signals to CE Device( smartphone) and VoIP to transmit between two sides of conversation . I have done some studies but apparently Bluetooth has some limitations in case of synchronous transmissions.
what factors should be taken into account to choose a transmission method?


texts:
I want to use Prony's method to fit a signal given by the sum of $p$ complex exponentials

$x[n]=\displaystyle{\sum_{k=1}^p} A_k{\rm e}^{\,{\rm j}\theta_k} {\rm e}^{2\pi\, {\rm j} f_k (n-1)}$.

The problem is that Prony's standard formulation (Hildebrand, Introduction to Numerical Analysis, pp. 378-382) assumes that all the samples $x[n]$ with $n=1,\ldots,N$ are available, however in some applications $x[1]$ can't be measured. It seems that in this case Prony's method can't be applied. Am I missing something?


texts: Extend linear spline interpolation to cubic spline interpolation - how calculate derivative

texts:
I'm trying implement in Java cubic spline interpolation based on this document:
http://www.geos.ed.ac.uk/~yliu23/docs/lect_spline.pdf

At first they show how to do linear spline and it's pretty easy. I create functions that calculate A and B coefficients. Then they extend linear spline by adding second derivative. C and D coefficients is easy co calculate too.

But problems starts when I should calculate second derivative. I do not understand how they calculate them.

Can anyone explain that to me?


texts:
Often in estimation of the input signal to an unknown channel, the bit error rate is plotted as the performance measure. The curve is compared with an ideal curve labelled as 'Perfect channel'. For example in this paper, http://www.iaeng.org/publication/WCECS2015/WCECS2015_pp668-673.pdf
 although the bit error rate curve is not present, in the introduction the Authors do mention the term perfect channel. One such method of estimation is the Least Squares.

What is the meaning of a perfect channel? Does a perfect channel mean that there is no noise or does it mean that the pilot symbols are used to estimate the channel?


texts:
I have a real signal that is being sampled via ADC and passed to a Xilinx V6 FPGA.  I then do a Hilbert transform on it using the FIR compiler core and get the complex signal (I and Q) to tweak the signal some.  Now I am struggling with how to do the inverse Hilbert to get back to a real signal again.

I understand in theory that H(H(u)) = -u.  But the FIR compiler simply does not allow for a complex input and a real output.  Is there a trick to get around this?


texts: Wavelet Fidelity Filter (video compression)

texts:
I have read a specification of Dirac (video compression format). A key element of this format is the use of the discrete wavelet transform. Section 15.6.3 of the specification defines individual wavelets by making use of a lifting scheme. I am interested in the Fidelity filter for improved down-conversion and anti-aliasing. Where did it come from? Is there a paper that describes it?

For convenience, the lifting filters are defined as:

[ −2, 10, −25, 81, 81, −25, 10, −2 ]
[ −8, 21, −46, 161, 161, −46, 21, −8 ]


texts: What part of complex number of inverse discrete Fourier transform?

texts: Ok, so we have an image that is a Fourier inverse of the original picture. We want to get the original picture back. We use Matlab to get that job done. We import the image and then we invert it with the help of ifft(), this gives us a matrix with complex numbers. But to get the original picture we need to do some operation on the complex numbers to get it. But what is that operations. I tried the magnitude, real and imaginary part but this doesn't create the picture we want.


texts: Question About $ Q $ Matrix (Model Process Covariance) in Kalman Filter

texts:
I am implementing my own discrete Kalman filter to estimate velocity from acceleration and position measurements (using Matlab ).

I think I managed to deal with the $R$ matrix (measurements noise covariance matrix) in this way:

M = [x;x2dot];
R = cov(M);

What I am not sure about is the matrix $Q$.

In all the examples I found on the web and on this website also, the values inside that matrix are really really small. Moreover, I found here this statement:

  if you select an overly large Q, then it doesn’t seem like the Kalman
  filter would be well-behaved.

The fact is that, in my model, to obtain acceptable results I used values in the order of $1e6$ on the diagonal of the $Q$ matrix.

In this way I got the estimated displacement equal to the measured one and the estimated acceleration equal to the measured one. The velocity is in the right range of values but it still looks noisy.

So the question is: is there a limit for the values to be used in $Q$?

And also, are there guidelines to choose those values?

EDIT

Last question, does the $Q$ matrix have to be diagonal or it can be full also?


texts: Why do I see a frequency shift of the peak between the S11 and impedance response?

texts:
I have a resonator I am trying to characterize, and the S11-Plot gives me a slightly different center (resonant) frequency than that of the Z-Plot.
These measurements were taken simultaneously and using the same VNA. Yet the Z (magnitude and phase) are shifted to the left by something like 5% (Way more than VNA resolution).
Is there a physical reason, or a calibration error reason, or any other for this?


texts: Signal corrupted using peak (biquad) filter at low frequencies

texts:
I'm trying to process an audio stream through a series of peak filters at static frequencies that range from 0 to nyquist. If I start the range from anything below about 25Hz, the audio gets corrupted in some way (I haven't looked at the values yet, so I don't know what the corruption looks like) that results in no sound. But making the range ~25Hz to nyquist is fine. This happens even when all the filters are at zero gain.

Is anyone aware of theoretical problems with using a low frequency peak filter? Maybe it's a problem when its bandwidth might cross over 0Hz? (Do standard biquad equations address that possibility?)


texts: How should this fft output be intepreted?

texts:
I am currently reading some code, so I can understand how this FFT output is actually been stored.

I have a function which computes FFT of audio file, and stores is in the format.

[real0, realN/2-1, real1, im1, real2, im2, ...]

which kind of confuses me, as I remember DFT/FFT converts from time domain to frequency domain, in which the real part is the amplitude, and the complex part is the phase, but aren't I missing some information regarding what frequency has what amplitude and what phase?

Am I missing something?
Or am I right when i say that I can't from these complex numbers extract the amplitude for a certain frequency?

I am currently using Kaldi framework, in which i am trying to compute the spectogram of an audio file...

The output file it has generated looks like this.

This output was generated from a 1 second audio file.
sampled with 16 kHz, and frame length = 25 ms and hop_length = 10ms.
The number of datapoint the function has generated is 25816.
I am not sure how i should interpret it, i mean is each value supposed to be the power for a given frequency, and if so which frequency ?


texts: I can't figure out why spectral features are "displaced" on a spectrogram

texts:
I'm trying to create a spectrogram of a complex signal 'y', but I'm running into a problem where the spectrogram that I create appears to have its spectral features "displaced" in frequency space, and I think that it has something to do with not having pre-processed the signal correctly.

I know the signal's:
sampling rate (Fs = 400 KHz)
bits/sample (Nbits = 16)
frequency that the signal is centered on (Fc = 5.60 MHz)
total time that the signal elapses (dT ~ 145 sec).

I tried to use matlab's built-in spectrogram function with the following arguments:
[S, F, T] = spectrogram(y, num_pts_win, num_pts_overlap, num_pts_fft, Fs);
where:
num_pts_win = num_pts_fft = 2^14
and:
num_pts_overlap = 1/2 num_pts_win = 2^13

After subtracting Fs/2 from F to get a frequency axis from -Fs/2 -> Fs/2 rather than from 0->Fs, I plotted the spectrogram of the log(S) and obtained:

while I was expecting to get something like this:

I believe that this displacement of the spectral features has resulted from not accounting for the central/carrier frequency (Fc) anywhere, but as I'm sort of new at this, I don't really understand exactly how I should account for it.

Edit 1:

To clarify, I suspect that the spectral features I'm seeing in the first graph are actually aliases of the true spectral features, and I think this aliasing is happening because I haven't accounted for the central/carrier frequency.

Edit 2:
After FFTSHIFT'ing over the frequency dimension I think I've cleaned things up nicely!


texts: Promote the Orthogonality between Rows of $ S $

texts:
I have a question.

Suppose we want to solve an optimization problem:

Consider $S \in \mathbb{R}^{N \times T}, T >> S$

$$\min_{S} f(S) \mbox{ s.t. } SS^T \mbox{is diagonal}$$

Which means each rows of the matrix $S$ is mutually orthogonal.

I am suggested to solve this alternative problem by the following method:

$$\min_{S} f(S) + \|\mathcal{P}(SS^T)\|_1$$, in which $\mathcal{P}$ is a projection onto the off-diagonal indexes.

But I don't think this $\ell_1$ penalty will promote the orthogonality between each rows by simply promote the sparsity of the off diagonal elements, since we are not doing any actions like block coordinate descent to promote the orthogonality.

Any suggestions?


texts:
Suppose we're given the following:
$ x[n] = 2 + (-1)^n $, and are given the impulse response $ h[n] = u[n] a^n $, of an LTI system where $ |a| < 1$. We're asked to find the output $y[n]$, if $x[n]$ is input into $y[n]$.

My approach to this problem was to find the frequency response to $x[n]$ and the frequency response to $h[n]$, multiply the two, and then find the inverse fourier transform. However, this method was quite complicated, and I ended up not being able to solve it, since I essentially got back to a form where it was just $x[n]$ convolved with $h[n]$, which is difficult to compute by hand.

The answer key has a far simpler approach where $x[n]$ is written as $2 e^{j 0 n} + e^{ j \pi n}$, evaluates the frequency response $$ H = \frac{1}{1-a e^{-j \omega}} $$ at $\omega$; values of $0$ and $\pi$, multiplies and adds the result to yield:

$$ y[n] = \frac{2}{1-a} + \frac{1}{1-a} (-1)^n $$

Why can this be done? I'm not sure I follow why $y[n]$ can essentially by written as $H(\omega)$ evaluated at a value of $\omega  * x[n]$.

Can this always be done for LTI systems--even continuous systems?


texts: Detecting and removing interferences from a signal

texts:
I am using MATLAB in order to denoise and remove interferences on a signal.
I used wdenoise to denoise my signal which works by setting a threshold (for example SURE) for each scale and set all coefficients below this threshold to zero (these coefficients represents noise). It works pretty well.
I also wanted to detect interferences, which are in my case like spikes (most of the time with high amplitude compared to the useful signal), and remove them. I try to use wavelet decomposition (wavedec) to detect theses spikes and set a threshold to identify them for each scale. If a coefficient is greater than this threshold, I consider that this is an interference coefficient so I set it to zero. Let's consider a decomposition of 8 level. Because of downsampling, make a threshold on D{8} for example, give me a signal with only 10 coefficients so it's very complicated to see what coefficient is an interference coefficient.
With this technique, I don't have great results. Any idea to reconstruct a signal with spikes? Maybe other techniques ? Maybe used swt or modwt instead of wavedec ?


texts: Matlab : How to plot the constellation diagram for this method?

texts:
I am trying to generate symbols +1,-1 using a function by partitioning the interval of the function into two levels. The function is the Tent Map. This in a way achieves bpsk modulation.  I want to see the constellation diagram for bpsk . But I am getting error

Undefined variable "comm" or class "comm.RaisedCosineTransmitFilter".

Error in GenerateData (line 32)
txfilter = comm.RaisedCosineTransmitFilter('Shape','Normal', ...

So, I typed in >>

help comm.RaisedCosineTransmitFilter

and I believe that my Matlab does not have this class because this is the output of the help

comm.RaisedCosineTransmitFilter not found.

How can I view the constellation diagram?

This is the way I generate +1/-1 symbols for bpsk.

%generate bpsk
 N = 10000; %number of data points
x(1) = rand(1,1);
for i =2:N
x(i) = 2 * min(x(i-1), 1 - x(i-1)); %Tent map implementation
end
   modData = 2*(x>0.5)-1;  %generating symbols
  % modData holds the modulated symbols
  qpsk = comm.QPSKModulator;
  Rup = 16;
txfilter = comm.RaisedCosineTransmitFilter('Shape','Normal', ...
    'RolloffFactor',0.5, ...
    'FilterSpanInSymbols',10, ...
    'OutputSamplesPerSymbol',Rup);
  constDiagram = comm.ConstellationDiagram('SamplesPerSymbol',Rup, ...
    'SymbolsToDisplaySource','Property','SymbolsToDisplay',100);

txSig = txfilter( modData);
constDiagram(txSig)

Could somebody please show the correct way to obtain the constellation diagram. I am using Matlab2011b version on 64 bit i7 processor. Thank you.


texts:
I want to find the output signal(y) from input signal(x) and impulse response(h). To do that first I take the fft of both x and h, then multiply them, and finally taking the ifft of the result. The input signal is a 5 second sound. I tried to equalize the lengths of the FFTs but it didnt work. How can I overcome this?
[x,Fs]=audioread('hello.wav');

T=1/Fs;

L=220500;%length of the original sound

d=8820;%delay in terms of samples

a=0.8;%attenuation coefficient

h = [1 zeros(1,d-1) a];%impulse response h(n)

X=fft(x);

h1 =[h; zeros(length(x)-length(h),1)];

H=fft(h1);

Y=H.*X;

y=ifft(Y);


texts: Help for baseline drift removal/correction

texts:
I have signal as seen in the picture. It has high frequency noise and drifting baseline. I am able to remove the noise in MATLAB but I am not sure what can I do about the drift.

I would like the signal to have a stable baseline. Any help or hints on how I can do that would be most helpful.

Thanks


texts: How do I initialize the state of a digital filter in Direct Form II?

texts: Suppose I have a digital filter implemented in Direct Form II. How do I initialize the state of the filter as if the input $x[n]$ had a fixed value $x_0$ for all $n<0$?


texts: Fourier transform of exponent: Delta pulse or hyperbola?

texts:
Why do some tables say that Laplace (or Fourier?) inverse of exponential is a time-shifted delta pulse

\begin{align}
\delta (t) &\overset{\mathcal F}{\Longleftrightarrow} 1\\
\delta (t-t_0) &\overset{\mathcal F}{\Longleftrightarrow} e^{-j2\pi f t_0}\\
1 &\overset{\mathcal F}{\Longleftrightarrow} \delta (f)\\
e^{j2\pi f_0 t} &\overset{\mathcal F}{\Longleftrightarrow}\delta (f-f_0)
\end{align}

And table:
\begin{array}{c|c}
f(t)=\mathcal L^{-1}\left\{\mathcal F(s)\right\}&\mathcal F(s)=\mathcal L\left\{f(t)\right\}\\\hline
e^{at}&\displaystyle\frac{1}{s-a}
\end{array}

whereas others say that it is a (pole) hyperbola rather than a delta-pulse?

$$
e^{at}\overset{\mathcal F}{\Longleftrightarrow}\frac{1}{s-a}
$$


texts: Avoid Aliasing when filming a moving car

texts:
I want to film a moving car with a rolling circumference: 190,5 cm and wheel circumference: 60 cm and 5 spokes.

I record with 24Hz. What can be the maximal speed of the car to avoid aliasing?


texts: I have ordered a USRP kit to do radio signal processing in software. Is there a way to use the same device to process sonar data? What would I do upconvert the sonar to 50 MHz?


texts:
i'm trying to understand the fir1 filter but i still don't get it. For example here i got an audio signal that i consider noise, i'm passing it through a low pass filter.

n = 100000
fs = 11025
handles.noise = wavrecord(n, fs, 'double');
nfilt = fir1(11,0.4);
fnoise = filter(nfilt,1,handles.noise);

Why did i need to pass the noise signal to a low pass filter in the first place? and why is the number of coefficients 11? also the 0.4 shouldn't it be a range of values?

I know these are a lot of questions but when i get to understand them, ill be grateful to everyones help.


texts: Can we use SVD to solve single channel deconvolution problem?

texts: I have seen using singular value decomposition (SVD) to solve deconvolution problem for example truncated SVD (TSVD) . It appears there is also a connection between Tikhonov regularization and SVD. My question is: can we use this methods say TSVD for single channel deconvolution?


texts: How to evaluate CCDE at a given frequency?

texts:
Consider the following Constant Coefficient Difference Equation (CCDE) given below

$$y[n] - \frac{1}{2}y[n-1] = 2x[n] - 5x[n-1] - x[n-2]$$

Let $H(e^{j\omega})$ denote the transfer function of this system. What is $H(e^{j\pi})$?


texts:
I'm trying to write a python script to perform a 100-point DFT over a finite length sample of a sinewave at 1/8 the sampling frequency.  I'm curious why my DFT magnitude plot has two spikes in it when i plot it.

(I'm wondering if k=0 corresponds to $\omega=0$, k=100 corresponds to $\omega=2\pi$, and k=50 corresponds to $\omega=\pi$... and i'm just seeing an alias imagine above k=50.. or if i'm doing something wrong with DFT calculation..)

# Python 3.5 script
import sys
import numpy as np
import matplotlib.pyplot as plt

pi = np.pi

def stem_xy(x, y, title, filename):
    print("=> STEM_XY")
    fig = plt.figure()
    plt.title(title)
    plt.stem(x, y)
    print("creating file: ", filename)
    fig.savefig(filename)
    plt.close()

def plot_xy(x, y, title, filename):
    print("=> PLOT_XY")
    fig = plt.figure()
    plt.title(title)
    plt.plot(x,y)
    print("creating file: ", filename)
    fig.savefig(filename)
    plt.close()

def dsp_dft_magnitude(DIN, N, filename):
    print("=> DSP_DFT_MAGNITUDE")
    #N: Number of bins
    w_0 = 2*np.pi / N #Fundamental Frequency (Radians)
    X   = DIN
    XK  = np.zeros(N, dtype=np.complex)
    XM  = np.zeros(N)

    print("N  = ", N)
    print("W0 = ", w_0)

    for k in range(0,N):
        XK[k]=0
        for n in range(0,len(X)):
            XK[k] = XK[k] + X[n]*np.exp(-1j*k*w_0*n)
        XK[k] = (1/N)*XK[k]
        XM[k] = np.sqrt((XK[k].real)**2 + (XK[k].imag)**2)

    k = range(0,len(XM))
    plot_xy(k, XM, "DFT", filename)

    return XM

def run():
    print("=> RUN")

    sampleF   = 1E3
    sampleN   = 100
    Fsin      = sampleF/8

    sampleT   = 1 / sampleF
    t         = np.linspace(0.0, sampleN*sampleT, sampleN)
    y         = np.sin(2*pi*Fsin*t)

    stem_xy(t, y, "samples", "plot_test0.png")
    dsp_dft_magnitude(y, 100, "plot_test1.png")
    sys.exit()

run()


texts: How can I detect known frequencies using most efficient algorithm

texts:
I have a set of ultrasonic frequency that I am playing and I want to detect these particular set of known frequencies.

I have already used fft but it is quite processing intensive and I am facing problem when I implemented it in real-time. Then I used Goertzel algorithm with threshold values which worked fine in real-time when the fundamental frequencies where the known frequencies but once these frequencies were played alongside other frequencies (noise), which were sometimes more prominent than the ultrasonic ones, the ultrasonic ones expectedly did not cross the threshold and did not get detected.

Is there any other algorithm which I can try for my requirement given that I just want to detect known set of frequencies and is not that computation intensive like fft?


texts: Real world application of signal sparsity?

texts:
There are theories based on signal sparsity in frequency domain like  Compressive Sensing, Sparse FFT, etc. Throughout searching and studying papers I found out Cognitive Radio is a good example of application of Fourier sparse signals in real world. However, I am curious what are other applications in which the input signal is 1-D and is also sparse? or if there is any?
I feel there should be some important applications where the signal can be modeled as sum of a few sine functions, but I can't find any.

So, my question is in which applications the input signal  sparse in Fourier (only) and is 1-Dimensional?

I would appreciate a lot any suggestion.


texts: When a stochastic process would be a beneficial model in terms of noise

texts:
Let's say we have an image/signal with some noise in it. When would it be beneficial to model the signal as an outcome of a stochastic process?
More specifically:

How significant would noise have to be in for example an image for it to be beneficial to estimate the power spectrum density instead of taking the fourier transform directly?

And would it matter what kind of noise that was present in the image/signal, if it is additive or multiplicative? I don't think I'm seeing how a stochastic process could be a beneficial model for a signal yet.

I hope these weren't stupid questions. I'd be really grateful for any answers to them!


texts: Use of the harris-Moerder Nyquist Pulse Shaping Filter

texts:
I became aware today through fred harris' excellent presentation at the DSP Online Conference (https://www.dsponlineconference.com/) of the harris-Moerder pulse shaping filter which was published 15 years ago: http://eon.sdsu.edu/~seshagir/SDR05.pdf
This filter reportedly results in an order of magnitude lower EVM for the same number of taps, and importantly significantly reduced rejection of adjacent channels, but to my understanding isn't commonly used since the Root-Raised Cosine filter is so baked into our standards.
Is anyone aware of actual use of this alternate pulse shaping filter and does anyone have further experience with it? Are there any other reasons, now 15 years later, that this hasn't been more widely adopted?


texts:
I have an hardware related question.

I want to create a measurement set-up so that I can record data for DSP analysis. When searching around I see I have a few different options. The ones I have found are:

Data acquisition box / interface
Logic analyzer
Scope
Soundcard (have specific input type (XLR/ TRS-Jack) )

From DSP perspective what are the differences between these types of measuring devices? Specially the difference between a DAQ and a logic analyser?

As Questioned in the comments: what are the parameters i want to measure. Here is the list for now(witch can change later on):

Torque
Acceleration(vibration)
(velocity)
Force
if possible Ammeter
different switches for safety sensors(just low and high over time)
some pulse generators

I'm not sure what the bandwidth is of every signal. But i assume that the maximum bandwidth is from the acceleration sensors. I assume that the bandwidth is f_max = 10kHz so f_sampling = 25 or 30 kHz.


texts: NDA timing estimation for mutli-level QAM(RC pulse)

texts:
What non-data0aided techniques are used to estimate the timing for multi-level QAM? For single level QAM(so 4 QAM) you can use variance minimization or power maximization but I'm not sure these techniques carry over to multi-level transmission models. For example the variance minimization technique would need substantial modifications to handle the different power levels(even more so when you consider lack of phase synchronization).

How is this addressed?


texts: How to improve the FIR filter performance degradation when the amplitude of the input signal decreases?

texts:
I'm tring to design a filter to restore the original signal from strong noise (low SNR). I have tried low pass FIR and it could work well as the amplitude of orignial signal is much higher than the background noise. My matlab code of a demo are as follows:
clear
clc
close all

time = 1:10000;
fre1 = 50;
fs = 8000;
amplitude = 100;      % amplitude of the noise

sin_signal1 = sin(2*pi*fre1*time/fs)*50;
noise = rand(1,length(sin_signal1));
noise = amplitude * sqrt(10^(-3/10))*noise;  %noise

sin_signal = sin_signal1+ noise;
figure()
plot(sin_signal);

fir_low = fir1(128,55/8000);
sin_after_filter = filter(fir_low,1,sin_signal);
figure()
plot(sin_after_filter)

When the amplitude of noise is low (eg. amplitude = 0.5), namely a high SNR, the low pass FIR works very well. But when the amplitude of noise is high (eg. amplitude = 150), namely a low SNR, the low pass FIR works very bad.
For a well-designed filter, only changing the amplitude of noise, but not the frequency, why will the performance of the filter degrade? Can't even filter the signal? How to improve the problem? Thanks!


texts: Sample-rate, filtering, digital-filtering and aliasing

texts:
I am strugling with a question that I hope someone can help me with.

I am recording single molecule events which I detect is picoampere square deflections.

I wish to use as gentle low-pass bessel filtering as possible.

The lowest filter settings my amplifier allow are 10 kHz and 100 kHz, and my digitizer have a maximal sampling rate of 500 kHz. I am afraid of corrupting my signal to much, but do not have the intuitive understanding of sampling and filtering to know if I am doing something wrong. Here is what I do:

I filter the signal with a 100 kHz bessel filter and digitize it with a 500 kHz sampling rate.
I then wish to filter my digitized data with a 35 kHz digital filter.

Would this mess up my data?
I hear people say that I am on safe ground if i sample at appropximatly 10x my filter settings, but I get to this 'safe zone' only when I do the post-sampling digital filtering. So I guess what I realy do not understand is if the order of filtering, sampling, filtering does something nasty to the data.

I hope I was able to communicate my question clear enough.

Thank you very much,
Best regards,
Michael


texts:
1- If I have a sine wave with period of $T$, I need to sample at least every $T/2$ to be able to reconstruct the sine wave. Let's look at this:

This way I'd get a series of $0$s and all information seems to be lost. Where am I wrong?
$x(t)=\sin(2\pi ft)$

Let $f_s=2f$; then

$$x[n]=\sin(2n\pi f/2f) = \sin(n\pi)=0.$$

2- Assume I have sine wave of frequency say $100\text{ Hz}$ , and I sample it at $101\text{ Hz}$, this would cause aliasing as we know. My question is, what happens in the frequency domain?


texts:
I need a mathematical description of what happens to the spectrum of a signal when that signal is processed to divide its frequency.

As an example, construct an input signal as the sum of two sine waves of different frequencies (as commonly used in a "two tone" test). Processing this signal with a buffer that changes state at the rising zero crossings of the input signal produces a squared wave whose frequency can be divided by a flip-flop:

The spectrum of the the input signal comprises tones at 102kHz and 105kHz:

"Squaring" the input preserves the two equal tones, albeit with added side tones (spaced at the difference between the two original tones) that result from removal of the amplitude envelope and added harmonics from the squaring:

Passing the squared signal through a flip-flop produces a second square wave which in which the two-tone nature is no longer present:

The single dominant tone is at 1/2 the frequency of the higher of the original two tones, while the spacing between the peaks continues to be the spacing between the two original tones.

Passing the squared result through an LC low-pass filter produces a sine wave with cycles that are half as frequent as the input:

with the same general spectral distribution as the squared output:

Can someone, please, explain what happened to the other tone?


texts: Expectation of power spectrum for nonorthogonal wavelets

texts:
I'm working through "A Practical Guide to Wavelet Analysis" by Torrence and Compo, and I am confused about section 3d ("Wavelet Power Spectrum").

Let $x_n$ denote the signal, sampled at increments $\delta t$; $\hat{x}_k$ its Fourier transform; $\psi$ the (normalized) mother wavelet, so that the amplitude of the wavelet transform at scale $s$ centered at $n\delta t$ is given by
$$
W_n(s) = \sum_k \hat{x}_k \hat{\psi}^*(s \omega_k)e^{i\omega_k n\delta t}
$$
There's some fiddling with constants here, but I understand this so far.

Then, they write that, for a white noise signal, $\mathbb{E}|W_n(s)|^2 = N \mathbb{E}|\hat{x}_k|^2 = \sigma^2$. Trying to work through this:
\begin{align}
\mathbb{E}|W_n(s)|^2 &= \mathbb{E}\left|\sum \hat{x}_k \hat{\psi}^*(s \omega_k)e^{i\omega_k n\delta t}\right|^2
\end{align}
I see that if the wavelets are orthogonal, this works out nicely, where you can write
$$
\mathbb{E}\left|\sum \hat{x}_k \hat{\psi}^*(s \omega_k)e^{i\omega_k n\delta t}\right|^2 = \sum |\hat{\psi}(s \omega_k)|^2\mathbb{E}|\hat{x}_k|^2
= \frac{\sigma^2}{N}\sum |\hat{\psi}(s \omega_k)|^2
$$
However, the authors clearly state they are not working with orthogonal wavelets specifically here, so I am unsure how they get their white noise result.


texts:
I have an application in which I have to process images taken through a mirror. The camera and mirror positions are fixed, and the object is always in the same position with respect to the mirror. The problem is that I get a ghosting effect because the image is also reflected by the transparent surface of the mirror.

I will try to get a first surface mirror for my application, but I wonder if this ghosting effect can be corrected by software. Any hint would be appreciated (a paper, algorithm, anything). I believe this should be possible, since the camera and mirror are both fixed, and the object is always at the same distance from the mirror, but I don't know where to start looking.

Thank you for any hint/advice you can provide.


texts: Calculation frequency response of digital filter with known structure

texts:
Short question
 What are main stages (steps) of calculation frequency response of digital filter by their structure?

Detailed question
Let suppose that there is discrete FIR filter with known structure which is implemented in programming language  (for instance with structure which shown in picture):

              +-----+   +-----+
              |     |   |     |
x (k) >---+---|  T  |---|  T  |
          |   |     |   |     |
          |   +-----+   +-----+
          |      |         |
          |   +-----+      |
          |   |     |      |
          |   | x 2 |      |
          |   |     |      |
          |   +-----+      |
          |      |         |
          |   +----------------+   +-----+
          |   |       ___      |   |   1 |
          \---|       \        |---| x - |---> y (k)
              |       /__      |   |   4 |
              +----------------+   +-----+

It is possible to pass into the filter input signal (as vector of integers which describe magnitude), like this:

in [0, 0, 0, 0, 4, 0, 0, 0, 0, 0]

Which describe signal with following magnitude:

             |
x (k)        |
             |
   . . . . . | . . . .

k  9 8 7 6 5 4 3 2 1 0

And get corresponding output signal, like this:

out [0, 0, 0, 0, 1, 2, 1, 0, 0, 0]

Which describe signal with following magnitude:

y (k)
           |
   . . . | | | . . . .
k  9 8 7 6 5 4 3 2 1 0

Question is how to calculate frequency response of the filter (by stages)?

Notes
With known input and output signals we can calculate transfer function of the filter by their images of Laplace transform (z-transform for discrete signals):
1. $$X(z) = \mathcal{L} \{x(k)\}$$
2. $$Y(z) = \mathcal{L} \{y(k)\}$$
3. $$H(z) = Y(z) / X(z)$$
And after if we get Fourier transform from transfer function we will get AFC:
4. $$FR = \mathcal{F} \{H(z)\}$$
Is it correct?


texts: How to transform flat-field corrected spectra to those under Standard illuminant E (ideal equal energy illuminant)

texts:
My ultimate goal is to convert a flat-field corrected hyperspectral image of reflectance (360nm-780nm) to corresponding CIEXYZ image and thus device-independent color image.

By flat-field correction, I meant

$$I_{corrected} = {{I_{raw}-I_{black}}\over{I_{99\%white}-I_{black}}}$$

Even after the flat-field correction, it was found that the spectra still did not match published values (of a color target) under standard illuminant E. Currently, we scale and shift the intensity values for each wavelength based on published spectra to match values between measured and published CIEXYZ. Resulting average Delta E (CIEDE2000) is about 1.00.

But I wonder if there is any better way.


texts: Applying BCJR equalization for LDPC encoded information

texts:
I want to apply BCJR decoder for LDPC encoded information.
How can I change the BCJR originally for convolutional codes for this purpose?


texts: Homework Help: What does $h[0] = 1$ represent? What is $\ln \big| H(e^{j \omega})\big|$?

texts:
I have been staring at this problem for a week now...
Suppose $H(e^{j \omega})$  is the frequency response of a stable and causal minimum-phase discrete-time system with $h[0]=1$  ($h[n]$ is the impulse response of the system). Show that:

$$ \int\limits_{-\pi}^{\pi} \ln \big| H(e^{j \omega})\big|^2 \, \mathrm{d}\omega = 0 $$

So:

Minimum phase means poles and zeros are inside the unit circle
Stable and causal is redundant since the system is minimum phase
What is conceptually meant by $h[0] = 1$?
What is the significance of $\ln$(magnitude of freq response)?


texts: Problem related to phase spectrum of DSB-SC signal

texts:
I have tried to solve this question (4.2.3). I got the magnitude spectrum right but the phase spectrum wrong. I am getting the phase spectrum at $ \frac{\pi}{4} $ and $ - \frac{\pi}{4} $. However, in the solution manual, they have plotted it at  $ \frac{\pi}{2} $ and $ - \frac{\pi}{2} $.

The phase is visibly at $\frac{\pi}{4} $ and $ - \frac{\pi}{4} $ from the coefficients $ e^{- \frac{j\pi}{4} }$ and $
e^{ \frac{j\pi}{4} } $ in the two terms.

I am not able to understand why am I wrong and why are they right!


texts:
In the paper The Laplacian Pyramid as a Compact Image Code,

it says The pyramid algorithm reduces the filter band limit by an octave from level to level.
How is the conclusion drawn? Is this related to weighting function and downsampling width and height by 2? How does weighting function and downsampling operation affect the filter band limit?

Edit:
From one document, it shows the frequency response of binomial filters


texts: Equation that describes a gravity drained tank system

texts:
I have a system like this:

The upper tank has an input ($q_i$) and an output, that is the input for the lower tank ($q_{12}$). The lower tank has an output ($q_o$).

Does anyone know how to get the equation that describes that system? I know that I will have two poles.


texts: How do can we cancel out noises while listening voice on headphones?

texts:
It's a common problem that while talking with the another person on Smart phones with the help of regular headphones,we get very annoying sounds at background . The opposite person's voice gets mixed with full of such noise signals to such an extent that sometimes it becomes literally impossible to continue the conversation.

Which kind of noises could be possible in such situation?

Also,how do can we convert a regular (ordinary) headphone into a headphone which has ability cancel out or isolate these noise signals to a maximum extent while listening voice on headphones and make conversation noise free?

Note:please consider any practical situation of your choice like opposite person(person on other) side is in silence zone area and you are walking on the road or travelling by the car or you are also in the silence zone.


texts: minimum sampling rate for very short duration signals

texts:
I understand that sampling rate should be twice the signal bandwidth for successful reconstruction. But what I don't get is how this translates in the time domain.

For example, I have a sine wave pulse with frequency 100MHz and duration of say 50ns. This signal has a bandwidth of 20MHz (1/50ns = 20MHz). Theoretically, I can sample this signal at any frequency above 40Mhz. Let's say I sample at 50MHz, then I only get 2 samples per pulse!! Now what can you possibly do with those 2 samples is my question. In other words, although Nyquist criterion is satisfied in this example, there's not enough data points to proceed.

This kind of signals are common in radar and generally you want to run some sort of matched filtering/correlation once you have digitized the pulse. But you can't run any descent signal processing on just two samples? am I missing something here?


texts: Web Online tools for feature detection methods in image processing

texts:
I'm doing a research about image processing, I would like to access common feature detection methods online, ex:

Blob detection: Laplacian of Gaussian (LoG), Difference of Gaussians (DoG), Determinant of Hessian (DoH), Hough transform.
Edge detection: Canny, Deriche, Differential, Sobel, Prewitt, Roberts cross.
Corner detection: Harris operator, Shi and Tomasi, Level curve curvature, SUSAN, FAST.
Feature description: SIFT, SURF, GLOH, HOG.

Is there any online tools on the web which provide some of them ?


texts: Intro Question to Signal Processing (Low-Pass Filter)

texts:
I have a noisy signal file in Matlab and I have to denoise the polluted signal using a discrete Fourier transform.

I'm asked to perform the fourier transform, then take its absolute value. Then study/examine the absolute values to then implement a low-pass filter for the actual sound (and corresponding high-pass filter for the background noise) in Matlab.

Any ideas on general approaches? This is an intro course so suggestions shouldn't be too formal. Also this is homework so only hints please.


texts: Rectangular 8 QAM bit error rate calculation

texts:
I am simulating an 8-QAM communication system over an AWGN channel for various signal to noise ratios, in order to plot the average bit error. However I have not been able to derive an equation for the QAM system in terms of the Q-function.

The 8-QAM system is rectangular with 2 possible values for the x basis vector and 4 possible values for the y basis vector such that the constellation consists of 8 symbols:

(-d/2,3d/2), (d/2,3d/2)
(-d/2,d/2), (d/2,d/2)
(-d/2,-d/2), (d/2,-d/2)
(-d/2,-3d/2), (d/2,-3d/2)

where d is the distance between symbols.

The symbols are coded using grey coding for the x and y component as follows:

(0,10), (1,10)
(0,11), (1,11)
(0,01), (1,01)
(0,00), (1,00)

My attempt to derive an expression for bit error rate was based on the symmetry of the constellation as it consists of only two unique error scenarios, since the received vectors are:

r1 = s1 + n1, r2 = s2 + n2

The probability of error in each scenario is
$$
P(bit error scenario 1) = P(r1<0|s1) + P(r2>d|s1) + P(r2<0|s1)
= 3Q(d/2\sigma)
$$
$$
P(bit error scenario 2) = P(r1<0|s1) + P(r2<d|s1)
= 2Q(d/2\sigma)
$$
Average probability of bit error is then:

$P(bit error) = (5/2)Q(d/2\sigma)$

Assuming the transmit signals are equi-probable. and:

$d = \sqrt(2E_s/3), $
$\sigma =\sqrt(N_0/2)$

however there is significant disparity between this theoretical error rate and the simulated error rate. I would appreciate it if someone could point me in the right direction, thanks.


texts: How to implement the $\tt conv(x,h)$ in MATLAB without using loop?

texts:
I'm trying to calculate convolution of two given vectors in MATLAB without using loop, and of course without the function conv itself, but I can't remove the last loop I've used in the code below. Any hint would be appreciated.

function [ convolve ] = myconv( x,y)
%This function calculate the convolution of the two inputs
lx=length(x);
ly=length(y);
lt=lx+ly;
x=[x zeros(1,ly)];
y=[y zeros(1,lx)];
convolve=zeros;
for n=2:lt
    convolve(n-1)=sum(x(1:n-1).*fliplr(y(1:n-1)));
end


texts: Useful natural "Hilbert-like" $n$-uples and $n$-fold "analytic signals

texts:
If $\mathcal{H}$ denotes the Hilbert transform, the  analytic signal of a signal $x(t)$ is $$x_a(t) = x(t) +\imath \mathcal{H}(x(t))\,.$$ The real and imaginary parts form Hilbert pairs.

Are there natural (and possibly useful) extensions, with another transform $\mathcal{T}$, which possesses involution, anti-involution or even semi-involution properties, see eg Is there a name for a function whose square is an involution?

A shape can be (for instance):
 $$x_b(t) = x(t) +\jmath \mathcal{T}(x(t)) +\jmath^2 \mathcal{T}^2(x(t))$$
of "Hilbert-like" triples? And $n$-uples?
Or, if any, related to higher order algebras (quaternions, octonions). What properties can they reveal (generalized instantaneous phase, envelopes?)

I am mainly   interested in constructions that, as least in some types of signals, in at least one application, have proven more efficient that state of the art.


texts: Confused about DFT symmetric behavior for real-valued signals?

texts:
I have a simple and might be a preliminary question about symmetric property of DFT of real valued signals. From definition we know, DFT coefficients of a real-valued signal is conjugate symmetric, so $X_{N-k}=X_{k}^*$ . However, I cant see this in calculated DFT, for example consider the below:

N=1000;
fs=10^6;
t=(0:N-1)./fs;
x=2*sin(2*pi*t*10000);
plot(x);
figure;
stem((abs((fft(x)))));

The non-zero bins are 11 and 991, where I expected them to be 11 and 989, even considering that indexes starts at 1 in MATLAB,and subtracting bin numbers by 1,  the non-zero bins must be 10th and 990th bins.

Would any one please point out, where is my misunderstanding?


texts:
I'm working on a speech recognition project. The first step of this project is to find phoneme in the speech signal. To do that, I found this paper that discusses about it.

In the paper, wavelets are used to visualise the signal in different frequency band. Here is my problem :

So far, I know how to decompose the speech signal using wavelet transform at different level (wavedec in MATLAB) But I don't know how to filter this signal.

With Fourier transform, a simple threshold on the FFT (focus on specific frequency band) will do the work. And as far as I understood, wavelet kinda work like Fourier so I guess it's working the same way.


texts: What are the ranges of values for each audio feature/descriptor?

texts:
I need to normalize some audio feature measurements I've done with the software Wolfram Mathematica.

Coming from a non signal processing background, I have some difficulties understanding what several audio features are actually measuring and thus the range of values in which each measurement is expressed.

I can't seem to find any documentation regarding the "physical" range of these descriptors, both in the Wolfram software and the MPEG-7 standard.

This is the list of features analyzed, using the names given to them by Mathematica:

{"Max", "MaxAbs", "Min", "MinAbs", "MinMax", "MinMaxAbs", "Mean",
"Median", "StandardDeviation", "Total", "Power", "RMSAmplitude",
"Loudness", "CrestFactor", "Entropy", "LPC",
"PeakToAveragePowerRatio", "TemporalCentroid", "ZeroCrossingRate",
"ZeroCrossings", "FundamentalFrequency", "Formants",
"HighFrequencyContent", "MFCC", "SpectralCentroid", "SpectralCrest",
"SpectralFlatness", "SpectralKurtosis", "SpectralRollOff",
"SpectralSkewness", "SpectralSlope", "SpectralSpread",
"ComplexDomainDistance", "ModifiedKullbackLeibler", "Novelty",
"PhaseDeviation", "SpectralFlux"}

I can suppose some of the ranges, e.g. the one of Spectral Centroid, are similar to the range of the audible spectrum, but I have no clue about the more exotic ones.

Is there any trusted source I can rely on?


texts: How to choose between taking the real part or the absolute value of an inverse discrete Fourier transform?

texts:
I kind of expected this to of been asked before, so if this is duplicate please point me in the right direction, however I couldn't find anything.

I am currently experimenting with low pass filtering. I take an image and apply a 2-dimensional fast Fourier transform to the image, next I apply a shift such that the zero frequency component is moved to the center (Using Matlab this is fftshift). Then I zero Fourier co-efficients which are not within some distance $r$ of the center pixel. I apply the inverse of the shift and then an inverse 2-dimensional fast Fourier transform.

Now I end up with a matrix of complex values, but to display an image I want a matrix of real values. With the matrix obtained after applying the IDFT I mapped the pixel values to their real part, imaginary part, magnitude and phase so that I could view the matrix as an image. I found that the real part and the magnitude looked like the original image and taking the imaginary part and phase rendered the image unrecognizeable compared to the original image. I also found that their wasn't a recognizable difference in quality between taking the real value of the transformed image or the absolute value.

My question is, is there advantages or disadvantages between taking the real part of absolute value after filtering (low pass, or in general)?

This is my first question on DSP.SE, so please leave comments on how to improve my question if it's not up to standard


texts:
I was wondering what is the practical difference between Lagrange Interpolation using Farrow Structure and Sinc Interpolation? Both require pre-computation of time offset coefficients using a lookup table.

Is the length of filter required for a certain degree of accuracy less for one over the other? How do they compare?


texts: Is there a difference in bicubic interpolation of images vs patches?

texts:
I need to extract low resolution patches from an image. For example, 32x32 patches from a 500x500 image.

Method One

Down res 500x500 image (by bicubic interpolation, both down res and up res).
Extract 32x32 patches.

Method Two

Extract 32x32 patches.
Down res (by bicubic interpolation, both down res and up res) 32x32 patches.

Will the patches extracted be identical? If they aren't, how different will they be?


texts: What is the distinction between ergodic and stationary?

texts:
I have trouble distinguishing between these two concepts. This is my understanding so far.

A stationary process is a stochastic process whose statistical properties do not change with time. For a strict-sense stationary process, this means that its joint probability distribution is constant; for a wide-sense stationary process, this means that its 1st and 2nd moments are constant.

An ergodic process is one where its statistical properties, like variance, can be deduced from a sufficiently long sample. E.g., the sample mean converges to the true mean of the signal, if you average long enough.

Now, it seems to me that a signal would have to be stationary, in order to be ergodic.

And what kinds of signals could be stationary, but not ergodic?
If a signal has the same variance for all time, for example, how could the time-averaged variance not converge to the true value?
So, what is the real distinction between these two concepts?
Can you give me an example of a process that is stationary without being ergodic, or ergodic without being stationary?


texts: The Sinc Function and the Partition of Unity Property

texts:
For this question purposes a function, $ f \left( t \right) $ is said to hold the Partition of Unity if:

$$ \forall t, \ \sum_{n \in \mathbb{Z}} f \left ( t - n \right ) = 1 $$

Using the Poisson Summation Formula the Partition of Unity is equivalent of $ F \left( 2 \pi k \right ) = \delta \left ( k \right ) $ where $ F \left ( \omega \right ) $ is the Fourier Transform of $ f \left ( t \right ) $.

Looking at
$$ \frac{ \operatorname{sinc}^{p} \left ( pt \right ) }{\int_{-\infty}^{\infty} \operatorname{sinc}^{p} \left ( pt \right ) } $$
Does it holds the Partition of Unity for $ p \geq 2 $?

At first I thought it does, since the Fourier Transform equivalent property will hold.
Yet it seems I'm missing something.
Any ideas?

Thank You.


texts: Spectrum of OFDM with raised cosine window(overlap and add)

texts:
I'm having trouble observing OFDM with a raised cosine (RC) window in Matlab.

I know how to generate an OFDM signal with a raised cosine (RC) window, I just don't understand when the last W samples of an OFDM symbol are added to the first W samples of the successive symbol, its spectrum changes compared with no overlap(the OOB is nearly same with no windowing).

I don't know if something wrong with my matlab code about how to see overlapped windowing-OFDM, or overlap would influence per symbol's spectrum?


texts: Determine stability of feedback system from open loop transfer function and Nyquist stability criterion gives different results

texts:
I'm confused due to the fact that the Nyquist stability criterion and looking at the transfer function doesn't give the same results whether a feedback system is stable or not. When I have the system of this block diagram the closed loop transfer function is:
$$
T_{CL}(s) = \frac{G}{1+GH}
$$
Due to the Nyquist stability criterion this closed loop transfer function will be marginally stable when GH = -1 + 0j and unstable when $GH = < -1 + 0j$ (if the open loop transfer function is stable, in this case there aren't any poles in the right half plane thus the nyquist plot should not encircle the point -1, so this plot should stay right from this -1 point).
However when I look at the closed loop transfer function, I would say that this system is unstable for $GH = -1$. In this case the transfer function becomes infinity so a bounded input will result in a unboundend (=infinity) output.
In my train of thought the point $GH = -2$ would again be stable since $T_{CL}$ will be finite again, however conform the Nyquist stability criterion this point wil still be unstable?
I know that Nyquist is correct but what's the problem with my way of thinking


texts: Application of Parsevals theorem with Welch method

texts:
For my project I had to manually code the welch method using the code below. Pretty much it involves finding the spectral density through fft and incorporating windowing and segmenting with overlap.

I need to know if my PSD is correct so I am checking through 2 methods.

root of area under the PSD should be the RMS (E[x^2]) and since I have taken away my mean from the data, this should equal the standard deviation of the data
Checking if Parseval's theorem holds.
There are two main issues, I am having trouble with. Firstly I am getting a 0Hz peak even after removing the mean at the start. The only way I can remove the 0Hz peak is to take the mean away after I have segmented and multiplied the window. (#### Detrend line ####)

With the peak, point 1 holds up well but without the peak the standard deviation is slightly different from the RMS but thats not a huge concern.

My second issue is that I cant get the Parseval's theorem to hold. Is there something I'm doing wrong? Is it necessary for the Parseval's theory to hold? Please let me know if my theory is wrong.

Couple of notes about the code:

apologies if it isnt efficient coding, I'm still a novice
dividing the fft by (fs*(win*win).sum()) is something I found through research and also a part of the inbuilt Welch code
lastly I am using trapezoidal rule for integration
my FFT energy is a couple of magnitudes smaller (ie E-09)

With 0Hz peak removed

With 0Hz peak

import numpy as np
import matplotlib.pyplot as plt
import os
import math
from scipy.fftpack import fft, ifft, fftfreq, rfft
from scipy.signal import detrend, get_window

plt.clf()
plt.close()

###############################################################################

config = '1perc_damping'

dir0 = os.getcwd()
dir1 = dir0+'/'+config
dir2 = dir1+'/Summary files'

data = np.loadtxt(dir1 + '/000deg_500rpm_An_Mxx.dat')

###############################################################################

fs = 625
nperseg = 1024
noverlap = 512
window_meth = 'hanning'

###############################################################################

#detrend
data = data - np.mean(data)

#get windowing method
win = get_window(window_meth, nperseg)

# number of segments
nseg = np.ceil((len(data)-nperseg)/(nperseg-noverlap)) + 1

total_n = nperseg + (nseg-1)*(nperseg-noverlap)

# padding with zeros
if total_n > len(data):
    n = total_n - len(data)
    padding = np.zeros(np.int(n))
    data = np.concatenate((data,padding))

# fft

fft_data = 0

for i in range(0,np.int(nseg)):

    start = i*(nperseg-noverlap)

    f_data = np.multiply(data[start:start+nperseg],win)
    f_data = f_data- np.mean(f_data)   #### Detrend line ###

    transf = fft(f_data)
    transf_c = (transf*np.conj(transf))/(fs*(win*win).sum())

    fft_data = fft_data + transf_c

Pxx = np.real(fft_data)/(nseg)
fx = fftfreq(nperseg, 1/fs)

plt.figure(1)
plt.plot(fx[0:512],2*Pxx[0:512])
#plt.plot(fx,Pxx)

plt.figure(2)
x = np.linspace(0,len(data),len(data))
plt.plot(x,data)

#Finding RMS
l = np.int(len(fx)/2 -1)
c = 2
A = 0

for i in range(1,l+1):
    A = A + 0.5*(c*Pxx[i]+c*Pxx[i-1])*(fx[i]-fx[i-1])

RMS = np.sqrt(A)

# Checking Parseval's theorem
data_energy = 0
FFT_energy = 0

for i in range(1,l+1):
    FFT_energy = FFT_energy + 0.5*(np.power(c*Pxx[i],2)+np.power(c*Pxx[i-1],2))*(fx[i]-fx[i-1])

for i in range(1,len(data)):
    data_energy = data_energy + 0.5*(np.power(abs(data[][1][i]),2)+np.power(abs(data[i-1]),2))*(i-(i-1))*(1/625)


texts: non linear equalizer vs linear equalizer

texts: i understand that there are linear equalizers such as MMSE and ZF, however there are also non-linear equalizers such as MLD. i would like to know what is the difference between a non-linear equalizer and linear equalizer, and how one can be distinguished from the other?


texts:
I have been studying about CRAN and the CPRI links (fronhaul links) and have observed that CPRI links are always either fiber cable or some electrical interface. Why is this needed? Is it related to the latency, bandwidth and cost requirement of the CPRI standard?
Thanks


texts: How to do convolution in Fourier Series?

texts:
Two signals are given to me :

$$x(t)=\cos(4\pi t)$$
$$y(t)=\sin(4\pi t)$$

I have founded their coefficients as follows:

$$a_k = a_1=a_{-1}=\frac{1}{2}           $$

$$b_k = b_1=b^*_{-1}=\frac{1}{2j}           $$

Now I am stuck at convolution. In the formula of the convolution:

$$\sum_{l=-\infty}^{\infty}a_lb_{k-l} $$

What are these $l$ and $k$ and from the coefficients I found what is their respective value?


texts:
Let $s(t)$ an up-chirp with bandwidth $B$ and $y(t)$ an down-chirp with the same bandwidth.
For a multi user chirp spread spectrum (2 users), I use the up-chirp and down-chirp as spreading signal. The system bandwidth is $B_c$ with $B_c=B$.

But if I look at the spectrums for the 2 users, there is no superposition. Consequently, can we transmit these signals because we must have a system bandwidth $B_c$?


texts: Algo Name: Detecting Elongated Shape in 2D Image by Convolution with Directed Lines

texts:
I am detecting a shape with roughly known orientation (obtained by using Hough line transform) in thresholded binary image by convolving the image with line with that orientation, and counting the ratio of pixels which match; this line is swept across the image, and lines which have hit ratio higher than some threshold (like 0.9) are considered belonging to the object completely.

The motivation is not only to remove holes but also discontinuities across the object; how a hole is removed is shown in the image, where grey line parts are not-matching and red are matching; blue lines are from Hough transform:

This routine was found by intuition and I wonder whether there is some name for it, or perhaps a more sophisticated algorithm based on similar idea. In that case I could use an optimized implementation instead of the hand-written code (I am using python, OpenCV and scikit-image).


texts:
It's been a long time since I scratch built an FFT algorithm, and I feel like I should already know this, but I just can't recall and figured I might get a quick answer on here that may be useful to others.  FWIW, I did see one question that was already answered that was very related, but I am hoping for clarification.
Looking at Decimation in Time algorithms, bit reversal is typically shown applied to the input.  For Decimation in Frequency, it is typically shown applied to the output.  My questions are:

What happens if no bit reversal is performed?
If the natural order is important, does it matter if the bit reversal is performed at the beginning or the end?
Are the DIT and DIF algorithms mathematically equivalent?

I am implementing a FFT based convolution.  It would seem that the bit reversal is not needed and I was hoping to figure out why.  I found the figures/analysis here helpful for reference.


texts: What data should I use to test an FFT implementation, and what accuracy should I expect?

texts:
I'm involved with an effort to implement an FFT algorithm, and am curious what the recommended advice is for the input test data to use -- and why! -- and what accuracy to expect.

On test inputs, I've found a little guidance in old Usenet posts that I'll post as an answer, but it's just one person's suggestions without a lot of justification -- I haven't found anything that looks like a solid answer.

On accuracy, Wikipedia says that the error should be O(e log N), but what's a reasonable expectation in absolute terms?

Edit to add: The actual tests are in a form where I have stored arrays of input data and pre-computed "reference" output data to compare to, so I don't necessarily need something with a closed-form solution.


texts: Data decomposition method invariant to small shift and scale?

texts:
Is there a data decomposition method similar to eigenvalue that estimates projection matrix to reduce dimensionality but does not project similar vectors too far away in euclidian distance terms from each other if original data from the same class varies a little in scale, shift and rotation (2D case).

$$y = E  x;$$

e.g. a ECG classification problem example. Cardio cycles have different duration. In addition scale and shift depends on the accuracy on the beat detection. Thus cardio cycles belonging to the same class might be projected to far away due to that variation.


texts: Is there any application where one may need to compute the FFT of a complex-valued signal? I am interested in cases where the FFT of the complex-valued signal is of primary interest and is not an intermediate step in a larger computation, so cases like using analytic signals in the computation of the Pseudo-Wigner-Ville distribution is not of interest to me.


texts:
I am woking on an sound processing application where I have limited processing resources. I need to be able to detect acoustic feedback and then signal that such an event occurred. I am not concerned with the more complex task of feedback cancellation, in which the detection circuit would (presumably) need to output accurate information about the frequency and intensity of the detected feedback.

I just need to reliably detect feedback, while rejecting false positives that might come about from 'genuine' harmonic input to the system.

A time domain solution would be preferable. Can anyone suggest such a solution?


texts:
I am working on an audio upsampling/oversampling project where I am testing different interpolating schemes in hardware and comparing measurements to my expected results. In one of my interpolating strategies, linear (first-order-hold), I am measuring unexpected FFT peaks centered around the Nyquist frequency.

My setup is: between every two digital samples of recorded audio (44.1kHz), 15 intermediate samples are computed along a line (fixed point, in an FPGA). The 16x oversampled data is sent to a D/A (which zero-order-holds, obviously) and measured on a scope.

The results: if for example I am playing a tone signal of 2kHz, in FFT on oscilloscope I see main fundamental, small peak at (22.1-2)kHz, and a small peak at (22.1+2)kHz - unexpectedly! I also see as expected images centered around 44.1kHZ, 88.2kHZ, etc (these are also small, on account of linear interp./ZOH of DAC). I don't have any explicit analog processing.

Theories: I honeslty don't know...but possibilities are:

scaling I do in FPGA to convert from 16 bit input to 20 bits for DAC
using fixed point arithmetic in FPGA (I don't ever overflow or anything, but it rounds everything so it's not exact to be sure)
technically non-uniform sampling (I space the samples I created pretty evenly in time, but not perfectly...the last interpolated sample (i.e., #15 is held a little longer than the rest)

Any ideas on what gives?


texts: Why are QAM Constellations regular and rectangular?

texts:
In most IQ graphs of QAM noise, it seems like the constellation ends up with more distortion the farther you get from the center:

What causes this non-linear distortion, and why are QAM constellations not shaped like the following?


texts: Adaptive filter for noise cancellation when measuring some input

texts:
The context is as follows:  I want to measure (as in, digitize) some input signal $x$ (I have no detailed knowledge about $x$ or its statistical description).

A noise signal $x_N$ contaminates $x$ before I digitize it.  That is, the signal I read is: $x' = x + H_1(x_N)$, where $H_1$ is some unknown filter (let's assume linear, but possibly time-varying).

I have access to $x_N$ (for example, $x_N$ could be the "mains" voltage, or the ripple voltage in my power supply).  I want to cancel the noise component in $x'$ to obtain the best estimate of $x$. This estimate $\hat{x}$ is obtained by subtracting a filtered version of the noise:
$$\hat{x} ~=~ x' - \;H(x_N)$$

where $H$ is my adaptive filter.  The best estimate is that with minimum power (as a function of the filter coefficients), since the noise and the true signal are uncorrelated.

My algorithm aims to minimize $\left(\hat{x}\right)^2$.  At time step $n$, I have:
$$\left(\hat{x}(n)\right)^2 = {\left( x' - \sum_{k=0}^L h_k \, x_N(n-k) \right)}^2$$
To obtain the gradient, I take:
$$\frac{\partial \left(\hat{x}(n)^2\right)}{\partial h_k} = -2 \, \hat{x}(n)\; x_N(n-k)$$
And presumably voilà: each $h_k$ at step $n$ is updated by adding $\mu$ times the above expression to the estimate of $h_k$ at step $n-1$.

Question 1: Does the above make sense?

Question 2: Rather, a concern when I look at the math above --- intuitively, I expect the gradient's magnitude to approach zero as the system gets close to the solution (the optimal filter), but that doesn't seem the case from the equation above: the gradient is a copy of the last $L$ samples of $x_N$ (which in principle has non-zero mean), scaled by the present value of the output (which also, in principle has non-zero mean).

Am I doing something wrong?


texts: Update rule in Soft Output Viterbi Algorithm (SOVA) -Hagenauer rule

texts:
Soft output of SOVA, suggested by Hagenauer http://www.cse.lehigh.edu/~jingli/teach/S2003turbo/notes/SOVA.pdf , says in 2.2.2 "The Soft-Output Viterbi Algorithm" that

$L_{j}^{\verb|^|}:=  f(L_{j}^{\verb|^|}$, $\Delta$), if $u_{k}\neq u_{k-U}$ for  $U = 0,1,..,\delta$ where $\delta$ is the traceback depth.

It is also given in literature that,
https://www.eit.lth.se/sprapport.php?uid=362,equation 1.26, 1.27, page 11, the Hagenauer rule can be given by

$L(u_{k}^{\verb|^|}) \approx  u_{k}^{\verb|^|}min(\Delta_{k+l})$ where l = 0,1,..,U

This https://patentimages.storage.googleapis.com/ea/4a/6a/c8f50b500f6f42/WO2011020770A1.pdf says in the background section that "The update rule applied for the reliability values affects the quality (e.g., accuracy) of the extrinsic soft output values and thus the overall performance of the iterative decoder."

I'm unable to find mathematical equivalence between the two given equations. I've gone through Log likelihood Algebra (e.g., given by Todd K. Moon - Error Correction Coding- Mathematical Methods and Algorithms 2005 and others available). How can I get one from the other mathematically?
It says in literature that choice of the two given equations depends on applications. I can understand that the second equation gives very optimistic values of LLRs and hence accuracy is compromised. Can you give me any example where one is preferred over the other?

Any hint/suggestion/literature is appreciated.


texts: Given 1 recording of my voice, how can I process it to sound like 2 independent recordings of my voice played in unison?

texts:
I have one recording of my voice $x[n]$ singing a song. One thing I could do is independently record me singing the song again to obtain $y[n]$. Then, $z[n] = \frac{1}{2}\left(x[n] + y[n]\right)$ would sound like a "chorus" of some sorts (assuming that both recordings were done in perfect sync).

My question is, without doing a bunch of independent recordings, is there some decent way to go straight from a single recording $x[n]$ to the 2-fold chorus $z[n]$? More generally, I'd like to be able to go to a $k$-fold chorus (equivalent to averaging $k$ independent recordings).

My gut tells me one could simulate independent recordings by randomizing the phase in $x[n]$'s STFT somehow, but I'm not sure of specifically what should be done. In this regard, the only relevant method I'm aware of is Paul stretching, which doesn't really fit the bill, I think.

Also, is there a standard name for this particular effect I'm trying to create?