texts:
Suppose I have a measured signal $M$ that has frequency components from 0 to 50 Hz. I plot the specturm of this signal using FFT and I observe its frequency content (power vs frequency). Then, I decompose signal $M$ to its fourier series components and weights, I call this series $M_{hat}$. I compare the spectrum of $M_{hat}$ and $M$ and they look identical.

Now, I decide to extract the the frequency content between 0 to 10 Hz from $M_{hat}$. I consider the sins and cosines from 0 to 10Hz linearly combined with their weights. I call this signal $M_{hat10}$. When I plot the spectrum of $M_{hat10}$ and $M_{hat}$ on top of each other, I don't see them exactly matching in the range 0 to 10Hz. However, $M_{hat10}$ is indeed cut after 10Hz.

I don't understand why don't $M_{hat}$ and $M_{hat10}$ match in the range 0 to 10Hz.


texts: Additional prefix and suffix required when windowing an OFDM symbol?

texts:
To reduce out of band energy, it is common to apply a Raised Cosine filter to the front and back of an OFDM symbol. It is also common to overlap the windowed portions of adjacent symbols to eliminate amplitude dips.

For an OFDM symbol consisting of a Cyclic Prefix followed by NFFT points from an IFFT, is it common to insert an additional prefix and suffix for the windowed portion? If that isn't done then the CP and the IFFT data are shaped by the window, distorting the constellation. A pretty good description of what I am talking about is here:

http://zone.ni.com/reference/en-XX/help/373725A-01/wlangen/windowing/


texts:
I need some help clarifying FFTs and what they represent. I have a buffer containing compressed audio. Due to limitations, I can't handle the full uncompressed audio but can decompress small segments at a time.

Lets say I take 10 seconds of uncompressed samples, I would need to store this in  PCMaudiobuffer of size 10 * 44100 * sizeof(float) and I'd have 441000 samples. I then loop through these 441000 samples with a length of 1024 (with a 512 overlap).

for(int i =0; i < 441000; i += 512)
{
   //code to copy (i + 1024) from PCMaudiobuffer to tempbuffer. (not shown)

   //perform FFT
   InPlaceFFT(tempbuffer);

   //copy the first 512 values of the tempbuffer across to
   //a new buffer so tempbuffer can be reused in the loop
   CopyArray(512, finalbuffer);
}

Assuming all of this is correct, this is where I'm confused. Am I right in copying only the first 512 values (N/2) to the finalbuffer? (I'm using the Accelerate framework's FFT method). Is this an efficient/correct way of performing FFTs offline? Lastly, I want to be able to create a frequency spectrum from finalbuffer. To do this do I simply loop through every 44100 (1 second) and calculate the magnitude, or is 1 second generally too inaccurate for a frequency spectrum?

I may be misunderstanding all of this, so feel free to tell me to throw all this out the window :) Thanks for any help, this is quite confusing!

Edit
The Apple docs on this aren't easy to follow, but I'm using the method outlined here in vDSP_fft_zrip. (The formatting of the Apple site sometimes messes up the anchor position, so you may have to scroll down slightly). I found this post to be a helpful guide on how to use it.
Thanks.


texts: How does the OFDM system receiver decide the OFDM symbol length?

texts:
I am trying to understand how the receiver decides the length of OFDM symbol in time domain before it goes into DFT process at the receiver.
The complete OFDM symbol (with Cyclic Prefix added) is propagated by the transceiver through the channel and it is received at the receiver with a time delay. This delay is caused by the propagation channel due to the objects or channel characteristics. And now lets say we have received the signal and first need to know what the symbol start time so that receiver can start the OFDM symbol and cut it at the end of the symbol. Then start for the consecutive symbol...

Could anyone please explain how to visualize this?

Thanks in advance!


texts: Why do we choose cutoff frequency to be taken for "1/sqrt(2) magnitude reduce"?

texts: Why don’t we instead choose (calculate) our bandwidth to be between two purple “dot’s”? Why don’t those purple dot’s represent points for “cutoff frequency”? Looking at this picture “frequency components” after the right purple dot (or before the left purple dot) would be attenuated (yellow lines + after cutoff frequency). I presume that red line I drew represents that components of a signal would neither increase or decrease in magnitude. Following that logic, if I want to send signal and (theoretically) receive same signal through this channel (having this response) than it’s better for signal to have only components between those two purple dots. Any components of signal after right purple dot or left purple dot would be attenuated and hence we won’t receive same signal (signal with same shape)?


texts: How does the earphone cable in a mobile phone pick up the FM reception?

texts: As I understand, the RF frequency-modulated signal centered in the range of $88-108\textrm{ MHz}$, is picked by the earphone antenna and is directly sampled by the sound card adc at $48\textrm{ kHz}$ and then digitally processed. Will this process not cause aliasing? Could anyone please correct my understanding?


texts:
I have to subtract, from a signal x[n], its version filtered thorugh an LPF FIR filter, like this:

xf=filter(h_lpf,1,x);
y=x-xf;

How can I remove the group delay introduced by the filter h_lpf into the signal xf?

I know it is equal to $\tau_{grp}=\frac{N-1}{2}$, where N is the number of taps.

In my case N is odd, so $\tau_{grp}$ is an integer.

In this page:

http://it.mathworks.com/help/signal/examples/practical-introduction-to-digital-filtering.html#zmw57dd0e2544

in the section (Compensating for Delay Introduced by Filtering) there's a method, which I here adapt for my case: (note: "x" is the input signal, and D is the group delay):

xf = filter(h_lpf,1,[x zeros(1,D)]);      % Append D zeros to the input data
xf = xf(D+1:end);                         % Shift data to compensate for delay
y=x-xf;

Could anyone explain it to me? Could I use it for my problem?


texts:
I'm looking into equalisation for FSK over HF channels for Digital Voice applications.  As a starting point, I am trying to understand the CMA algorithm.

I found a nice CMA Matlab example for BPSK in a previous post here on this site.

I have modified the simulation to use 2FSK but it doesn't converge to the same result.  The first plot is for BPSK modulation, the 2nd plot for FSK.  The combination of the channel and equaliser impulse response is converging to 1 for BPSK.

Any suggestions of how I can get this simulation working for FSK would be much appreciated!

Here is the source code.  the variable "tx_type" switches the tx modulation source.

N = 20000;          % # symbols
h = [1 0.45 -0.2];  % channel impulse response
h = h/norm(h);
Le = 20;            % equalizer length
mu = 1E-3;          % step size
snr = 30;           % snr in dB
M = 10;             % oversample rate

tx_type = "bpsk";   % select modulation type here "bpsk" or "fsk"

if strcmp(tx_type, "bpsk")
  s0 = round( rand(N,1) )*2 - 1;     % BPSK signal
  s0M = zeros(N*M,1);                % oversampled BPSK signal
  k = 1;
  for i=1:M:N*M
   s0M(i:i+M-1) = s0(k);
    k ++;
  end
end

if strcmp(tx_type, "fsk")
  tx_bits = round(rand(1,N));

  % continuous phase FSK modulator

  w1 = pi/4;
  w2 = pi/2;
  tx_phase = 0;
  tx = zeros(M*N,1);

  for i=1:N
    for k=1:M
      if tx_bits(i)
        tx_phase += w2;
      else
        tx_phase += w1;
      end
      tx((i-1)*M+k) = exp(j*tx_phase);
    end
  end

  s0M = real(tx);
end

s = filter(h,1,s0M);                % filtered signal

% add Gaussian noise at desired snr

n = randn(N*M,1);
vs = var(s);
vn = vs*10^(-snr/10);
n = sqrt(vn)*n;
r = s + n;          % received signal

e = zeros(N*M,1);   % error
w = zeros(Le,1);    % equalizer coefficients
w(Le)=1;            % actual filter taps are flipud(w)!

yd = zeros(N*M,1);

for i = 1:N*M-Le,
    x = r(i:Le+i-1);
    y = w'*x;
    yd(i)=y;
    e(i) = y^2 - 1;
    w = w - mu * e(i) * y * x;
end

np = 100;           % # sybmols to plot (last np will be plotted); np < N!

figure(1); clf;
subplot(311), plot(e.*e), title('error')
subplot(312), stem(conv(flipud(w),h)), title('equalized channel impulse response')
subplot(313);
plot(1:np,s0M(N-np+1:N),1:np,yd(N-np+1-Le+1:N-Le+1))
title('transmitted and equalized signal'), legend('transmitted','equalized'), axis([0,np,-1.5,2])

Thanks,

David


texts: Squared magnitude of System Function H(z)


texts: sketching magnitude of frequency response of H(z)

texts:
I am trying to plot the magnitude of H(z), I got it to factore, and would like to sketch its plot of magnitude. But I am have trouble evaluating the function.
$$
H(z)= \frac{(1-2z^{-1})(1+0.5z^{-1})(1+0.9z^{-1})}{(1-z^{-1})(1-0.7jz^{-1})(1+0.7jz^{-1})}
$$

I know we replace z with $e^{jw}$ and try to evaluate it at various w such as pi, pi/2 etc. But that is really complicated and when I tried it I couldn't get the right answer as the text book. Is there an easier way to evaluating magnitude and phase by hand?

Thanks


texts: QAM-spectrum with uneven real & non-odd imaginary part

texts:
Despite the signal being real, as is seen in the last line of the first picture:

, the exemplary spectrum of the signal shows neither an even real nor an odd imaginary part:

But from my theorems I know that for every real x(t) the real part of the Fourier-Transform is even and the imaginary part of it is odd?


texts:
I am trying to Frequency modulate a sine signal using Matlab. I have written the following code for the same:

clc;
Fc = 5000; %Carrier Signal
fs = 20000; %Sampling Rate
t = 0:0.00001:0.002;
freqdev = 50; %Frequency Deviation
x = sin(2*pi*1000*t);
subplot(3,1,1);
plot(t,x);
y = fmmod(x,Fc,fs,freqdev,0);
subplot(3,1,2);
plot(t,y);
z = fmdemod(y,Fc,fs,freqdev,0);
subplot(3,1,3);
plot(t,z);

The above code gives me the following output:

The first plot shows the modulating (sine) signal.
The second plot shows the FM modulated signal.
The third plot shows the demodulated signal.

But the second and third plots doesn't look like a FM modulated signal and demodulated signals respectively. What is wrong with my code?


texts: Meaningfulness of Frequency Spectrum for Classification

texts:
I just started to dive into signal processing due to a free-time project. Therefore, this is my first question here, for which I searched many previous threads, but couldn't find what I was looking for as most of the questions are about vibration or sound signals.
The underlying process of my application: "Based on a pressure sensor signal over time, I am trying to classify whether the activity was carried out correctly. Based on this idea I am planning to use logistic regression, taking several features as input to the model. Each snippet to classify is of the length of one period. Before and after the activity the sensor signal remains in an idle stage.

In terms of feature extraction, I already implemented the extraction of time-domain features. Nevertheless, I am currently trying to derive features in the frequency domain. The length of the raw sequence is 45 +-5 seconds sampled with 10Hz. Plotting the frequency spectrum of the unpadded signal looks like this, wherein the green are correctly executed activities and the red ones are faulty executed activities. The frequency axis is in 1/min and the peak is as expected around 1.5 per min.

Due to difficulties to identify the differences, I windowed and zero-padded the data to a sequence of length 2048, which is 4.5 * the original length. Then the FFT looks like this (zoomed in to the interesting frequency band):

Is it useful at all to build the FFT of one period of the signal?
Is zero-padding a useful tool as it does not increase the frequency resolution, but instead interpolates, which does not provide me additional information about the signal?
Which useful features can be extracted from the spectrum based on the result? The basics of deriving the frequency of the highest peak and the maximum peak value are already implemented. One more idea was to analyze the PSD calculated through the Welch algorithm, but unfortunately, I cannot get a smooth signal as even a larger window on the zero-padded data does not work for me.

Thank you for all your help in advance.


texts: What is the difference between a range image and a depth map?

texts:
https://en.wikipedia.org/wiki/Depth_map

https://en.wikipedia.org/wiki/Range_imaging

To me, it sounds like they are the same thing, except depth map implies only having the z coordinate info.

But then again, if you have a range image vs depth image, is this something one can tell the difference by examining the data or is the term mostly contextual?


texts:
I'm trying to understand impulse and unit step responses, but I'm not sure if my understanding is correct. In general, are the following statements true:

a) The impulse response for a system $x(t) \mapsto y(t)$ is $y(t)$ when $x(t) = \delta(t)$ where $\delta$ is the Dirac delta, and

b) The unit step response for a system $x(t) \mapsto y(t)$ is $y(t)$ when $x(t) = u(t)$ where $u$ is the unit step (Heaviside step function)


texts: Any ideas on creating a GNU radio block for scanning active frequencies (FM/AM/DAB/DVB-T)?

texts: I am trying to create a GNU Radio block that scans the active frequencies, let's say for FM/DAB channel. I have seen scanner implementations in c++/python but are not compatible with GNU Radio. Can someone guide me on creating a GNU scanner block?


texts: Acoustic characteristics of thoracic diaphragm

texts:
I am looking for any kind of information about the acoustic characteristics of the thoracic diaphragm. In particular, I'm looking for characteristics which will allow to differentiate it from other muscles using ultrasound, MRI, CT, etc.

References to the literature are especially welcome.


texts: LTI system without constant coefficient differential equation

texts:
I have encountered a system where the output $y(t)$ and input $x(t)$ are related in the laplace domain as:

$$Y(s) = H(s)X(s) \tag1$$

which is typical. However, $H(s)$ is not a rational function of polynomials of $s$. Instead, $H(s)$ contains terms like $\log(s)$.

As far I knew, one can write equation $(1)$ only for an LTI system and LTI systems have rational polynomial transfer functions. Am I correct in this analysis?

If I have a logarithm in $H(s)$, that implies that I cannot write a linear differential equation with constant coefficients in the time domain. Is it possible to have an LTI system that is not representable by such differential equation?

Does a frequency domain analysis always imply an LTI system?


texts: How can a system be unstable if $L(j\omega)$ is never exactly $-1$?

texts:
Say we have a linear system with unity feedback, with loop transfer function $L(j\omega)$. The closed-loop transfer function from reference to output is $T(j\omega) = \frac{Y(j\omega)}{R(\omega)}=\frac{L(j\omega)}{1+L(j\omega)}$.

At frequencies for which $L(j\omega)$ approaches $-1$, clearly $|T(j\omega)| \rightarrow \infty$, so the system is unstable - if excited at this frequency, the output is unbounded.

But systems can be unstable even if $L(j\omega)$ never equals $-1$. From the Nyquist plot, we can  show that $T(j\omega)$ can have poles in the right half plane if the contour encircles $-1$, even if $L(j\omega)$ never exactly reaches it. (However, I have very little intuition for why this is true - I just see it as a theorem from complex analysis that happens to be useful here).

Alternatively, from the Bode plot, we say a system is unstable if there are any frequencies for which $|L(j\omega)|$ > 1 and $\angle L(j\omega)< -\pi$ (i.e. phase margin is negative, or gain margin is less than unity). However, I'm not sure why these two conditions result in instability, since these don't result in $|T(j\omega)|$ going to $\infty$.

Two questions:

(1) If $|T(j\omega)|$ never goes to infinity (which is the case when $L(j\omega)$ is never exactly $-1$), how can a system possibly be unstable? Is $|T(j\omega)| \rightarrow \infty$ not the right criterion for deciding whether a system is unstable?

(2) Intuitively, why is a system unstable if there are any frequencies for which $|L(j\omega)|$ > 1 and $\angle L(j\omega)< -\pi$? I understand that you can see it from the Nyquist plot because these two conditions tend to result in encirclements of $-1$ in the $L(s)$ plane, but I'm looking for the intuition.


texts: What kind of filter would have a sawtooth frequency response?

texts:
I want a complex FIR or IIR filter whose response is approximately a sawtooth in the frequency domain. How should this be formally described, and what formula or algorithm can I use to calculate taps for one?
Here is a sketch of the magnitude response I want (not analysis of an actual filter). I think the phase response doesn't matter.


texts:
My basic knowledge is too bad. I am confused about the waveform of BPSK signals. To create a BPSK signal, I generated BPSK symbols with ideal rectangle pulse shaping, which is given by:

Then, the signal after carrier modulation is shown below, which is consistent with the waveform on the textbook.

But, the root raise cosine (RRC) filter is often used in practical. By using the same BPSK symbols above, the waveform after pulse shaping is given by:

After carrier modulation, the waveform becomes like this:

This strange image makes me wonder, is this the correct waveform? Because there is no such waveform in the textbook，I am really not sure about that, Thanks guys. By the way, I have tried that this modulated signal can be demodulated after coherent demodulation and matched filter.

ones and zeros:

Modulated symbols after pulse-shaping:

After carrier modulation:


texts: What helped you in reading and implementing papers and coming up with original ideas in computer vision/graphics?

texts:
I'm trying to get into academic research at the intersection of vision and graphics, and was wondering how researchers in the field went about this:

Was it useful to do a lot of fundamental math courses (Linear Algebra, Multivariable Calculus, Probability, Statistics) prior to reading papers, or did you find it more efficient to learn the math on the go?
How did you get started on reading and implementing papers? What helped and what didn't? Looking back on your experience, what did you wish you were more prepared with?


texts: Getting audio samples from power spectrum

texts:
Let's say I have a signal sig in a form of a .wav file, I've read that file, and now I have an array of samples of that audio, after that I've performed FFT on that array and got an array of complex numbers, that'll be fft, which consists of positive as well as negative values. After that I've computed power spectrum, ps using this formula:

ps[a] = sqrt(fft[a].real^2 + fft[a].imag^2).

So, basically process looks like this: sig$\rightarrow$ fft$\rightarrow$ ps. Now, the question is: can I go backwards, meaning: ps$\rightarrow$ fft$\rightarrow$ sig?


texts: How to distort a signal (image) pattern using bilinear interpolation

texts:
I have a signal pattern $s$ that generated at time $t$ like this:
$$
s(x,y,t)=D(x,y)\sin(\omega t-0.56)
$$

Where $D(x,y)$ is a mode shape, calculated by
$$
D(x,y)=a\left\{\left(\frac{x}{m}-0.55\right)x-\left(\frac{y}{n}-0.55\right)y\right\}
$$
Where $m,n,a$ is the $m\times n$ size of image and excite amplitude respectivetly.

The image $i$ is multiplied by $s(x,y,t)$ to get the mode shape $f$
$$
f(x,y,t)=s(x,y,t)\cdot i(x,y)
$$

My question is, at every instance of time $t$, how do I distort the shape $f$ using bilinear interpolation?

Matlab function before the distortion:

function [ sim ] = simvib( inputimage, amplitude, T, normalizedto, pauses )

if ~exist('pauses', 'var'), pauses=0.5; end
    omega = 1;
    [m, n] = size(inputimage);
    [x, y]=meshgrid(1:n,1:m);
    D=amplitude.*(((x/m)-0.55).^2.*x-((y/n)-0.55).^2.*y);
    sim=zeros(m,n,T);
    for t=1:T
        simulate=D.*sin(omega*t-0.56).*inputimage;
        simulate=normalize_var(simulate, 0, normalizedto); %normalize max to normalizedto
        sim(:,:,t) = simulate;
        imagesc(sim(:,:,t)); %the mode shape
        pause(pauses);
    end

end

Thanks in advance!


texts: Why is carrier wave affected by percentage modulation?

texts:
In amplitude modulation, Power of a carrier wave is represented by : $$P_c = \frac{A_c ^2}{2R}$$

Which is independent of modulation index!

Question: At what factor is the power of carrier wave dependent on!?


texts:
When calculating the FT of a signal, and the FT of that same signal but after having applied zero-padding to it, should't the amplitudes of the FT of the zero-padded signal decrease with respect to the FT amplitudes of the original signal?

1) Since the FT of the zero-padded signal has more frequency bins (since we have interpolated the spectrum), my intuition tells me that the amplitude of the frequency bins of this FT should be lower.

However, when I calculate the FT of the two signals (I use the fft function available in Scipy for Python), I get the same amplitudes for their spectra. I was not expecting this behaviour.

2) If I add the normalization term when calculating the FT (Scipy FFT does not include this), i.e. $FT = fft(signal) / length(signal)$, then I get different amplitudes for the two FT, which again, was not what I was expecting. Specifically, the zero-padded signal FT amplitudes decrease with respect to the non zero-padded, and the more zero-padding I add, the more the amplitudes of the FT decrease.

I am a bit confused with whether these results are supossed to be like that, or if I have done something wrong in my calculations.


texts: What are the kernels that are used in the Smooted Psuedo Wigner-Ville distribution?

texts:
Defined in Matlab's docs for WVD, SPWVD is given by:
$\int_{-\infty}^\infty g(t) * H(f) x(t + \frac{\tau}{2}) x^*(t - \frac{\tau}{2}) e^{-j2\pi\tau\,f} \, d\tau$
H(f) and g(t) are the smoothing kernels for frequency and time domain if I understand correctly. However, I have no idea what these look like or how they function really. Seems weird that they are mentioned in quite a lot of places, but never explained properly.
Could someone enlighten me on what these look like and what they do?
Many thanks!


texts: Unstable Phase in Channel Impulse Response

texts:
I'm using DW1000 UWB radio transceiver and extract its channel impulse response (CIR). The CIR output by the transceiver is the complex baseband CIR. In a static environment, the CIR is a LTI filter expressed as
$$ h_b(\tau) = \sum\limits_{i} a_i^b \cdot \delta(\tau-\tau_i) $$
where
$$ a_i^b = a_ie^{-j2 {\pi} f_c \tau_i} $$
$ i $ is the index of (multi-) paths. $ a_i $ is the (complex) scaling factor including distance, antenna gains, etc. $ f_c$ is the carrier frequency. $ \tau_i $ is the time delay due of path $ i $.
What I'd like to have is the phase of the direct path. Let direct path have index $ i=0 $, the phase is then $ -2 {\pi} f_c \tau_0 $. Since the direct path is the shortest, i.e. $ \tau_0 < \tau_j, \forall j \ne 0$, if I take the phase of the first peak in the CIR, I would get the phase of direct path.
So I have two DW1000 transceivers, one Tx and one Rx (whose local oscillators are not synchronized), keep everything static, and take multiple CIR measurements from the Rx. However, the first peak CIR phase varies quite a bit from one measurement to another (it even seems changing randomly). I understand carrier frequency offset (CFO) might be causing this, and tried a technique to eliminate it but with no luck. So I'd like to ask if there's any other potential reason for the unstable phase?
Since I'm still learning about RF systems, an explanation from up/down-conversion and channel estimation point of view is greatly appreciated!
In the figure below, x-axis is the first peak phase of n-th CIR and y-axis is phase.
Thank you!


texts:
With the current lockdown, I'm spending some time in understanding L1 PHY development  and have some questions on the start of packet detection in an IQ capture

Let's say I have a WiFi IQ capture which consists of 1000 packets and want to extract indexes of start and End of each WiFi Packet.

When I plot abs(IQ_samples), it is like

WiFiPacket|NULL|WiFiPacket|NULL|NULL|NULL|WiFiPacket|NULL|WiFiPacket ....

Since the energy  of NULL is very much close to zero compared to the max_value of abs(IQ_sample of each packet). Can I keep some kind of threshold to find the start and end of the packet.

This is what I found after searching over internet and going through some posts
*) find the minimum value of IQ capture .. that would give me noise value (NVAL)
*) take some threshold which is a factor of NVAL (Threshold = factor x NVAL)

My main confusion is what should be the factor value or how should I find that?


texts: Determining the autocorrelation sequence from an AR model

texts:
I have the following equation:

$$x(n)=\frac{14}{24}x(n-1)+\frac{9}{24}x(n-2)-\frac{1}{24}x(n-3)+w(n)$$
where, $w(n)$ is a stationary white noise process with variance $\sigma^2_w$

Now, I want to determine the auto correlation sequence $\gamma_{xx}(m)$, for $m = 0,1,\ldots,5$

Now, I know that the autocorrelation function for AR process which is given below:

$$\gamma_{xx}(m)= \begin{cases}\displaystyle-\sum_{k=1}^p a_k\gamma_{xx}(m-k), & m > 0\\
\displaystyle  -\sum_{k=1}^p a_k\gamma_{xx}(m-k) + \sigma_w^2, & m = 0\\
\gamma_{xx}^*(-m), & m < 0\\
\end{cases}$$

Here, I already found the coefficients of ${a_k}$ which are $a_1=-\frac{14}{24}, a_2=-\frac{9}{24}, a_3=\frac{1}{24}$.

Now, I don't get, how can I calculate $\gamma_{xx}(0)$ to $\gamma_{xx}(5)$ recursively?

Please someone tell me how can I solve  $\gamma_{xx}(0)$ and $\gamma_{xx}(1)$? Then I can do the the rest.


texts: How do you find the frequency and amplitude from a DFT?

texts:
I generated a time history of 200 points using the equation
$$x(t) = A\cos(2\pi f t)+ B\sin(2\pi f t) $$

with $A = 1$, $B = 0.1$ and $f = 17.2 \mathrm{Hz}$ and a sample rate of 400 samples per second. The numerical Fourier transform of the time history has a modulus plot of:

The question is how to get the frequency, amplitude and phase from this plot? This is the typical case where the frequency falls between bins. As there are three unknowns I would imagine you could get the precise values from, say, the three largest points which I call premax, max and postmax. However, complex values are available for all the points so many methods are possible.

This question arose as an output from a previous question where it was suggested I ask afresh and that several answers were available.  I have also asked this question on Mathematica Stackexchange here where it was suggested I ask on Signal Processing.

Many answers are available. Exact rather than approximate answers are preferable. Some, like using a Prony series or curve fitting a sine wave, do not use the Fourier transform. These are also interesting but I would like to use the Fourier data.

If there is noise on the data then some sort of fitting is probably needed depending on the extent of the noise. All suggestions welcome. Thanks

Edit

A bit more in response to the answers which I still have to fully investigate

There is an exact analytic formula for the Fourier transform of a sampled sine wave. For my data it plots as

This plot could also be obtained by calculating in-between values for the original data. I also calculated the frequency at the maximum of the analytic curve. To 25 significant figures it is

17.22726210702718945079653

which is significantly different to value of 17.2 used in the calculation of the  time history.

Some of the answers suggest using parabolic interpolation. I show the results of this here

I have tried parabolic interpolation using the complex values of the Fourier transform and the absolute values. The absolute values show a better maximum than the complex values but they are still well off. I still have other suggestions to try.

Methods based on time domain analysis look more promising than using Fourier which is disappointing.


texts: Why do we read that Hilbert transform can be used for envelope detection?

texts:
We can often read that Hilbert transform is useful for envelope detection (e.g.
Hilbert transform to compute signal envelope?)

I have done some tests with various soundfiles, and

x[n] -> absolue value -> 1-pole low pass filter -> envelope

or

x[n] -> Hilbert transform -> absolute value -> 1-pole low pass filter -> envelope

gives the same kind of result, it's not better with a Hilbert transform (top : envelope computed with hilbert, bottom : envelope computed without hilbert) :

Moreover, I know that computing the Hilbert transform is very time-consuming (big FIR filters involved).

So it is really a good method for envelope detection ?


texts: I am quite familiar with signal processing using Matlab. Now I am working in its open source alternative 'Scilab.' In Matlab, cconv() function is used to perform circular convolution between two sequences. I want to do circular convolution in Scilab. But I could not find an equivalent function for circular convolution in Scilab. Are there any other methods to perform circular convolution in Scilab (or, is there really a function for circular convolution in Scilab)?


texts: Autocorrelation of a uniform random process

texts:
i am currently learning the basics of signal processing.

As you may know the definition of the autocorrelation is different if you look at a random process or for example a deterministic signal

My question is about the autocorrelation of random processes:

Suppose $X$ is a random variable with uniform distribution over $[0,1]$

so: $ f_X(x)=1$ for $(0<x<=1)$

The autocorrelation $r_{XX}(n_1,n_2)$ is defined as: $r_{XX}(n_1,n_2)=E[X(n_1)X(n_2)]$.

if $X$ is stationary up to the second order the autocorrelation is only a function of $\tau$: $r_{XX}(\tau)=E[X(n+\tau)X(n)]$.

If i generate such a random variable in matlab with the "rand" command and compute the autocorrelation (which should be possible because the random process is ergodic [ time and ensemble averages are equal]) i get a strange result which looks more like the convolution of the propability density functions. If i subtract the mean i get the result i would expect, because i assume that X is uncorrelated white noise, so $r_{XX}(\tau)=\sigma_x^2\delta(\tau)$

x=rand(1,100)
Rxx=xcorr(x,x);
subplot(2,1,1)
plot(Rxx);
grid;
title('Autocorrelation function of (X)');

ylabel('Autocorrelation');

y=rand(1,100)-0.5
Ryy=xcorr(y,y);
subplot(2,1,2)
plot(Ryy);
grid;
title('Autocorrelation function of (Y)=(X-0.5) ');

ylabel('Autocorrelation');

So my questions are:

$(1)$ Am i wrong with the assumption that $r_{XX}(\tau)=\sigma_x^2\delta(\tau)$? And if yes, how can we compute $r_{XX}(\tau)$ because we don't know the join-propability densitiy function $f_{X_1X_2}(x_1,x_2)$

$(2)$ Why does the result of the first computed autocorrelation look so strange? (first plot)


texts: "Tail-like" response from digital microphone

texts:
I was doing some experiments with audio and wish to get "raw and unprocessed" data, and noticed that all the files had the following profile (just blowing into the mics):

Speaking to the microphone vendor, they mentioned - audio acoustic system will convert impulses into tail recovery dependent on the delay constants of the system which is dependent on system bandwidth.

Can someone explain what this means? What is the phenomenon called? Equations would be helpful as well.

Thanks


texts: What kind of filter I should use to remove the oscillations in this autocorrelation function?

texts:
I have an autocorrelation function which is shown as following,

I do believe these trailing oscillating wigs are spurious and should be removed by some kind of filter. But I am not familiar with any types of filters. Any help will be appreciated! The original data can be downloaded at

~

Update @ Apr 14 2017:

This result was processed with the filter suggested by Dan.


texts: Detecting outliers/noise from sensor data

texts:
I am trying to detect outliers/noise as indicated on the diagram below from sensor data. Can anyone advice how to go about it? I can only do this in python, so are there libraries in python that I can leverage? Is there an example that can be given. Sample data am using has timestamps and the value.
Also how can I also get the frequency of the noise/outlier occurence?


texts: What are high frequencies and low frequencies in a signal?

texts: I'm new to signal processing. I'm plotting a signal in the time-domain in matlab. I don't understand which parts of the signal are high frequencies and low frequencies, can someone explain what a high and low frequency is, and how to see high frequencies and low frequencies on a graph?


texts:
I am interested in studying local pixel value dependencies in images and I am wondering if it exists a general form of prediction-error convolutional filter that is able to suppress the image's content and extract the residual between the central pixel value and it's local neighbors within the filter dimension.

If so, what kind of filters I can use and do they have a general form or structure in their weights.


texts: I have the following accelerometer signal, I want to segment or slice the signal into Red parts and Green parts

texts: I want to count steps which are basically represented by peaks in the signal. the red part in the signal doesnt correspond to any walking activity, I want to ignore them. Any help on segmenting or croping out the green parts of the signal.


texts: Kullback-Leibler Distance of Spectral Data

texts:
I am currently reading through Music Structure and Analysis from Acoustic Signals and am having some difficulty in understanding how the modified Kullback-Leibler distance is calculated.  (I am just very recently starting to get into audio analysis and back into shape regarding more applied math, so this could just be a case of me getting confused by some symbols!)

I'm specifically having some trouble understanding the Segmentation by Clustering section.  The formula for the proposed KL distance is:

$$KL2(A, B) = KL(A; B) + KL(B;A)$$

Expanded out, this yields:

$$KL2(A,B) = \left(\frac{\mathrm{Cov}[A]}{\mathrm{Cov}[B]}\right) + \left(\frac{\mathrm{Cov}[B]}{\mathrm{Cov}[A]}\right) + (\mu_A - \mu_B) \cdot \left(\frac{1}{\mathrm{Cov}[A]} + \frac{1}{\mathrm{Cov}[B]}\right)$$

Here's where I'm running into issues:

This formula is expected to be used between to matrices of spectral data.  So, basically- how do I compute the covariance?  It seems I do it between each feature vector.  That's easy enough, but how do I combine them so that they're usable in this formula?  It shouldn't be a vector of covariances, right- how could they be divided, then?
Just so I know I'm correct, then the dot product means that the means has to be a vector, right?  If that's the case, then what happens if the segments of audio that I'm looking at happen to be different lengths?  Will the resulting vector from that subtraction just be the length of the longer vector, with the tail end just being either positive or negative entries based on if A or B had more entries?

Apologies if this is confusing!  Any help is appreciated.


texts:
my_signal = 8192*cos(2*pi*6*(0:7)/8) + 1i* 8192*sin(2*pi*6*(0:7)/8);

my_signal_fft = fft(my_signal);

plot(abs(my_signal_fft));

This is matlab code. What do you notice about the spectrum? Is it symmetrical? Obviously not, because I think it has an imaginary part. Would you enlighten me for the analysis of this signal's spectrum and why having an imaginary part doesn't make it symmetrical? How is the other half gone?


texts: Remove phase mis-alighnment in digital signals

texts:
Apologies for the poorly formulated question -- I've been away from DSP for a while.

Let us say I have amplitude vs time data for N signals. where amplitude is -127 to 127.
For each signal I have say 900 to 1100 time samples.

I have a priori knowledge that the N signals can be grouped into n clusters where n << N.

I can take a guess at n. So for example if N=1000 I can guess that n=10.

If a signal belongs to a cluster -- then the sum of square error of the amplitude/time between the signal and the mean of the aplitude/time of the cluster is less than a equivalent measurement between all other such clusters.

The problem is that all of these signals are not aligned at time. So there is uncertainty when the first measurement was taken. The uncertainty for any signal is much less than the size of the signal. So say I have 1000 time measurements for a signal then the first measurement is at most 10 units of time delayed from zero.

Question: Given the above how to I cluster the signals given such phase distortions.

Thanks.


texts: If Digital Signal has frequency components then why we don't use it

texts:
As we know there are two kinds of signals: analog signals and digital signals.

And there are two common techniques for multiplexing the signals: Time Division Multiplexing (TDM) and Frequency Division Multiplexing (FDM).

As I understand it, FDM is commonly used to multiples analog signals, while TDM is commonly used to multiplex digital signals.

What I don't understand is:  Why do we not (commonly, at least) use FDM to multiplex digital signals or TDM to multiplex analog signals?


texts:
I am digging into Haar like and LBP features. More precisely its implementation in OpenCV. Every article or forum entry I found states, that LBP is faster than Haar. My local tests also confirm this expectation. Yet I don´t understand why are LBP faster. As far as I know, OpenCV uses MB LBP features. I looked into some trained LBP cascade, and found out that leafe values as well as stage thresholds are floating point values, similiar to Haar cascade. Also, both features are very similiar, Haar sums up regions in rectangles together to get threshold values where MB LBP does 8 thresholding with neighbours. But both alghoritms use Integral image for quick summation. So by very naive approach, it seems to me that 8 comparisions are actually slower than few additions.

So, what is the expensive part of Haar feature evaluation vs MB LBP? I know I am wrong, based on practical testing, I just don´t know why.


texts:
I'm trying to understand the derivation of the zero order hold discretization method, and I have a couple of questions about some of the steps.

I think I understand the first part, this is just the solution to a system of linear equations using the matrix exponential and an integrating factor:
$$ \begin{split}
\dot{x}(t) &= A x(t) + B u(t) \\
\dot{x}(t) - A x(t) &= B u(t) \\
e^{-At} \dot{x}(t) - e^{-At} A x(t) &= e^{-At} B u(t) \\
\frac{d}{dt}\left(e^{-At} x(t)\right) &= e^{-At} B u(t) \\
e^{-At} x(t) &= \int_{-\infty}^{t} e^{-A\tau} B u(\tau) d\tau + c \\
x(t) &= e^{At}c + \int_{-\infty}^{t} e^{A(t-\tau)} B u(\tau) d\tau
\end{split} $$

Next, the integration constant is determined using the initial condition $ x(0) $:
$$ x(0) = e^{0}c + \int_{-\infty}^{0} e^{-A\tau} B u(\tau) d\tau $$
Now, I understand that for finite, unilateral signals, this simplifies to $ c = x(0) $, however, what happens if $ u(t) $ is a Dirac delta? Why would the integral be zero in that case?

Then the state is sampled at $ (k+1) T_s $:
$$ \begin{split}
x((k+1) T_s) &= e^{A (k+1) T_s} x(0) + \int_{-\infty}^{(k+1) T_s} e^{A((k+1) T_s-\tau)} B u(\tau) d\tau \\
&= e^{A T_s} \left(e^{A k T_s} x(0) +  \int_{-\infty}^{k T_s} e^{A(k T_s-\tau)} B u(\tau) d\tau \right) + \int_{k T_s}^{(k+1) T_s} e^{A((k+1) T_s-\tau)} B u(\tau) d\tau \\
&= e^{A T_s} x(k T_s) + \int_{k T_s}^{(k+1) T_s} e^{A((k+1) T_s-\tau)} B u(\tau) d\tau \\
\end{split} $$
Since the input is the result of a ZOH operation with the same sample time $ T_s $, the input is constant over a single time step:
$ \forall t \in [k T_s, (k + 1) T_s): u(t) = u(k T_s) $, therefore, $ u(\tau) $ can be moved outside of the integral:
$$ x((k+1)T_s) = e^{A T_s} x(k T_s) + \int_{k T_s}^{(k+1) T_s} e^{A((k+1) T_s-\tau)} d\tau B u(k T_s) $$
$$ x[k+1] = e^{A T_s} x[k] + \int_{k T_s}^{(k+1) T_s} e^{A((k+1) T_s-\tau)} d\tau B u[k] $$

The discrete system matrices then are:
$$ \begin{split}
A_d &= e^{A T_s} \\
B_d &= \int_{k T_s}^{(k+1) T_s} e^{A((k+1) T_s-\tau)} d\tau B
\end{split} $$
My second question is if it's well-defined to solve this integral using substitution. The result seems to be correct, but it feels strange that the integration boundaries and the variable of integration suddenly become matrices themselves. Also, there seems to be something funny going on with the commutativity of the factor $ A^{-1} $ and the integral when substituting $ d\tau $.

$$ \begin{split}
V &= A((k+1) T_s-\tau) \\
dV &= -A d\tau \Leftrightarrow d\tau = -A^{-1} dV \\
B_d &= -A^{-1} \int_{A T_s}^{0} e^V dV B \\
&= A^{-1} \left[e^V\right]_{0}^{A T_s} B \\
&= A^{-1} \left(e^{A T_s} - I\right) B
\end{split} $$

If there are any other holes or mistakes in my reasoning, feel free to let me know.


texts: How to apply a Butterworth filter to data of varying sample rate?

texts:
I am trying to apply a Butterworth bandpass filter to accelerometer data of my smartphone. However, the accelerometer samples I receive do not come at regular intervals. Sample frequency varies between 1 Hz and 128 Hz in as little as a second.

I read the source code of a few Java implementations of Butterworth, but all of them appeared to assume a constant sample rate. Is there a way to implement Butterworth that allows for a variable sample rate? Or should I interpolate the accelerometer data to obtain a constant sample rate?

If you answer with math, please include a layman's explanation. I'm a bit weak on the theoretical side of signal processing.


texts: Predicting the class of an event or its probability in n days after

texts:
I have a dataset with time series and for some of them (test sample) dates are known (maybe from zero to several pieces per time series), which we will call target events, the occurrence of which I want to predict.
Also, for each rserie, several heuristics have been calculated that catch some kind of local change in the serie (different types of drops in the serie level) and fix in themselves whether a change has occurred on such and such a date or not.
I want to take advantage of these heuristics and so, to learn how to predict the occurrence of targeted events.
Three metrics are of interest: forecast accuracy, forecast completeness (recall), and forecast of interval between heuristics date and target event (for example, that a target event will occur n days after a set of heuristics is triggered).
For each date, I can calculate how many target events will occur on the test sample after each of the heuristics is triggered for n days.  By this calculation, I want to evaluate the usefulness of each of the heuristics.
But there are several questions:

How to relate the triggering of the heuristic on date n with the desired event, and for example, not with the next one?  This is necessary to assess that the accuracy of the heuristics.

is it possible to somehow generalize the triggering of heuristics to predict the occurrence of a target event exactly after the calculated number of days?

maybe there is some way to predict the class of the event in n days (whether it will be target or not) or the probability that it will be target.  This is necessary in order to ultimately generalize the triggering of heuristics and additional known time series features.


texts:
How does iZotope RX handle the FFT (i.e. how does it manage to perform those processes in the frequency domain without creating glitches) since its able to e.g.

Apply another DSP process (even time-domain) into a spectral part (i.e. apply e.g. a phaser onto individual parts of the FFT).
Attenuate or gain spectral    parts (without touching the surrounding parts).

Is it really frequency domain filtering or time domain using time domain filters?

I thought this kind of processing was impossible: Why is it a bad idea to filter by zeroing out FFT bins?


texts: what doest "hit or miss" in morphology do?

texts: I searched for hit or miss on the internet and Gonzalez's book but there is just a formula and example. In that example the hit or miss just finds a pixel and no more answers. I want to know by concept what is use and purpose of hit or miss transform.


texts: python scipy fft on numpy hanning window smears peaks

texts:
I have a signal that I have acquired from an experimental instrument, that I wish to examine in the frequency domain.  I don't care about phase for this exercise, I only care about magnitude.  I deliberately planned my experiment so that the dominant frequency would fall completely within a single fft bin.  when I use the scipy fft function on an unfiltered window, the fft shows a clean spike as expected.  However, when I first apply a numpy.hanning window, the spikes become smeared.
Note the mean of the signal (the zero bin) also shows the same smearing effect.
My code is as follows:

eta=[instrument data series of length 2048]
etaHann=np.hanning(nfft)*eta
EtaSpectrum=abs(sp.fft(eta))
EtaSpectrum=EtaSpectrum*2/nfft # convert to amplitude
EtaSpectrumHann=abs(sp.fft(etaHann))
EtaSpectrumHann=EtaSpectrumHann*2*2/nfft # also correct for Hann filter
frequencies=np.linspace(0,samplingFrequency,nfft)
plt.plot(frequencies[0:200],EtaSpectrumHann[0:200],'b.-',label='Hann filtered')
plt.plot(frequencies[0:200],EtaSpectrum[0:200],'c.-',label='rectangular')
plt.xlim(-0.01,2)
plt.xlabel('frequency')
plt.ylabel('amplitude')
plt.grid()
plt.legend(loc=0)
plt.show()

Plotted outputs below:

Is this meant to happen?  Does anyone else get this problem?  For my data, it seems a rectangular window is fine, but to me it seems that the Hanning window must be wrong here, as the integral of the entire spectrum should be the same (after I multiplied by 2 to correct amplitude), but in this case it seems to be different.


texts: Why doesn't the mel-scale use the twelth-root of 2 instead of a biased sample listener?

texts:
For the mel frequency spectrum, which is used extensively in audio-processing, the technique uses subjects to identify pitches of uniform distance from one another. Isn't this distance just the 12-th root of two in the regular frequency scale. why must we incorporate subjective listening?

thanks
a.s.


texts:
I know that generally the impulse response of a system is the output when input is an impulse. It is also the differentiation of a step response. So if we have a system described by thi differential equation:
$$\frac{d^2 y(t)}{dt^2}+5\frac{\text{d}y(t)}{\text{d}t}
+6y(t)=-\frac{\text{d}x(t)}{\text{d}t}$$
where $x(t)$ is the input, $y(t)$ is the output, how do I find the impulse response?

My first idea was to let $x(t)$ be a ramp function so that it's derivative would be a step function then I could easily solve the differential equation and differentiate what I got to get the step response then differentiate it again to get the impulse response. But now I'm doubting this path as the ramp function is not a bounded function so the response might be unstable. I'm not sure how to approach this.


texts:
I have created a frequency domain image filter and would like to test it against some images where it is known that the frequencies only occur within a given band. Trouble is, I don't know how to go about creating such images.

I have though about making an image that consists of intensities varying about the x and y axes as a function of sine waves of frequencies within the band. I don't know if this would be good enough though. Another method (don't know about the practicality of this) might be to define a matrix in the Fourier domain and then do an iDFT. Does anyone have any thoughts on the best way to proceed?


texts: How do I determine if a discrete signal is periodic or not?

texts:
I want to know how I can determine whether a series of data is periodic or not.

I want to use Fourier transform/series. My data looks either aperiodic

  [111100001111000110010101010000101]

or periodic

  [11001100110011001100]

and I need to decide which it is automatically. What types of analyses or calculations can I perform to determine if a signal is periodic or not?


texts: Applying a Filter Kernel Defined by a Continuous Equation in the Frequency Domain

texts:
I have a filter kernel $K(\omega)$ completely defined in the frequency domain as a continuous function of angular frequency $\omega$. I know $K(\omega)$ defined as a continuous mathematical equation.

Using the discrete FFT and IFFT, I would like to apply this kernel to a discrete time-domain signal using convolution via multiplication in the frequency domain.

What is a good way to deal with this convolution?  Should I generate the $U(\omega)$ as a continuous function in the frequency domain, take the IFFT, and then truncate, shift and window the signal as mentioned in the book Steven W. Smith - The Scientist and Engineer's Guide to Digital Signal Processing?

Alternately, should I take the continuous inverse Fourier transform of the function $K(\omega)$, and generate $k(t)$ completely in the time domain as a discrete signal by evaluating $k(t)$ for discrete values of $t$?  Then $k(t)$ can be treated as a FIR filter kernel and taken into the frequency domain.

Although this is a discrete 1D signal, are 2D image filtering kernels generated in the frequency or spatial domains?  What is the difference between the application of the kernels in the time and frequency domains?


texts: Kalman Filter - Optimal Way to Handle "Derived" Measurements?

texts:
Ie, if you have as state variables position (p) and velocity (v), and I make low-frequency measurements of p, this also indirectly gives me information about v (since it's the derivative of p). What is the best way to to handle such a relationship?

A) At the update step, should I only say I've measured p, and rely on the filtering process, and my accumulated state-covariance matrix (P), to correct v?

B) Should I create an "extra" prediction step, either after or before my update step for the measurement of p, that uses my measured p and (relatively large) delta-time to make a high-variance prediction of v?

C) In my update/measurement step, should I say I've made a measurement of both p and
v, and then somehow encode information about their interdependence into the measurement co-variance matrix (R)?

For a little more background, here's the specific situation in which I've run into the problem:

I'm working with a system where I want to estimate the position (p) of an object, and I make frequent measurements of acceleration (a) and infrequent, high-noise measurements of p.

I'm currently working with a codebase that does this with an Extended Kalman Filter, where it keeps as state variables p and v. It runs a "prediction" step after every acceleration measurement, in which it uses the measured a and delta-time to integrate and predict new p and v.  It then runs an "update"/"measurement" step for every (infrequent) p measurement.

The problem is this - I get occasional high-error measurements of a, which result in highly-erroneous v.  Obviously, further measurements of a will never correct this, but measurements of p should get rid of this.  And, in fact, this does seem to happen... but VERY slowly.

I was thinking that this may be partially because the only way p affects v in this system is through the covariance matrix P - ie, method A) from above - which seems fairly indirect.  I was wondering if there would be a better way to incorporate our knowledge of this relationship between p and v into the model, so that measurements of p would correct v faster.

Thanks!


texts:
I don't quite get the difference between RMS and a moving RMS.
When one calculates RMS, one integrates (or sums in case of a discrete signal) over a period of time(number of samples).
When it comes to a moving RMS, I don't quite get the idea why one would use a moving RMS?
One last question is what is the difference between a "normal" RMS and a moving RMS with a windows that has an infinite size?


texts: Matlab - Creating a characteristic for Peak and Shelving filter

texts:
I have designed few shelving and peak filter. And I have calculated the a, b coeficients for several gains for these filters. Now I would like to create some kind of characteristic in Matlab so I could present my design of these filters?

Something like this for shelving filter


texts: How unauthorized access is prevented in biometric identification systems

texts:
biometric access control is a rapidly maturing technology that is used to police our ability to gain access to places, allow us access to software and hardware as well as guard against unauthorized access.
If the number of people allowed to access a certain a place is for, example, 100. Training samples from the 100 persons are used to construct the stored database. Features are extracted from these training samples, and are stored in the system database. K-nearest classifier can be used in the test stage to identify the person, by selecting the person with the minimum distance between the test features and the stored features.
I can understand that this identification process will correctly identify the person if he is actually one of the 100 persons allowed to enter the place. I can not understand how the system will prevent unauthorized access. If the person is not one of the 100 persons allowed, of course the system will identify him as the one with the closest distance to the features stored in the database.


texts: Channel encoding after digital modulation

texts:
Generally, when using channel encoding followed by interleaving, that process should be performed before the modulator and the system structure should be like that :

For me, I only use the conventional encoder for channel coding and then interleaving, but I am wondering, is it possible to use the channel encoder after the digital modulation (I use for example QPSK) ?? .. however the signal after the  digital modulation is not binary anymore, but I don't know if that still possible to use the channel encoder and interleaver after  digital modulation or not.


texts: When to use Rician fading vs Gain for Directional Antenna

texts:
This is a pretty simple question. [The answer might not be simple :( ]

If I am using a directional antenna, can I used Antenna gain $G_T=1$ as I am considering Rician Fading between transmitter and receiver?

On the contrary, if I am using $G_T>1$, then do I use Rayleigh fading instead of Rician?

Explanations of System Model:

The antenna is mounted under the roof-top in an indoor environment. (e.g. indoor stadiums, warehouses, office building/rooms etc.). The Antenna is directed towards the ground, so that the signal-loss in unwanted direction is minimized, (unlike isotropic antenna where energy is radiated in $360^o$).


texts: Magnitude value of filter frequency response

texts:
Can someone help me with this problem:

Suppose we filter signals with the below pre-emphasis filter:

$$y[n]=x[n]-0.8x[n-1]$$

I have to calculate the impulse response of the filter (ok easy) and then I have to find the magnitude of Frequency Response (dB) at $F = 2000 Hz$ with $Fs = 16000 Hz$

Can someone tell me the formula? I am confused :(

Thanks


texts: Why make the phase of an FIR filter linear?

texts: I am new to DSP and filter design. It is easy to design an FIR filter with linear phase by making the coefficient sequence symmetric. However, why make the phase linear?


texts: Matlab FIR filter numerator coefficients to python

texts:
I created a equiripple FIR filter in Matlab using filterDesigner and exported it to an ASCII file. The file contains the numerator values as a list of 51 numbers tagged under Numerator: (this is all the data the file has)
Now I read this 51 values into a python array named num and try to recreate the filter in python using scipy.signal.lfilter
from scipy import signal

x_filt = signal.lfilter(num, np.ones_like(num), x)  # x is my input signal

This is my original signal

Here's the filtered signal from Matlab (Fpass-800Hz, Fstop-1200Hz)

But this is what I get from the python code using scipy.signal.lfilter

Can somebody please show me what I am doing wrong here?

EDIT: (After getting the answer) Here's the correct python code
x_filt = signal.lfilter(num, 1, x)


texts: Zero peaks in fft data even after subtracting mean

texts:
I have a time series sensor data. It is for a period of 24 hours sampled every minute (so in total 1440 data points per day). I did a fft on this to see what are the dominant frequencies. But what I got is a very noisy fft and a strong peak at zero.
1. I have already subtracted the mean to remove for the DC component at bin 0. But I still get a strong peak at zero. I'm not able to figure what could be the other reason or what should I try next to remove this.
2. The graph is very different from I have usually seen online as I was learning about fft. In the sense, I'm not able to see dominant peaks like how it is usually seen. Is my fft wrong? Attaching code that i tried and images:

import numpy as np
from matplotlib import pyplot as plt
from scipy.fftpack import fft,fftfreq
x=np.linspace(29,32,1440).tolist()
x=np.array(x)
x=x-x.mean()
N = 1440
# sample spacing
T = 1.0 / 60
yf = fft(x)
yf_abs = abs(yf).tolist()
plt.plot(abs(yf))
plt.show()
freqs = fftfreq(len(x), 60)
plt.plot(freqs,yf_abs)
plt.show()

Since I'm new to this, I'm not able to figure out where I'm wrong or interpret the results. Any help will be appreciated. Thanks! :)


texts: Applying zero-phase filtering in the frequency domain - also works in real-time?

texts:
In my application a filtering in the frequency space is desired. I designed two high-pass filters: $h_1$  Butterworth IIR filter, and $h_2$ FIR. I designed them using Python's SciPy functions.
Using signal.freqz I obtained the frequency response $H_1(k)$ and $H_2(k)$.
I now want to filter signal in a real-time, buffer-wise. I read buffers of certain size, say $N=2048$, and do a DFT and obtain $F(k)$. I then want to multiply the Fourier coefficient with the two filters frequency response: $G_i(k) = F(K) H_i(k)$ for $i=1,2$. Then I do inverse DFT to get the filtered signal.
(Remark: in practice I use overlap/add in the buffering, and so recovering back the filtered signal in time domain requires windowing and is more complicated.)
Now for the questions:
Multiplying $F(k)$ by $|H_1(k)|$ seems to work, even in real-time. But multiplying by the absolute value is like performing zero-phase filtering, which by theory is non-causal. However, since I apply it buffer-wise, this seems to be the loophole. Am I correct?
I also filtered using $F(k) H_2(K)$ and in Python it works just fine. However, giving the list of coefficient $\{ H_2(k) \in \mathbb{C} \mid k=0,...,N/2 \}$ for a colleague, for her to filter in another application/software, the filtering didn't seem to work. The filtered signal was a total mess (the unfiltered signal is a short speech by a woman). I verified with her that she applied the filter with the "mirror conjugate" completion so $\tilde{H}_2 = (H_2(k), \overline{H_2(N/2+1-k)}) \in \mathbb{C}^N$. Is there a theoretical reason for it not to work? (so we can narrow the reason to a bug in her code)


texts: How is the energy of $x_1\cdot x_2$ related to the energies of $x_1$ and $x_2$?

texts:
Let's say
first signal x1 = [1 2 3 4],
second signal x2 = [0.08 0.77 0.77 0.08] (Hamming window),
third signal x3 = x1.*x2 = [0.08 1.54 2.31 0.32].

Energy of x1: E1=30,
energy of x2: E2=1.1986,
energy of x3: E3=7.8165.

What is energy relation between x1,x2 and x3?


texts: Determining false positives in feature matching

texts:
I extracted features from an image using SIFT and SURF. Then I applied few transforms on the image and again calculated the features. While matching the features, I noticed that there are some erroneous matches. For example, if using image of a face, some points on face are matched with points not on face in the transformed image.

Is there a way to detect those false positives ?


texts: Finding the Period of a Signal by Its DTFT Data

texts: find period of DTFTs where vertical lines represent Dirac deltas


texts: Impulse response rest conditions of LTI systems

texts: Why the impulse response (initial) rest conditions are taken like $h(t)=0$ and $h'(t) =1$, if the order of differential equation is $2$.


texts: How do they produce an impedance/phase plot for a speaker with a chirp that lasts 1 sec?

texts:
Commercial software is available that sweeps a speaker in about 1 second and produces impedance/phase plot from 1 Hz to 20 kHz.
How do they do it? Obviously not by a single tone sweep over the full range.
So it must be a clever waveform that is frequency-stepped over some range while doing a DFT for each step. But what is this waveform? Or is there another way?
I can hear the sweep in the speaker and it is not an impulse 'click' but more of a chirp that only lasts 1 sec.

I need to build one for another purpose.

Thanks for any insights


texts: Why the energy is a good feature extraction for detect disturbances in signal processing?

texts:
To detect disturbances in signal processing a common step is to extract signal characteristics to analyze them, among these characteristics it is recommended to use the signal energy.
Why energy is recommended over other features that can be extracted, such as statistical parameters of the signal or frequency components?


texts: MATLAB code to evaluate audio loundness over time

texts:
can anyone tell me how to evaluate the loudness/intensity over time using MATLAB? By loudness/intensity over time I mean this:
In the images above, the "black" one on the top is a sound's amplitude over time, and the green line is the corresponding loudness/intensity over time. The green line underneath, which is what I want, is generated using Praat.
Can any one tell me, that given a sound input, how can I generate the corresponding loudness/intensity over time using MATLAB?
For example, given a input, I can generate the upper one using this MATLAB script:
[x,fs] = audioread('soundfile.wav');
t = (0:length(x)-1)/fs;
subplot(211);
plot(t,x);

How can I generate the green line then? Thanks.
(ps. Any other programming languages other than MATLAB is welcome as well)


texts:
I'm designing a QC-LDPC decoder in VHDL. It uses a layered decoding method - only a single block row of parity equations is evaluated each iteration (the bit values are still updated every iteration). Bit values are stored as log-likelihoods with the sign representing the respective bit symbol.

A valid codeword is indicated by all parity equations being satisfied. I only ever evaluate a single block row of parity equations. What I want to know is how much information I need to gather to be certain that the current bit values represent a valid codeword.

Is it enough that each parity equation in $N_b$ successive rows was satisfied, where $N_b$ is the total number of block rows. To my mind that is not enough - bit values can change signs even when every equation is satisfied? Or am I wrong here? If true this might invalidate previously correct block rows.

If this is true, then I can only guarantee a codeword is correct by ensuring that for $N_b$ successive rows, all parity equations were satisfied and that no bits changed sign.

Am I missing something simple? Or is this the way I need to go about this?


texts:
Making static 3D image is very simple - we just take image pair with something like this:

then we can see 3D image by putting the left and right eye image side by side and crossing eyes or overlapping the images and using color filters for each eye. So far so good.

VR headsets (e.g. Oculus Rift) now allows seeing the 3D image directly.

However, I would like to incorporate slight movements and tilting of the head. Of course, this would immediately spoil the 3D effect.

First idea for better capture is using more cameras (e.g. 2x2 or 3x3 array) to acquire necessary viewpoints (e.g. top and bottom camera is necessary to reconstruct 3D when viewed with head leaned on one side). But how to interpolate between these views based on shifted and rotated head pose? Is depth/3D reconstruction necessary or are there any computational photography techniques to generate appropriate left/right eye images (for a given viewpoint/pose)?

I found various articles regarding depth reconstruction, 3D reconstruction and light fields, but nothing leads me toward the goal of interpolating the views.

Ultimately, I am planning to create a panorama viewer for VR glasses (something like krpano's web viewer supporting Oculus Rift). However, the viewer can account for limited head movements (pan, tilt) and the 3D impression does not hold for leaning, slight head shifts and correct for different eye-to-eye distance.

Any pointing to appropriate articles will be appreciated, thanks!


texts: what is the difference among noise,blurring and contrast?

texts:
I want to know the following
what is the difference among noise,blurring and contrast ?


texts: Filter design for decimation of 1.1 kHz sensor sample rate to 100 Hz processing rate

texts:
Suppose, you have a signal source which is sampled by 1100 Hz and is "somehow" band limited to either 235 or 440 Hz. In my application, that's the ST IIS3DHHC accelerometer. There is an appnote for that sensor, showing some more details about the internal filtering:

It's just stating, that there are two filter implementations, FIR and IIR with different settling times (I assume, that's the group delay).

I'm wondering now, how to create an optimal filtering chain. The actual requirements are:

0.01% ripple in passband (that might be tight and could be relaxed to 0.02%)
downsample by R = 11 to 100 Hz for further processing -> anti-aliasing to max 50 Hz
group delay of 100 Hz signal shall be around 10-20 ms to not introduce significant delay in the decimation phase
not sure about the stopband attenuation. Ideally, 0.01% too, but that would be 80 dB, sounds a bit strong

The samples are pulled from the sensor's fifo buffer which is filled with 1.1 kHz and can further be processed.

So I'll have to design one or multiple filter stages to first reduce the bandwidth to max 50 Hz (I guess, 45 or even 40 Hz because of non-ideal lowpass filters).

Here are the questions:

Is it beneficial in some way that the signals already are band-limited by the sensor itself? It's a sensor parameter to be set to get an 235 Hz or 440 Hz signal. Since I need 50 Hz cutoff anyway
Filter design

FIR or IIR filter for this kind of application? I'm aware that some FIR implementations are beneficial because many coefficients are 0. I know that FIR filters usually have linear phase and therefore constant grp delay.
Do I need linear phase?
What happens to the distorted signals in the transition band, can I fix them somehow?
Since in a FIR design R-1 samples are discarded, could I use them in a beneficial way? At the moment, "local averages" are calculated, i.e. all 10 ms, all 10-11 available samples from the fifo are pulled and averaged. This is not a moving average afaik. I would like to get away from that filter, because I can't estimate the frequency response and therefore use a "proper" filter design. Do I really have to just throw the samples away?
If more cascaded filter stages are recommended, which order (in case of IIR) or how many taps (FIR) should be used, are there general recommendations or is it application dependent?

I can design various filter types here with Matlab. But the architecture is not clear.

Thank you all very much!


texts: Why a DFT of two sinusoids is very noisy even with frequency sampling 5 times higher?

texts:
I've set up this case to try to understand DFT implementing a real case in Excel

Frame Size $\;\color{blue}{(T = 5 \; s})$
Time Sampling $\;\color{blue}{(T_S = 0.1 \; s})$
Block Size $\;\color{blue}{(N = T/T_S = 50)}\;$  (It was 51 in my question)
Sampling Rate  $\;\color{blue}{(F_S = T/T_S+1 =10 Hz}$
Frequency Resolution $\;\color{blue}{(F_R = F_S/N = 0.2 Hz)}$

In time spectrum I have put just the sum of 2 sin functions

The first sine  has amplitude $\color{blue}{10}$, phase $ \color{blue}{\pi/3}$ and frequency  $\color{blue}{2}$ Hz.
The second sine  has amplitude $\color{blue}{5}$, phase $\color{blue}{0}$ and frequency $\color{blue}{1}$ Hz and for $ \color{blue}{\; n = 0\; to\; 49 \;}$ we have :

$$ \color{blue}{x_n = 10\, \sin{(2\pi t 2 + \pi/3)}+ 5\, \sin{(2\pi t 1)}}$$

So I have generated DFT values where $\color{blue}{\; k=-25\; to\; 24\, }$   :

$$\color{blue}{\quad X_k=a_k + ib_k}\;$$

$$\color{blue}{a_k = (1/N) \; \Sigma_{n=0,N-1} x_n \cos{(2 \pi n k /N)}} $$
$$\color{blue}{b_k = (1/N) \; \Sigma_{n=0,N-1} x_n \sin{(2 \pi n k /N)}} $$

After, I've calculated module $\color{blue}{A}$ and phase $\color{blue}{\Phi}$ for $ \color{blue}{\;  k = -25\; to \;24\,}$:

$$\color{blue}{A_k = |X_k| = \sqrt{(a_k)^2  + (b_k)^2}} $$
$$\color{blue}{\Phi_k = atan2(b_k, a_k)} $$

I consider in my analysis for $ \color{blue}{\;  k = -25\; to \;24\,}$:
$$\color{blue}{ Freq_k = k.F_S/N} $$

Old text: Now my doubt arise. In my understanding, the signal is concentrated in the values of frequencies $\color{blue}{-1}$ Hz, $\color{blue}{-2}$ Hz, $\color{blue}{1}$ Hz  and $\color{blue}{2}$ Hz. The negative frequencies I disregard, of course. However, in short, the frequency spectrum is noisy. For instance, $\color{blue}{2.2}$ Hz amplitude is around $\color{blue}{25%}$ of $\color{blue}{2}$ Hz amplitude. Is it normal? What's happening?

New text As Fat32 has showed me, I was using an additional and spurious point ($\color{blue}{51}$ in total) in my time sample that was distorting the whole calculation. If I use a specific time frame ($\color{blue}{5\;s}$ in this case), I need to suppress the final time point (time = $\color{blue}{5\;s}$)

$$\star\star\star$$

I'm working with frequency sampling $\color{blue}{10}$ Hz,  five times than maximum detected frequency ($\color{blue}{2}$ Hz).

To check if I had made a mistake, I had calculated the inverse DTF.

Old text:  The original signal was restored well, where $\color{blue}{\;n=0\; to\; 50}\;$ and imaginary part $\;\color{blue}{\sim 0}\;$.

New text:  The original signal was restored with no flaws, where $\color{blue}{\;n=0\; to\; 49}\;$ and imaginary part $\;\color{blue}{= 0}\;$.
The only positive frequences other than $\color{blue}{0}\;$ is $\color{blue}{1\;hz}\;$ and $\color{blue}{2\;hz}\;$ , respectively with value $\color{blue}{125}\;$ and $\color{blue}{250}\;$, $\color{blue}{25}\;$ times bigger than the real amplitude. I guess that the factor is $\color{blue}{25}\;$ because is the half the samples ($\color{blue}{N=50}\;$).

$$\star\star\star$$

$$\color{blue}{ Re(x_n) =(1/N)\Sigma_{k=-N/2,N/2-1}A_k \cos{\Phi_k} \cos{(2 \pi k n/N)} - A_k \sin{\Phi_k} \sin{(2 \pi k n/N)}}$$

$$\color{blue}{ Im(x_n) = -(1/N)\Sigma_{k=-N/2,N/2-1}A_k \sin{\Phi_k} \cos{(2 \pi k n /N)} + A_k \cos{\Phi_k}\sin{(2 \pi k n /N)}}$$

The 50 time data (it was 51 time date before the answer) is available from this link

The $\color{blue}{50}$ transformed data(Re(z), Im(z), |z|, $\Phi$(z))
(it was $\color{blue}{51}$ time date before the answer) is available from this link


texts:
i recorded a tone between two  devices and applied cross correlation on the recorded and the sent signals.
I want to know if there is a multipath effect on my result (on MATLAB). what can i use for that?


texts: EQ - Calculate the power per Octave of a signal through FFT

texts:
I'm working on a audio Equalizer, and I'm not sure if the way I obtain the power per octave of my signal is good.

Here is the code I have :
(I use the third octave bands, which is initialized earlier in the program)

void    Record::ProcessData(short* Buffer, size_t BufferSize)
{
    /* BufferSize is usualy equal to 131072 */
    /* Initialize the signal and the Hanning Window */
    Aquila::SignalSource signal = Aquila::SignalSource(Buffer, BufferSize, 44100);
    Aquila::HannWindow HannWindow(BufferSize);

    /* FFT */
    /* The library overload the + operator, so the signal is multiplied with the window */
    auto fft = Aquila::FftFactory::getFft(BufferSize);
    Aquila::SpectrumType spectrum = fft->fft((signal + HannWindow).toArray());

    /* Set the imaginary part to 0 */
    for (size_t i = 0; i < BufferSize; i++)
        spectrum[i]._Val[1] = 0;

    /* OctaveRange is a class with the minimum, center and maximum frequency of an octave band */
    list<OctaveRange>::iterator it;
    map<double, double> sumMap;
    double db, f, key;

    /* Initialize the map values to 0 */
    for (it = thirdOctave.begin(); it != thirdOctave.end(); it++)
        sumMap[(*it).getCtr()] = 0.0;

    /* The calcul of the power per octave starts from here */
    for (size_t i = 0; i < (BufferSize / 2); i++)
    {
        /* f = frequency at bin i */
        f = (double(i * 44100) / BufferSize);
        for (it = thirdOctave.begin(); it != thirdOctave.end(); it++)
        {
            key = (*it).getCtr();
            if (f >= (*it).getMin() && f < (*it).getMax())
                sumMap[key] += pow(spectrum[i].real(), 2) + pow(spectrum[i].imag(), 2);
        }
    }

    for (it = thirdOctave.begin(); it != thirdOctave.end(); it++)
    {
        key = (*it).getCtr();
        /* db is the power (in dB) per third octave. */
        db = 20.0 * std::log10(sqrt(sumMap[key]);
    }
}

When I record pink noise with this I obtain some believable values, but I'm still not sure if this is because the code is good, or if it's a happy coincidence.

So my question is simple :
Is this the good way to obtain the power per octave band of a signal ?

Feel free to ask if something is not clear enough.
Thanks for your time.


texts: Is digitization of discrete valued signal necessary for it to be processed?

texts:
While reading the book DSP by Proakis and Manolakis i came across the concept of digitization of signals. The Author states that Digitization(rounding  it off to nearest integer) of signal is necessary in order for it to be processed by computer. If i write the following code :-

float signal[5]={ 1.5 , 1 , 4.4 , 3 , 2 , 3 };
for(int i=0;i<5;i++){
    signal[i]*=2;
}

However, In this above code I am able to process the signal without rounding it off to the nearest integer. Please help me clear my doubt.


texts: Find Discrete Fourier transform given the inverse

texts:
I don't know if this question is already answered somewhere else but I'm stuck with that and I need help...

Given an inverse Discrete Fourier Transform (IDFT), with N=16 :

How can I find the F(k) that represent the Discrete Fourier Transform (DTF)?
$$
F(k) = \sum_{n=0}^{N-1} f(n) e^{-i2\pi \frac{kn}{N}}
$$

And how the plot of F(k) will be?

EDIT: for now this is my result but I have no idea if it's correct:

EDIT 2: plus I don't know how to plot the equation since it contains the imaginary number (j in the figure)...


texts: Amplitude problem by puting 5 FIR in a row

texts:
I'm trying to use 5 FIR in a row to improve the S/N ratio on my signal, but I have some difficulties doing it.

In fact I have 2 signals, let's call them sig_I and sig_Q. I want to apply my 5 filter to them, and after that get the value PdB = 10*log( sqrt( sig_I² + sig_Q²) )

In order to do that the coefficients of the 4 first filters are given to me, and I have to be able to change the BW of the fifth one. It can be either 11 MHz or 60 MHz, but always with 32 coefficients.

At the end of this, I have an amplitude value, but my professor keeps telling me the amplitude is false, and that I should have about 7dB difference between the 2 cases (10*log(60/11) = 7.3 dB), but I can't find that.

A code example for that would be (on matlab) :

%Filter coefficients
b1 = [1 3 3 1]/8;
b2 = [1 3 3 1]/8;
b3 = [ 1 4 6 4 1]/16;
b4 = [ 1 5 10 10 5 1 ]/32;

fe = 2.4e9
bwFir = 5.5e6; % Can be 5.5e6 or 30e6
Wn = 2*bwFir/fe;
b5= fir1(32,Wn);

%convoluate signals with FIR
sig_I = conv(sig_I,b1);
sig_I = conv(sig_I,b2);
sig_I = conv(sig_I,b3);
sig_I = conv(sig_I,b4);
sig_I = conv(sig_I,b5);

sig_Q = conv(sig_Q,b1);
sig_Q = conv(sig_Q,b2);
sig_Q = conv(sig_Q,b3);
sig_Q = conv(sig_Q,b4);
sig_Q = conv(sig_Q,b5);

mod = 10.*log10(sqrt(I.*I + Q.*Q));

plot(mod);

But for me the value of "mod" is kinda the same with 11 or 60 MHz. Am I doing something wrong?


texts: How to write the program to compare two audio files

texts:
I want to make the program which would take one file and check the similarity with other. It would be music/melody file, and the program would ignore small deviations between two of them similarly to Shazam and other music recognition software.
I worked with C, C++, C# and Python but I have no experience in signal processing and I don't know which programming language is suitable for this task. I've search the Internet for the solution but couldn't find it.
If anyone has some experience with this, I would appreciate any help.


texts:
I have a function :
\begin{equation}
C(t)=\left(1.42*\exp^{-1.192t}- 12.44*\exp^{-1.192t} +11.02 \right) u(t)
\end{equation}
where u(t) is a unit-step function
What is its fourier transform? a step by step breakdown would greatly be appreciated: notably how would you manage the fact that it is a summation, would the linearity of a fourier property apply? How would you compute the power and the phase of the sum?


texts: Jumping from DSP concepts to practice...recommend books?

texts:
I have fairly good understanding of DSP theory and algorithm design (and also MATLAB and C). What are the best books or what other advice could be given for learning how to actually implement DSP algorithms i.e. DSP programming (e.g. fixed-point/floating-point considerations etc.)

I have also considered getting a DSP evaluation board for learning purposes but am lost as to which one to get, any advice?


texts: Odd-order Butterworth filter gain at cutoff frequency

texts:
Wikipedia gives the gain of an n-order Butterworth filter as

$$G^2(\omega)=\left |H(j\omega)\right|^2 = \frac {{G_0}^2}{1+\left(\frac{j\omega}{\omega_c}\right)^{2n}}$$

here. If you look at the gain at the cutoff frequency, the denominator becomes $(1+j^{2n})$, which blows up to infinity for odd $n$. Am I doing something wrong? Are Butterworth filters, or that formula, restricted to even $n$?


texts: What Is Proper Paper and MATLAB Toolbox Describing and Discussing Wavelet, Ridgelet, Curvelet and Contourlet Transforms in Detail?

texts:
Question 1:

Does anybody know any paper proper for getting started understanding the concept of Wavelet, Ridgelet, Curvelet and Contourlet transforms and their differences in detail?

Question 2:

does anybody know a MATLAB toolbox for implementation of these transforms?


texts: concurrent multiple sound sources seperation for TDoA estimation

texts:
consider a room with some sound resources and several mics, these sound resources almost concurrently emit sound signals. As for one mic, it may pick up sound signals from different sound sources which are overlapped.

I am just asking for a brief idea of the separation of these overlapped sound signals for the further process such as TDoA estimation.
I have no idea which is the current mainstream technology to deal with this kind of problem?
I was thinking about the acoustic signal's encoding or modulation so mics can identify which signal from which sound source.

Thank you in advance

Following your idea, I tried 2 chirp signals with frequency division in Matlab, then use band filter+cross correlation algorithm, the result is quiet promising.

So instead of the chirp signal, did you just use sine wave signal(tone)?


texts: Feedforward disturbance signal compensation

texts:
The reference Feedforward control concepts through Interactive Tools says, to minimise the effect of the disturbance $d$ on the process output $y$, a compensator $G_{\text{ff}}=P_3/P_1$ shall be used. From a theory point of view, no problem. Even a few simple examples behave as expected.

Encouraged by that, I decided to implement three-phase inverter control in $dq$ reference frame. Inverter model is represented by LC filter equations:
$$
\text{L} \frac{\operatorname{d}}{\operatorname{d}t}
\begin{bmatrix}
i_\text{d} \\
i_\text{q} \\
\end{bmatrix} =
\begin{bmatrix}
v_\text{dn} \\
v_\text{qn} \\
\end{bmatrix} -
\begin{bmatrix}
v_{\text{d load}} \\
v_{\text{q load}} \\
\end{bmatrix} + \text{L} \omega
\begin{bmatrix}
i_\text{q} \\
-i_\text{d} \\
\end{bmatrix}
$$
$$
\text{C} \frac{\operatorname{d}}{\operatorname{d}t}
\begin{bmatrix}
v_\text{d load} \\
v_\text{q load} \\
\end{bmatrix} =
\begin{bmatrix}
i_\text{d} \\
i_\text{q} \\
\end{bmatrix} -
\begin{bmatrix}
i_{\text{d load}} \\
i_{\text{q load}} \\
\end{bmatrix} + \text{C} \omega
\begin{bmatrix}
v_\text{q load} \\
-v_\text{d load} \\
\end{bmatrix}
$$
From there, I derive plant model and control structure in $dq$ reference frame (only $d$ frame is shown):

In this case disturbance  $i_{\text{d load}}$ is fed directly to the plant model. i.e. $P_3=1$. Open-loop inner loop equation is:
$$
G_\text{co}(s) = \underbrace{K_\text{P} \left( 1 + \frac{1}{s T_\text{I}} \right)} _\text{PI controller} \underbrace{ \left(\frac{1}{s \text{L}}\right) } _{\text{Process}}
$$
and closed loop ($P_1$) is
$$
G_\text{cc}(s) = \frac{G_\text{co}(s)}{1 + G_\text{co}(s)} = ... = \frac{s T_\text{I}+1}{s^2 \text{L} T_\text{I}/K_\text{P} + s T_\text{I} + 1}
$$
Compensator transfer fucntion is $G_{\text{ff}}=1/G_\text{cc}(s)$ and numerator is a higher order than the denominator.

I cannot implement this transfer function in MATLAB Simulink. Is there a way forward?
I don't see any issues with the method! Is this the right approach? Articles deal little with feed-forward signal or cross-coupling compensation.
When I make $P_3$ equal to $P_1$, i.e. $G_{\text{ff}}=1$, the disturbance is eliminated. In other cases, there is a huge overshoot for step disturbance. It eventually stabilises.
I also have to compensate the cross-coupling element $\omega\text{C}v_{\text{q load}}$ using the same compensator?
In the real system (e.g. DSP), I will implement only the control part in $dq$ frame. Do I need to add compensators to load current and cross-coupling signals? Also, the plant's transfer function will be different and unknown. How to determine compensator there or leave it at 1 and only tune PI controller to get the desired response.


texts: Interpreting dataset of a power spectrum

texts:
I am currently working with kaldi, and are trying to make spectrogram plots of different audio files. Kaldi is a speech recognition toolkit.

Kaldi frames its input in frames of 25 ms with a hop_length of 10 ms.

Kaldi have some code that makes spectograms of an audio files, but not much information is given on how things are stored...
The sample rate used for the audio files is 16 KHz.

An example of dataset could be fash-b-an251:

which is an audio file of duration 1 sec.
the matrix has 98 rows, and 257 columns.

Plotted:

A different dataset could be fash-b-an253

which is an audio file of duration duration: 0.70s
The matrix has 69 rows and 257 columns.
Plotted:

257 must be the size of the fft length, since it is consistent.
What is the rows - how it is related to the length of the audio file.
And can the length of audio file be determined using number of rows(Probably), and if,then how?..

I am also a bit unsure about the unit of the values in the plots..
Is is a log power spectrum, or just a power spectrum?

Spectogram of the First audio file with matlab:

So the unit are not the same, what is it stored as??


texts:
I have a periodical function $f(x)$ that is sampled in time, at a rate of 1 millisecond.

Together with this, I also have a second function $t(x)$.

I want to find the correlations between periods of the first function and the second function $t(x)$.

How can I approach this issue?


texts: identify a specific table in document image

texts:
I have some images of answered tests. I am working on recognizing the answers for the multiple choice questions on each test. A example:

I think the problem can be separate into two sub-problems:
    1.) Identify and segment the multiple choice answers from the rest of the test.  2.) Classify and recognize the answer as one of the letters in A, B, C, D, E.

For the second sub-problem, there exists libraries like Tesseract, also I can train a neural network to identify among the five letters which is not hard.

However, I am not sure how to approach the first sub-problem. The most important part in identifying the multiple choice answers would be identifying the region that contain the multiple choice answers (the red box region in the example). Since multiple choices answers are typically written in a table that has two rows and number_of_questions + 1 columns. My first step is to identify this table in the image.

What's the best way to identify such table? I am currently thinking about training a neural network to identify the table. Should I use template matching or other methods instead? Which one is better?


texts: Using K-Space Filtering to Filter by Speed

texts:
I want to read waves with an electret consender microphone that are slower than the speed of sound, and I figure it would make those waves easier to identify if I could process out all waves moving around the speed of sound (give or take maybe 20 m/s).

UPDATE: I read that someone did this by "k-space filtering". Is there an easy way to learn how to do this? I'm looking for an acoustic application but most stuff I can find on the internet has to do with MRIs.


texts: How to find position, scale and rotation of a known shape/contour in an image?

texts:
I have an image of an object.
The image shows a high contrast outline of the object.
It is guaranteed that the image shows exactly one object.
The shape/contour of that outline is known.
It is not simple (e.g. a circle) but not too complex either.
It is made up of (circular) arcs and straight lines.
Think of the outline of the head of mickey mouse in terms of complexity.
Given the image and the knowledge about the shape, how do I determine the position, rotation and scale of the shape and thus the object in the image?

I did some research and Hough transforms seem to be the way to go, but only for lines.
The wikipedia article states that

Altering the algorithm to detect circular shapes instead of lines is relatively straightforward.

I have the impression that as long as I can describe the shape mathematically, I can adopt the algorithm to that shape, because the mathematical model is what defines the transformation. Is that impression (while very rough) correct?
The article states further

For more complicated shapes in the plane (i.e., shapes that cannot be represented analytically in some 2D space), the Generalised Hough transform [12] is used, which allows a feature to vote for a particular position, orientation and/or scaling of the shape using a predefined look-up table.

Is my Mickey Mouse-shape a complicated shape?
Do I need the Generalised Hough transform?
Am I on the right track with this hough transform?

I found an implementation in openCV, which lacks scale detection:

finds arbitrary template in the grayscale image using Generalized Hough Transform
Detects position, translation and rotation

Basically speaking, I have an image and some shape description (think of a vector graphic of the outline) and I want to know where it is in the image. Does something like that exists?
I cannot share the image.


texts: What is the difference between the Weiner-Hopf equation and the normal equation?

texts: In adaptive filters,  the development of LMS algorithm typically starts from the Weiner-Hopf equation, while the development of RLS algorithm starts from the normal equation. As I understand, these two equations are the same, and both their solutions is the optimal coefficients that the adaptive filter has to find. Is this true or am I missing something?


texts:
I am trying to understand how SC-FDMA is used in LTE system. Every description I found so far refers to DFT and IDFT.

However, when I checked 3GPP TS 36.211 chapter 5.4 (SC-FDMA baseband signal generation) and 6.12 (OFDM baseband signal generation) I found that there is hardly any difference between given equations (I did not copy the equations here because they are quite long) - OFDMA takes into consideration DC subcarrier, in case of SC-FDMA term "k + 1/2" is used wheres OFDMA uses simply term "k" (k can be denoted as number of subcarrier). Moreover the document does not say anything about neither DFT nor IDFT.

In case of OFDMA, I can imagine how the given equation can be considered as IDFT. But what about SC-FDMA? It looks like that modulated symbol is mapped in between two subcarrier. Can somebody explain me this issue in details?

Edit:

I was interested in how DFT and IDFT can be mapped onto 3GPP TS 36.211. In other words, which part of the standard implies usages of DFT and IDFT. Based on the answer given by AlexTP I understand that DFT usage is implied by chapter 5.3.3, whereas IDFT is described in chapter 6.12 (I am refering to version 13.4 of the standard). My first guess was that both DFT and IDFT are implied by chapter 6.12. Extra information that only PUSCH uses SC-FDMA was very useful.

There are some subtleties though. However, it is out of the scope of this question.


texts:
Suppose I have a sequence $x[k]$ with $\mathcal{Z}$-transform

$$ X(z) = x_{0} + x_{1}z^{-1} + x_{2}z^{-2} + \ldots + x_{N-1}z^{N-1}$$

I know that for real-valued $x[k]$ the $\mathcal{Z}$-transform of the autocorrelation of $x[k]$ is given by:

$$ S_{XX}(z) = X(z) X(z^{-1}) $$

Now suppose I shift the signal by $n$:

$$ \tilde{X}(z) = z^{-n}X(z)$$

Would the $\mathcal{Z}$-transform of the autocorrelation simply be:

$$ S_{\tilde{X}\tilde{X}}(z) = z^{-n}X(z) z^{ n}X(z^{-1}) $$
$$ S_{\tilde{X}\tilde{X}}(z) = X(z) X(z^{-1}) $$
$$ S_{\tilde{X}\tilde{X}}(z) = S_{XX}(z) $$

However when I use the sequence $x[k] = \{ 1, 1, -1\}$, shift it by $n=2$ to get $\tilde{x}[k] = \{0, 0, 1, 1, -1\}$, I get:

$$ R_{\tilde{X}\tilde{X}}[k] =\mathcal{Z}^{-1}\{S_{\tilde{X}\tilde{X}}(z)\} = [0, 0, -1, 0, 3, 0, -1, 0, 0]$$

Which is equivalent to $S_{\tilde{X}\tilde{X}}(z) = z^{-2} S_{XX}(z)$ instead of

$$ R_{{X}{X}}[k] = [-1, 0, 3, 0, -1]$$

So how is my math wrong? What is the autocorrelation of a shifted sequence in relation to the original autocorrelation?


texts: Wasn't Wikipedia errata on DFT/Trigonometric interpolation polynomial

texts:
https://en.wikipedia.org/wiki/Discrete_Fourier_transform
"Trigonometric interpolation polynomial" Section.

Shouldn't the middle term in the second line be?
$$ \cdots + X_{[(N-1)/2]} e^{i\ ( (N-1)/2)2 \pi t} + X_{[(N+1)/2]} e^{-i((N-1)/2)2 \pi t} + \cdots $$
Not that N/2 on an odd N is bad or anything.
Mixed indexing conventions here.  Indexing subscripts from 0 to N-1, and exponents 0 to L and -L to -1.  Nothing wrong with that.  Split Nyquist on the evens, not because you have to in a bandlimited sense, just because it keeps things real when needed.

Update:
This is not an error as pointed out by V.V.T., just my misperception or poor eyesight.  The symbols in the image are the greatest integer brackets, aka floor:
$$ \cdots + X_{ \lfloor N/2 \rfloor } e^{i\  \lfloor N/2 \rfloor 2 \pi t} + X_{ \lfloor N/2 \rfloor + 1} e^{-i \lfloor N/2 \rfloor 2 \pi t} + \cdots $$
Therefore it becomes a matter of opinion of which expression is better.
$$ L = (N-1)/2 = \lfloor N/2 \rfloor $$
The first is a tighter definition and more procedurally descriptive, the second is more conceptually splitting at the Nyquist.  "$L$" is what I've been using as I am really starting to favor odd sized centered DFTs.
Since VVT didn't answer, just commented, I'm going to change the question to whether it should be changed?
I still think so.


texts: Looking to understand line artifacts in "overscanned" image

texts:
Essentially I'm looking for an explanation how the second image results from a capture of the original. Possibly you've seen something like this before and you can tell just from looking at the result what's going on.

The original image: http://i.stack.imgur.com/GBJ6P.jpg
The output image: http://i.stack.imgur.com/uh89O.jpg

Here's the capture process using Android 4.0.4:

Display original image on LCD monitor.
Set rear-facing camera on an LG VS840PP with parameter picture-size=3072x1728. Although this is listed as a setting in picture-size-values, it may not be completely valid. The other settings (e.g. 2560x1920) are 4:3 and produce typical images. picture-format remains set to jpeg.
Point camera at original image on monitor.
takePicture() via jpeg callback.
The resulting intermediate image, i.imgur.com/qw688u8.jpg (3072x1728), is resampled to produce the output image (2592x2048) using the Python Imaging Library code below.

import Image
inm = Image.open("pattern-in.jpg", "r")
pixels = inm.getdata()

width = 2592
height = len(pixels) / width
outm = Image.new( "RGB", (width, height), (128,128,128) )

outm.putdata(pixels)
outm.save("out.jpg")

I am not interested in getting the camera to work "properly". I'm more curious to understand just what's going on. I'm including another set of images taken of only black with the lens obscured.

camera output: i.imgur.com/BygbqKF.jpg
after resampling: i.imgur.com/uWjNXxZ.jpg

Also here is the EXIF data provided by the camera for the color bar photo:

ExifTool Version Number         : 9.70
File Name                       : pattern-in.jpg
Directory                       : .
File Size                       : 3.1 MB
File Modification Date/Time     : 2014:11:11 16:09:16-08:00
File Access Date/Time           : 2014:11:11 16:10:43-08:00
File Creation Date/Time         : 2014:11:11 16:10:43-08:00
File Permissions                : rw-rw-rw-
File Type                       : JPEG
MIME Type                       : image/jpeg
Exif Byte Order                 : Big-endian (Motorola, MM)
Make                            : LG Electronics
Camera Model Name               : VS840PP
X Resolution                    : 72
Y Resolution                    : 72
Resolution Unit                 : inches
Y Cb Cr Positioning             : Centered
Exposure Time                   : 1/30
F Number                        : 2.4
ISO                             : 654
Exif Version                    : 0220
Date/Time Original              : 2002:12:08 12:00:00
Create Date                     : 2002:12:08 12:00:00
Components Configuration        : Y, Cb, Cr, -
Exposure Compensation           : 0
Flash                           : No Flash
Focal Length                    : 4.3 mm
Flashpix Version                : 0100
Color Space                     : sRGB
Exif Image Width                : 3072
Exif Image Height               : 1728
Interoperability Index          : R98 - DCF basic file (sRGB)
Interoperability Version        : 0100
Compression                     : JPEG (old-style)
Thumbnail Offset                : 550
Thumbnail Length                : 35981
Image Width                     : 3072
Image Height                    : 1728
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:0 (2 2)
Aperture                        : 2.4
Image Size                      : 3072x1728
Shutter Speed                   : 1/30
Thumbnail Image                 : (Binary data 35981 bytes, use -b option to extract)
Focal Length                    : 4.3 mm
Light Value                     : 4.7

Thanks very much!


texts: separating stationary and non stationary parts of univariate signal

texts:
Does anyone know if there is a procedure as to separate the stationary and non stationary parts of a univariate signal. I have seen signal source separation and blind separation algorithms (all of them assuming that the signal is a linear superpossition of underlying hidden source signals where the signals are statistically independent - linearly independent - not sure if colored noises are linearly independent) where different signals are mixed in a single combined signal. For this several methods exist as to separate the sources mostly based on either orthogonality, correlation, variance and distances, however all of them based on having already multivariate variables:

Principal components analysis
Singular value decomposition
Independent component analysis
Dependent component analysis
Non-negative matrix factorization
Low-complexity coding and decoding
Stationary subspace analysis
Common spatial pattern

My question is that if you could treat a single signal which is the combination of signal + uncorrelated stationary noise colors (white) + correlated noise colors (pink,brown,etc) as a source problem (implying that there is a mix of signals formed by the stationary noise, non stationary noise and signal) and thus apply a specific blind signal separation algorithm as to separate the sources statistically (for example as in stationary subspace analysis there is identification of the stationary and non stationary parts).

All blind signal separation algos I have seen can only be applied to multiple variables, my question is if there are there any blind separation algorithms that can be applied to univariate series where stationary and non stationary components can be separated as individual signal sources.

EDIT

Following comments from LPT

I know the signal is spread across a wide range of frequencies from the Evoluionary power spectrum. I know uncorrelated stationary white noise affects the signal and that other unidentifed stationary correlated colors do as well but ignore their mix. My idea was to run a wavelet at one level decomposition as to have two range of frequencies and use this as to run one of the analysis above as to determine the stationary and non stationary parts. As the stationary parts will correspond to correlated and uncorrelated noise colors which I will assume to be non gausian and additive. As the nature of the signal is non stationary I would effectively have separated the signal from noise. Then from noise I will run wavelet thresholding as to eliminate white noise based on a MA MAD and remain with correlated noises which via FFT and their power relation understand the type dominating noise color or identify their mix.


texts: Best way to remove unwanted region from image

texts: I am finding the techniques to remove unwanted regions (small dots) from image. I have an image that includes object and some unwanted region (small dots- see first image). I want to remove it. Hence, I use some morphological operator example 'close' to remove. But it is not perfect. Do you have other way to remove more clear (similar second image)? You can download example image at here