texts: Does it make sense to recompute Parks-Mccellan on a per sample basis?

texts:
I'm thinking of using Parks-Mccellan for my equalization needs, but since I require that the filter be variable (gain, Q etc.) then does it make sense to recompute Parks-Mccellan on a per sample basis?

Reason for asking is that I'm still confused about whether different algorithms are suited for per sample computation or whether they need longer intervals to make their full effect.

I guess it would still need some sort of pre-buffer (since the filtering uses previous samples)?

My application is Parks-Mccellan style arbitrary magnitude response filtering that's dynamic (i.e. I want to be able to vary the magnitude response over some, even short sample intervals).


texts: How to remove ADC-induced noise from voltage measurement data?

texts:
I am measuring the various voltages involved in a solar energy system, but the recorded values vary by quite a bit, most of which is caused by the ADC in the Arduino Nano I am using to take the measurements.

I am taking readings of both 30 Volt and 100 Volt sources (batteries and solar panels) on separate ADC channels, using hardware voltage dividers to present the readings to the ADC as a voltage from 0 to 5 volts.

The ADC is specified as having 10-bit resolution and initially presents the values as an integer from 0 to 1023.  The readings are communicated as floating-point values after a conversion has been applied to scale the recorded readings up to the original voltages.

What is the best way to smooth these out so I can do a data reduction?

My raw data files include date and time, (to the millisecond level), with readings taken every 2000 ms.

The files become quite large so I would like to eliminate redundant readings if possible.

The presence of date/time information will allow for continuous graphing.

Ideas?


texts: How to estimate ALL time-delays across MULTIPLE signals?

texts:
Imagine there are 100 recordings of the same signal or pattern, but those recordings are not properly aligned with each other in time. In other words, each sample has some unknown time delay in relation to each of its sister samples. The data might look something like this:

The question is: What's the best method for computing the relative time-delays of those signals so that I might align them?

If there were only two signals, computing time-delay would be simple. The best method I'm aware of is to maximize the cross-correlation between the two samples across different delay values.

But what about computing a large set of delays? I'm sure there has to be a robust method for this general task... I just don't know what it's called. Thanks!


texts: How to quantify phase distortion of a filter specific to a signal?

texts: For example, a EKG input signal is filtered with a known transfer function that does not have linear phase. How do you quantify the phase distortion of the output signal given you have the input? I know that the phase response of the transfer function gives the phase delay at all frequencies but I'm not sure how to make use of this.


texts: why does the decision boundary change in BPSK? is it true?

texts:
I am working on modulation and demodulation of BPSK using python. i made a code for modulation and demodulation,while demodulate i tried to compare my actual data bit stream with demodulated bit stream,when no noise is added to the modulated signal i have zero errors after i demodulate.
But when i tried to send the modulated wave(iam working on sound waves) from one PC and i used another PC to receive the signal(using pyaudio) and when i try to apply the same demodulation method on the received sound i am getting 50% error(which i think the total demodulation technique is wrong or decision boundary changed because of noise that get added while recording the sound from transmitting pc).

So i need help to figure out which is causing error in demodulation(error i mean after comparing my sent data and the data that i get after demodulation)

is it possible like there will be shift in decision boundary after adding noise in it? if so how can we find the shifted decision boundary for my BPSK.

thanks in advance, any help is greatly appreciated :).


texts: Why does my stop-band filter attenuate other frequencies?

texts:
Here is my code for a two-toned signal, where I use a stop-band to remove the higher tone and then plotted the before (in blue) and after (in red) in the frequency domain after convolving my signal with the filter coefficients.

If you put this code into Matlab you can clearly see that the higher frequency has been successfully removed by the filter, yet for some reason the amplitude of the lower frequency has been cut in half, and the more I increase the # of filter coefficients, the more it just flattens my whole curve, why does this occur?  And how can I prevent it so that the stop-band does not propagate outwards? Here is the image and the code:

fSampling = 8000;
tSampling = 1/fSampling;

t = 0:tSampling:0.005;
F0 = 1000;
F1 = 3000;

xt = sin(2*pi*F0*t) + sin(2*pi*F1*t);
ht = fir1(40,.25,'stop');
yt = conv(xt,ht);

fAxis = -4000:125:4000-125;

xF = fft(xt,64);
MagXF = fftshift(abs(xF));

plot(fAxis,MagXF);
hold on

yF = fft(yt,64);
MagYF = fftshift(abs(yF));

plot(fAxis,MagYF,'r')


texts: Problem with Kalman filtering accelerometer data

texts:
I'm having some trouble implementing a Kalman filter in MATLAB. I have an Android phone connected sending data from accelerometer for 10 seconds. After i have the data I take out the x-axis vector. What I want after that is to get better readings using the Kalman filter.

The output I am looking for is both the acceleration and the velocity of the phone. When I run the code I get almost no change in acceleration (is between -0.5 and 0.5 m/s^2) and way to much change in velocity (increasing to very high numbers). The tests I have been running are when the phone is laying still on a table. So the correct values in acceleration and velocity should be 0.

The problem is that since i'm only measuring acceleration my state vector will be the same vector as the measurement vector with the only difference that i also have velocity in the state vector. Both the control input is the acceleration and the measurement is the acceleration.

So when I update my state vector the difference that is going to be multiplied with the Kalman gain is always zero.

So my question is: Should the measurement noise / the process noise be added to the measured acceleration "z" or should the noise be added to the state prediction vector?


texts: Fractional powers of complex numbers (DSPrelated computation)

texts:
I am puzzled by this computation: https://www.dsprelated.com/showarticle/754.php (c.f. quote)

  Raising $ i $ to integer powers results in traversing the unitcircle in the same number of quarter turns. The next question that arises naturally is if the pattern also applies to fractional values as well. Consider $ \sqrt{i} $. Suppose it is $ a + b \cdot i $.
  $$ ( a + b \cdot i )^{2} = i \\ a^{2} + 2ab \cdot i + b^{2} \cdot i^{2} = i $$
  $$ ( a^{2} - b^{2} ) + ( 2ab ) \cdot i = 0 + 1 \cdot i $$ In order for two complex numbers to be equal, both the real parts and the imaginary parts must be equal. $$ a^{2} - b^{2} = 0 \text{ and } 2ab = 1 $$
  $$ a = ± b \text{ and } a = { 1 \over {2b} } $$
  Solving for a,b being real yields two solutions: $$ (a,b) = \left( { \sqrt{2} \over 2 }, { \sqrt{2} \over 2 } \right) \text{ or } \left( - { \sqrt{2} \over 2 }, - { \sqrt{2} \over 2 } \right) $$

For me, it does not make sense to say that $a=\pm b$ AND $2ab=1$, this is just a contradiction... either $a=\pm b$ OR $2ab=1$ therefore I would say that $(a+bi)^2 \neq i$ .... How can they say that it is? What is the logic behind that...?


texts:
I'm trying to recreate a gassuain pyramid using the following scales:

There seems to be two concepts used here:

1) When an image is halved, applying a gaussian kernel of σ will apply as 2σ.

2) When an image has a scale of σ, and a gaussian kernel of σ is applied, then the resulting image will have a scale of sqrt(2)*σ.

So when I'm constructing the above scale space, I do the following:

Where the sigmas shown are the sigma of the gaussian kernel applied to the image at the specified scale.

I implemented this in matlab with:

for i = 0:3 % Cycle over octaves - 4 total
    for j = 0:4 % Cycle over scales - 5 total
        if(i == 0 && j == 0)
            % This is the first octave and first octave
            obj.gaussianpyramid{i+1,j+1} = blob_class_image.filt_gaussian(obj.gs,1/sqrt(2));
        elseif(i > 0 && j == 0)
            % This is the first scale after the first
            % octave, take 3rd image from previous row
            obj.gaussianpyramid{i+1,j+1} = obj.gaussianpyramid{i,3}(1:2:end,1:2:end);
        else
            % These are second + scales. Take image from
            % previous column and apply the same scale
            obj.gaussianpyramid{i+1,j+1} = blob_class_image.filt_gaussian(obj.gaussianpyramid{i+1,j},sqrt(2)^(j-2));

            % Store logpyramid
            obj.logpyramid{i+1,j} = obj.gaussianpyramid{i+1,j+1} - obj.gaussianpyramid{i+1,j};
        end
    end
end

Is this the correct line of thinking? I've implemented this and when I look at the laplacian of guassian pyramid, it seems to skip over some scales.

EDIT: After some tests it appears I'm not able to implement #2) listed above, where two guassian convolutions with σ is the same as a single guassian convolution with sqrt(2)*σ. When I test it out and then substract the images, they are not the same...

EDIT2: Also made a small mistake on calculating the sigmas. The above idea should be correct now. I double checked by comparing the scale obtained at σ = 22.627 by convolving the original image with a gaussian kernel of σ = 22.627 and then down sampling and comparing the two images and they appear to be the same.


texts: How to subsample shift with sinc interpolation?

texts:
Does anybody know of a way to shift data by a fraction of a sample by using sinc interpolation? For example, shift an image to the right by 0.1 pixels.

I'm struggling to find a formula or reference that explains how to generate such a kernel, and I already know how to do it in the frequency domain....

I'm thinking something like:

function kernel=subpixelshifter(shift)
trange=[-1,0,1]-shift;
kernel=lanczos3(trange);
end
function x=lanczos3(x)
bad= x>3;
x=sinc(x).*sinc(x/3);
x(bad)=0;
end


texts: What is the proof of the equation for the aliased frequency fa = |R*n - fs|?

texts:
R (sampling rate)
fs (signal being sampled
fN (the Nyquist frequency)
fa (aliased frequency)

I was hoping someone could explain to me why this is true with a more mathematical proof. it seems reasonable for the aliased frequency to be related to these parameters, but I would like a more solid rationale.


texts: Finding the discrete time Fourier series for signal

texts:
I think I did everything correctly here, but I must be missing something still.
We have the following signal:
My approach:
We are told that the signal has period $N = 4$
We know $$Y[k] = \frac{1}{N}\sum_{n = 0}^{3}y[n]e^{-j\frac{\pi}{2}nk}$$ The signal only has two non-zero terms at $n \mod 4 = 0$ and $n \mod 4 = 2$
So, $$Y[k] = \frac{1}{N}\left(e^{-j\frac{\pi}{2}k} -\frac{1}{2} e^{-j \pi k}\right)$$
$$Y[k] =  \frac{1}{4}\left( (-j)^{k} - \frac{1}{2} (-1)^{k}\right)$$
$$Y[k] =  \begin{cases}
 \frac{1}{8} &\text{if}\, k = 0\\
 \frac{1}{4}(.5 - j)&\text{if}\, k = 1\\
\frac{-3}{8} &\text{if}\, k = 2\\
 \frac{1}{4}(j + .5) &\text{otherwise}
\end{cases}$$
However the reported answer is actually
$$Y[k] =  \begin{cases}
 \frac{1}{8} &\text{if}\, k = 0\\
 \frac{3}{8} &\text{if}\, k = 1\\
\frac{1}{8} &\text{if}\, k = 2\\
 \frac{3}{8} &\, k = 3
\end{cases}$$
Where am I going wrong? Any help is very much appreciated :)


texts: Continuous vs. Discrete Fourier Transform for representing a physical phenomenon

texts:
This question is related to the differences between discrete and continuous Fourier Transform equations. Although I've found some good explanations about the difference in this forum, I cannot see how to make this connection in my problem. I have a physical phenomenon described by the equation:
$$u(t)=a\int_{-\infty}^{\infty}\frac{e^{ib\omega}-1}{\omega^2}\overline{B}(\kappa)e^{-i\omega t}d \kappa$$
where $a$ and $b$ are constants, $t$ is time in s, $\omega$ is the angular frequency in rad/s, $\kappa$ is the wavenumber in rad/m, and $\overline{B}(\kappa)$ is the Continuous Fourier Transform of a variable $B(x)$. The variable $x$ is the position in m. The relationship between $\omega$ and $\kappa$ is a wave speed, i.e., $\omega=c_0\kappa$, where $c_0$ is a constant in m/s. The Fourier Transform of $B(x)$ is
$$\overline{B}(\kappa) = \frac{1}{2\pi}\int_{-\infty}^{\infty}B(x)e^{i\kappa x}dx$$
My issue is that I don't know the function $B(x)$; I can only measure its samples in a given position step $\Delta x$. So, instead of having $B(x)$, I have $B[n]$ samples. If I need to know the samples $u[n]$, how these two equations would look like in the discrete world? And what would be the consequence/limitation for this representation?
Thanks.


texts: Why Cramér spectral representation and not DTFT for stochastic process

texts:
In a lot of time-series analysis references I find (written by mathematicians or statisticians rather than engineers), I find the following signal decomposition for a stochastic process, termed the "Cramér representation" (e.g. eqn 8.11 of this reference):
$$
X[n]  = \int_{\langle 2\pi \rangle} e^{-j\omega n} d Z(\omega)
$$
The factor $dZ(\omega)$ is referred to as a spectral increment. I found another reference (ref, eqn 77) that said that the spectral increments are orthogonal (w.r.t. the expectation operator) if the process is stationary.
Compare this to the inverse discrete-time Fourier Transform (IDTFT), non-normalized, angular frequency convention (eqn 4.2.28 of Proakis & Manolakis, Digital Signal Processing, 4th ed):
$$
X[n] = \frac{1}{2\pi} \int_{\langle 2\pi \rangle} e^{j\omega n} X(\omega) d\omega
$$
With the exception of trivial differences in convention (minus sign in the exponent, normalization factor), the two representations appear to be the same. Ignoring the minus sign convention on $\omega$ for now, I am tempted to just conclude:
$$
dZ(\omega)  = \frac{1}{2\pi} X(\omega) d\omega
$$
but I suspect there is a deeper mathematical reason why this would be wrong and that the statistics literature uses spectral increments instead.
Why do statisticians prefer the Cramér representation? Are there any computational or theoretical advantages to using it?
Does it have something to do with the convergence (or existence) of some type of integral? Or some issue relating to the fact that $X[n]$ is explicitly a stochastic process in the Cramér representation whereas the DTFT might rely on the signal being deterministic.
I wonder this because engineering education (at least mine was this way) tends to abuse notation or gloss over certain mathematical difficulties because those nuances wouldn't matter for the situations in which an engineer would be using said mathematical tools.
For instance, as an undergrad I never had to learn what a Lebesgue integral was, even though I was implicitly computing Lebesgue integrals in my probability course.


texts:
Take the following transfer function of a 3rd order system:

$$H(s)=\dfrac{2.302~s+0.3548}{s^3+0.739~s^2+3.223~s+0.3548}$$

with poles:

         Pole              Damping       Frequency      Time Constant
                                       (rad/seconds)      (seconds)

 -1.13e-01                 1.00e+00       1.13e-01         8.89e+00
 -3.13e-01 + 1.75e+00i     1.76e-01       1.78e+00         3.19e+00
 -3.13e-01 - 1.75e+00i     1.76e-01       1.78e+00         3.19e+00

and with the following unitary step response:

If I compute the percentage overshoot (PO) based on the damping ratio $\zeta=0.176$, I get:

$$PO=100{\times}e^{\dfrac{-\zeta\pi}{\sqrt{1-\zeta^2}}}=100{\times}e^{\dfrac{-0.176\pi}{\sqrt{1-0.176^2}}}=\boxed{57.02\%}$$

However, if I compute the PO using the graphical method (comparing the peak value with the final value) I get a completely different result:

$$PO=\dfrac{v_{peak}-v_{final}}{v_{final}}{\times}100=\dfrac{1.2-1}{1}{\times}100=\boxed{20\%}$$

I don't understand why such discrepancy. Why are my PO computations not matching?


texts: How to measure the agreement between to curves?

texts:
I have values (plotted below) of expected RSSI values over time that I would like to compare with my measured RSSI values.  What I was looking for was a way to quantify it so I can change parameters and be able to compare/contrast different approaches.

It is a hard problem in my mind because I don't know how to compare the signals and yet take into account the large-scale (overall shape) and small-scale (individual fluctuations) of signal.

For instance, here is a plot of one set of signals:

In the image I can see that the red measure signal roughly follows the model, but it also does an OK job of simulating some of the sinusoidal qualities of the model (in some places).  Any thoughts?

<>
In response to pichenettes' comments (which seem reasonable), I took a diff of the two values and plotted the abs(fft(diff)) and got this:

I am not sure what to make of that though.  Since we don't have any actual freqs, I am not sure how to scale the axis, and then if I did, what metric would you use?


texts: What Are the Alternatives to FFT for Computing High Resolution Tone Power Levels?

texts:
I have a system where there's a transceiver which transmits tones on specific frequencies (about 260kHz) and a receiver which is supposed to recognize those tones.

The transmitted tones are of low frequencies and has a very narrow band. At the receiver side I sample the band with ADC with sampling rate about 600kHz. The interesting band is about 1kHz wide, but whole analysed band is about 300kHz. To recognize if the signal exists I'm using 65k FFT? It takes about 100ms to collect samples. My goal is to find high-resolution tone power level.

I heard about zoom-fft and chirp-z, but is there another without expanding sampling time?

EDIT 1

Maybe i should ask a question diffrently:
What method (algorithm) gives the highest resolution (Hz) when I have a constant number of samples, and want to see only a small part of whole band (e.g. 1kHz in 300kHz)?


texts: Communication between two USRP : mismatched spectra between transmission and reception

texts:
I am trying to make two USRP communicate between each other : for the transmission, I'm using an HackRF One USRP and for the reception a NI 2921 USRP.
As a first test, I'm trying to send different basic signals like sine waves, square waves, triangle waves,... with the HackRF One and receive it with the NI 2921 USRP at a carrier frequency of 2.43GHz.

Here is the block diagram for transmission, the time signal and FFT plot :

I'm sending the signal at 2.43GHz with a sample rate of 200kHz. Here the signal sent is a composition of a real component which is a square wave at 15kHz and an imaginary component which is a cosine wave at 10kHz.
Here is the block diagram for reception, the time signal and FFT plot (once when I am not sending any signal and once when I am transmitting the composition of signals described above, such that we can see that the peak detected is well due to my emission) :

I'm sampling at 200kHz and my center frequency is at 2.43GHz.

Whatever the signal I'm sending (a DC signal, a sine wave, a triangle wave,...), I always get the same peak (and only one) like the one on the picture. Normally, I should receive the same FFT as the one showed at emission on the picture.
I notice also that this peak is located at a weird position (2.43GHz + 46kHz) compared to the center frequency (2.43GHz) with no link with the frequency of the signals sent. Moreover whatever the frequency of the signal emitted, the peak will always be located at this same position as well.
I seems like they manage to communicate between each other given that there is this peak appearing when I am transmitting the signals but I do not understand the logic behind the spectrum received..

Can somebody enlighten me?

EDIT further to @MBaz answer:

I tried both osmocom and UHD at the reception of the signal to see if there was a difference but there is not. I will use UHD again.
I have just used GQRX as a spectrum analyzer to do some tests. Sending a sine wave at 10kHz gave me peaks at frequencies shifted of 50kHz on the FFT (if I send a signal at 2,429720GHz, the received signal showed a peak at 2,429770GHz on the FFT with GQRX). I am then sure the received peaks are due to the emission of signals with the HackRF One.
Changing the sine frequency from 10kHz to 20kHz does not change the location of the peak.
Trying to send two sine waves (10kHz and 20kHz) showed me one and only one peak at the same frequency location as before.
Changing the type of signal sent (triangle, square wave, sine wave) does not change the FFT of the signal received.
All the previous tests have showed the same results on gqrx and GNURadio Companion.
As you can see on the plot of the evolution of the signal in function of the time, this is a quite unusual low amplitude signal received.
No error is shown on the console of the NI 2921 receiver. On the emitting signal console, I have this output :

Warning: failed to XInitThreads()
linux; GNU C++ version 7.3.0; Boost_106501; UHD_003.010.003.000-0-unknown
gr-osmosdr 0.1.4 (0.1.4) gnuradio 3.7.11
built-in sink types: uhd hackrf bladerf soapy redpitaya freesrp file
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Using HackRF One with firmware 2018.01.1


texts: What is the role of complex exponential?

texts: What is the role of complex exponential $ e^{jθ} $ in Fourier Transform? Is it different in the continuous and in discrete time domain?


texts:
Okay I'm really confused about analyzing the  waveform I generated using 16-QAM on MATLAB... I transmitted a $y = [0 \ 1 \ 2 \ 3 \ 4 \ldots \ 15]$ discrete signal (in order) to qammod function in MATLAB usign 16-QAM. Its constellation diagram is the standard 16 symbols on the combination of values of $-3,\ -1,\ 1,\ 3$ on Q and I. Then I modulated the I and Q components respectively with a cosine and sine, with a carrier frequency of $36\textrm{ kHz}$. My result is this:
I know it follows a complex envelope, but how do I know that I got a correct waveform based on my original signal?


texts: Convolving a signal with the impulse response of the channel

texts: For a complex signal x to be transmitted over a channel with complex impulse response h, x will be convolved with h. What will the mathematical operation done in the reveiver to cancel the effect of h? I am confused because I have a code in which x is multiplied with h in the transmitter, and in the receiver, the received signal is multiplied by conjucate h and divided by h squared.


texts: Where to begin? - Multi source polyphonic pitch detection

texts:
I'm quite interested in real time pitch tracking. I have used mcleod pitch method, Yin and other methods to perform real time pitch tracking for a monophonic audio track.

I know that Polyphonic pitch detection is at a whole different level and I want to know where to start. If the experts(masters) could point me at the right direction, It would be greatly appreciated.
Papers, books, Topics or any suggestions that you could give me would be of great help.


texts:
I am having trouble understanding the impulse response function.
 I have a beam of 10 m long. I place 2 sensors, one at point A and one at point B. I then excite the beam at point E (shown in picture) by tapping it with a hammer. I then repeat this on several different beams of different lengths, dimensions, materials and more. I want to tap the beam to see how the beam responds, using accelerometers at locations a and b, and see if I can estimate things about the beam (example material).

In the case of calculating impulse response, what exactly is my input? I assume it is the excitation signal, however I do not measure the excitation signal until it gets to point A (there is no sensor at point E). I therefore do not know the excitation at the source, it just be with a hammer hitting the beam. The matlab documentation uses inputs as an example, but this does not mean anything to me as I do not know my input.

Also, what does the impulse response actually tell me? How is this useful?

I am using matlagb.
Gracias todos,
Ben


texts: What is the difference between the V-OFDM and OSDM

texts:
I am trying to understand the difference(s) between V-OFDM (Vector Orthogonal Frequency Division Multiplexing) and OSDM (Orthogonal Signal Division Multiplexing) which are used as a multicarrier modulation techniques in wireless communication. Based on what I understand both are dividing the sub-carriers into  groups of sub-carriers vertically, and then process the $DFT$ horizontally. But when checking online and read different papers and books, some are talking about V-OFDM and others OSDM !!

Could anyone please explain further about differences between them ? design and differences  of OSDM from V-OFDM? Or they are similar, only two different names with same technology !!!

Thanks in Advance!


texts: How to design filter for a stochastic process (signal)?

texts:
The given stochastic $y[n]$ is composed of two signals, $s[n]$ which is the desired signal, and $\epsilon[n]$ is the noise which is a zero-mean weak-sense stationary signal. The desired signal is a sinusoid function with unknown amplitude and the initial phase is also a stochastic variable distributed according to a rectangular pdf with support $[0, 2\pi)$.
$$y[n] = s[n] + \epsilon[n]$$
I try to compute the FFT of $y[n]$ to see what the signal looks like in the frequency domain but it doesn't help much. So my thought is to find cross-correlation and then effect spectrum. In order to find the bandstop frequency.
Can someone guide me on how to solve this kind of problem?


texts: Implementing an analog approximation of an FIR filter given its impulse response

texts:
Problem:

I have the impulse response of a matched filter(therefore its phase and magnitude response. See figure below) of a filter, and  I need to implement its response using only off-the-shelf components i.e low-pass filter, delay lines, multiplexers, etc.. I don't require extreme precision but I'd like to approximate its response as exact as possible.

Possible Solutions:

Cascade low-pass and high pass filters to obtain the overall shape of the magnitude response. Use delay lines to implement two taps to give the magnitude response its "sinusoidal" nature as shown by the above figure.
Use a multiplexers/splitters with delays, phase shifters, and attenuators with values according to the filter's frequency and phase response.

I am extremely new to signal processing so I don't know much of what is out there. So please, if anyone could guide me or give me an insight into how to achieve my goal, I'd really appreciate it.


texts: How do I get the most accurate camera calibration?

texts:
First off, I hope this is the correct Stack Exchange board. My apologies if it is not.

I am working on something that requires me to calibrate the camera. I have successfully implemented the code to do this in OpenCV (C++). I am using the inbuilt chessboard functions and a chessboard I have printed off.

There are many tutorials on the internet which state to give more than one view of the chessboard and extract the corners from each frame.

Is there an optimum set of views to give to the function to get the most accurate camera calibration? What affects the accuracy of the calibration?

For instance, if I give it 5 images of the same view without moving anything it gives some straight results when I try and undistort the webcam feed.

FYI to anyone visiting: I've recently found out you can get must better camera calibration by using a grid of asymmetric circles and the respective OpenCV function.


texts: Why is Power spectral density of random walk noise defined despite it being non-stationary?

texts:
While reading up on oscillator stability, I noticed that authors characterize random walk noise (Brownian noise) as having a PSD of $S_y(f) = h_{-2} f^{-2} $ where $h_{-2}$ is some constant. This is in line with what Wikipedia has to say on the power spectrum of Brownian noise . However, random walk noise is a non-stationary process, and as far as I know PSD is only defined for stationary processes. For non-stationary processes, the PSD would also be time dependent. How does this align with the above definition for the PSD for random walk processes?
My question is essentially identical to this 3 year old question from cross validated, however this doesn't appear to have been answered satisfactorily.
EDIT: I have been made aware that my question is also similar to this one: Power Spectral Density of Brownian Motion despite non-stationary


texts: Given a causal LTI system with a transfer function, determine if the system is an all-pass filter

texts:
We are given a transfer function of a causal LTI system and must determine if it is an all-pass filter:

$$ H(z) = \frac{1 + 4z^{-2}}{4 - z^{-2}} $$

To the best of my recollection to determine if a system is an all-pass filter, we must first find the poles and zeros and see if they are conjugate reciprocal pairs. So working on that and finding the poles and zeros, we find that...

the poles are at $z = \tfrac{1}{2}, -\tfrac{1}{2}$

the zeros are at $z = 2j, -2j$

With that being said the poles and zeros are no conjugate reciprocal pairs. That being said, are there any exceptions or other criteria that would make a system an all-pass filter?


texts: Combining 2 sinusoids of equal amplitude with different frequencies into 1 new "wave"

texts:
This question is about combining 2 sinusoids with frequencies $\omega_1$ and $\omega_2$ into 1 "wave shape", where the frequency linearly changes from $\omega_1$ to $\omega_2$, and where the wave starts at phase = 0 radians (point A in the image), and ends back at the completion of the at $2\pi$ radians (point E), resulting in a shape similar to this, assuming $\omega_1$ is a lot smaller (larger period) than $\omega_2$:

Note that the amplitude is the same for both waves: points B and D are at equal distance from the $x$-axis.

Is there a closed-form definition for this, like linear frequency modulation?
Part of my question is also: where does point C end up on the x-axis if the "wave" starts at the origin (0,0)?

I was thinking about something like this:

1*sin((w1*t)+((w2-w1)/T)*((t^2)/2))

with:

w1: frequency 1
w2: frequency 2
t: a vector going from 0 to ((1/w1)+(1/w2))
T: some arbitrary number: this is part of the question I suppose..


texts: Bounds of the derivative of a bounded band-limited function

texts:
Let $f(t)$ be a function with properties:

$$\begin{array}{ll}
t\in\mathbf{R}&t\text{ is in reals}\\
f(t)\in\mathbf{R}\text{ for all } t&f(t)\text{ is in reals}\\
|f(t)|<A\text{ for all }t&\text{absolute value of }f(t)\text{ is bounded above by }A\\
\int_{-\infty}^{\infty} f(t) \ e^{- i \omega t} \ {\rm d}t = 0\text{ for all }|\omega|\ge B&f(t)\text{ is band-limited by frequency B in radians}
\end{array}$$

Given $A$ and $B,$ what is the tight upper bound for $|f'(t)|,$ the absolute value of the derivative of the function?

Nothing else shall be assumed about $f(t)$ than what has been stated above. The bound should accommodate for this uncertainty.

For a sinusoid of amplitude $A$ and frequency $B,$ the maximum absolute value of the derivative is $AB.$ I wonder if this is an upper bound, and in that case also the tight upper bound. Or maybe a non-sinusoidal function has a steeper slope.


texts: Why is my DFT/FFT always 90° out of phase?

texts:
I'm doing an FFT using Python and Numpy on one machine, and C# on another. I'm using some dummy data that mimics how I'll eventually be gathering data from sensors in the C#/UWP application. The two methods yield consistently identical results on the dummy data, which is great. However, the phase at the sine wave's frequency is always -90°.

Here's the code. Ignore how it essentially does the same thing 7 times, eventually those arrays will be filled with data from 7 different sensors. Sampling frequency is 4096 Hz, signals are gathered for 1 second and are on the interval [-32768,32768]. Note that the x-axes on the Magnitude and Phase graphs are zoomed in to the center frequency plus or minus several Hertz.

import numpy as np
import matplotlib.pyplot as plt
import math

centerf = 1350
span = 2*np.pi*centerf*np.linspace(0,4095,4096)/4096
testData = 32768*np.sin(span)
testData = np.array([math.trunc(x) for x in testData])

plt.close("all")
sensors = ["Channel 1", "Channel 2", "Channel 3", "Channel 4", "Channel 5", "Channel 6", "Channel 7"]

data = []
data.append(testData)
data.append(testData)
data.append(testData)
data.append(testData)
data.append(testData)
data.append(testData)
data.append(testData)

theTime = np.linspace(0,len(data[0]),len(data[0]))/len(data[0])

thisFFT = [np.fft.fft(x) for x in data]

f, a = plt.subplots(7, 1,figsize=(10,8),sharex=True)
f2,a2 = plt.subplots(7,1,figsize=(10,8),sharex=True)
f3,a3 = plt.subplots(7,1,figsize=(10,8),sharex=True)

mag = [np.abs(x)/2048 for x in thisFFT]
phase2 = [np.arctan2(x.imag,x.real)*180/np.pi for x in thisFFT]

mag = [x[:2048] for x in mag] # removed mirrored upper half
phase2 = [x[:2048] for x in phase2]

for x in mag:
    x[0] = 0 # remove DC component

[aa.plot(theTime,d,c='r',lw=0.5) for (aa,d) in zip(a,data)]
[aa.plot(d,c='g',lw=0.75) for (aa,d) in zip(a2,mag)]
[aa.plot(d,c='b',lw=0.75) for (aa,d) in zip(a3,phase2)]
for ch,ax in zip(sensors,a.flat):
    ax.set(ylabel=ch)
for ch,ax in zip(sensors,a2.flat):
    ax.set(ylabel=ch)
for ch,ax in zip(sensors,a3.flat):
    ax.set(ylabel=ch)
a.flat[0].set(title="Amplitude over 1s")
a2.flat[0].set(title="FFT Magnitude")
a3.flat[0].set(title="FFT Phase")
a.flat[5].set(xlabel='Time')

[aa.axvline(x=centerf,lw=0.25) for aa in a2]
[aa.axvline(x=centerf,lw=0.25) for aa in a3]
[aa.set_xlim([centerf-20,centerf+20]) for aa in a2]
[aa.set_xlim([centerf-20,centerf+20]) for aa in a3]

f.tight_layout()
f2.tight_layout()
f3.tight_layout()

print("Magnitude at centerf: {c:1.3f}.".format(c=mag[0][centerf]))
print("Phase at centerf: {c:1.3f}°.".format(c=phase2[0][centerf]))

The output from the print statements is

Magnitude at centerf: 32767.397.
Phase at centerf: -90.000°.

The magnitude is fine, the graph always shows a nice peak right where it should be.

My question: since the input data is a sine wave that always starts at sin(0)=0 and the FFT algorithm uses a rectangular window, shouldn't the phase at the fundamental frequency be 0°? Is there something about phase that I'm not understanding?


texts: Conceptual questions from signal processing

texts:
I don't have a thorough background in Signal processing and require some information for an application pertaining to computer science. Minimum Entropy Blind Signal Deconvolution with Non Minimum
Phase FIR Filters paper proposes to use entropy for blind system identification. My questions are the following based on terms that I cannot follow in the paper and shall be grateful for detailed explanation

Q1: What does minimum phase filter mean? In my understanding phase of a signal means the angular displacement or the angle $\theta$ that appears in an equation like
$x=A sin (\omega*t + \theta)$

Q2: What is an inverse filter? How is it related to convolution and deconvolution?


texts: Can someone let me know linearity, time-invariance, causality, memory characteristic of the system?

texts:
The input/output system is
$$
\frac{dy(t)}{dt}+2y(t)=2x^2(t)
$$

I want to know this is linear? causal? time-invariant? memoryless?

According to solution, the answer is 'Linear if zero initial conditions, causal, time-invariant, with memory'.

My trial:

$$y(t)=x^2(t)-\frac{1}{2}\frac{dy(t)}{dt}$$

Sorry for my poor drawing.

for input value: $x_1(t)=2x(t)$,
\begin{align}
y_1(t)&=\left(2x(t)\right)^2+\left(-\frac12\right)\frac{d}{dt}\left(y(t)\right)\\
&=4x^2(t)-\frac12\frac{dy(t)}{dt}\\
2y(t)&=2x^2(t)-\frac{dy(t)}{dt}\\
\therefore y_1(t) &\ne 2y(t)
\end{align}

$\because$ not satisfying Homogeneity, Non-Linear.

The system doesn't have $x(t+k)$. (It means $y(t)$ is not made by $x(t+k)$)

$\therefore$ The system is causal because

for input value: $x_1(t)=x(t-t_0)$,
\begin{align}
y_1(t)&=x^2(t-t_0)-\frac{1}{2}\frac{dy(t)}{dt}\\
y(t-t_0)&=x^2(t-t_0)-\frac{1}{2}\frac{dy(t-t_0)}{dt}\\
\therefore y_1(t) &\ne y(t-t_0)
\end{align}

$\therefore$ time-varying.
The system doesn't have any $\displaystyle\int$.

i.e.) $\displaystyle\int x(\tau) d\tau$.

$\therefore$ memoryless

What is the real solution?


texts: Slope of 2nd order low pass vs band pass Butterworth filters

texts: I have noticed that some manufacturers of audio processing products label a 2nd order Butterworth low pass as having a slope of 12dB per octave, but then also label a 2nd order Butterworth band pass as having a slope of 12dB per octave. In actuality each side of a 2nd order Butterworth band pass has a slope of only 6dB per octave. Is there a convention that because it is symmetrical that the slope of each together constitute the "slope" or is it just that they are wrongly assuming that order is equivalent to slope for all the Butterworth filter types?


texts:
Currently, I am developing a piece of software for chord recognition. There are FFT and pitch class profiling on it. I tried using the pitch class profile proposed by Takuya Fujishima, but the result is not quite accurate. This may be because I misinterpreted the pitch class profile algorithm.

I don't understand the folowing formula formula:

$p(k)= [12 \;log_2( \frac {l}{N} \cdot \frac {f_{sr}} {f_{ref}})]$  $mod$  $12$

What are $f_{ref}$,and $N$ here?
Does $N$ mean the sample size of FFT (4096,1024,etc.) or the total bins of the spectrum?


texts: Digital Filters deal only with samples, right?

texts:
I'm new to digital filters. So I'm trying to get things right and I can't find an explicit answer to my question on the internet.

Question: Digital filters only accept samples as input? I mean the input can not be zeros nor ones. It can only be samples. If that's the case, then the typical position for a digital filter would be after the receiver (I mean before converting to bits).

So receiver would be like:

$$
\mbox{antenna} \rightarrow \mbox{amplifier} \rightarrow \mbox{Sampler} \rightarrow \mbox{Digital Filter} \rightarrow  \underbrace{\mbox{DAC}}_{\tiny \mbox{here I should have filtered samples}}
$$

Please correct me and kindly ignore any coding or LNAs and stuff like that.


texts: Length of Hamming Window to Resolve a Harmonic

texts:
I am trying to answer the question:

"Given a single-sourced pitch signal with a fundamental frequency of 440Hz and a sampling rate of 44100Hz how long should the Hamming window of the STFT analysis be to resolve the harmonics of the signal"

My understanding of resolving a harmonic is to ensure the frequency is represented in the frequency domain e.g. the top graph plots the sum of 4 sinusoids in the time domain. The bottom graph shows 4 distinct frequency peaks in the frequency domain (4 harmonics are resolved).

For the question, I use the below code to calculate the STFT of a sinusoid with 440hz frequency.
Trying length 10 vs 100, based on the logic above I would say N=10 does not resolve the harmonic while N=100 does.

Is this correct? Is there a mathematical intuition for calculating the length that will resolve a harmonic?

Thanks.

import numpy as np
from matplotlib import pyplot as plt

SR = 44100 #Sampling rate (sometimes denoted as fs)
T = 1/SR #Time step in secs
t = np.arange(0,1,T) #A 1 second array arrange intp 44100 samples

##Sinusoid parameters
f = 400 #Frequency
A = 1 #Amplitude
x = A*np.sin(2*np.pi*f*t) #sinusoid equation

N = 100 #Hamming window of length N (this is what we want to optimize)
win = np.hamming(N)
ind = np.arange(0,N,1)
Window_sig = x[ind]*win #multiplying our first N samples by our window

Xwin = np.fft.fft(windowSig)
NposFreqs = round(N/2)+1
freqHz = ind[0:NposFreqs]*SR/N

plt.figure()
plt.plot(freqHz,np.abs(Xwin[0:NposFreqs]))
plt.xlabel('Frequency [Hz]')
plt.ylabel('Magnitude')
plt.title('Signal magnitude specturm, N = '+str(N))
plt.show()


texts: Implementation of Block Orthogonal Matching Pursuit (BOMP) Algorithm

texts: How would one implement the Block Orthogonal Matching Pursuit (BOMP) Algorithm in MATLAB?


texts:
If I have two signals $x$ and $y$ and this expression $E\{x[n]y[n-k]\}$, what is the expected value of the product?

I have a basic understanding of EV based on probability, such as $$E[X]=\sum_{i=1}^{\inf}x_ip_i$$ and I understand that EV of flipping coin is 0.5 if $x_1=0$ and $x_2=1$ and both probabilities are 0.5 or for rolling a dice is 3.5 etc.

However, when I see the expression like this the one above, I find it confusing. I don't know for instance where the probability term is.


texts: FFTW: Logical array size in r2r transform?

texts:
I'm taking a multidimensional discrete cosine transform (FFTW_REDFT11) in FFTW, and am unsure how to compute the scaling factor.  According to the documentation, taking the forward and reverse transforms results in the original image multiplied by a scaling factor:

  [C]omputing a transform followed by its inverse yields the original
  array scaled by N, where N is the logical DFT size. For REDFT00,
  N=2(n-1); for RODFT00, N=2(n+1); otherwise, N=2n.

The documentation also defines logical arrays for 1D transforms:

  [I]f you specify a size-5 REDFT00 (DCT-I) of the data abcde, it
  corresponds to the DFT of the logical even array abcdedcb of size 8. A
  size-4 REDFT10 (DCT-II) of the data abcd corresponds to the size-8
  logical DFT of the even array abcddcba, shifted by half a sample.

I'm not sure what n is in a multidimensional transform.  Say I have a 10x10 matrix.  Is n twice the total number of pixels (200)?  Or is it the number of pixels in the image if it were reflected in all dimensions (400)?


texts: Kiss fft does not work after giving it more than 32 samples

texts:
I am trying to take data from an accelerometer and apply Kiss FFT to the samples. I'm using a Freescale Kinetis FRDM-K22F board. I want to use 64 samples, but when I run the program I get an error saying "kiss fft usage error: improper alloc" I started turning down the sample size and saw that the FFT does work with 32 samples, but giving it 33 samples the program just stops and returns no errors. Giving it any more samples gives similar results.

I played around with how I set up the FFT and followed a few websites and forum posts:

KissFFT output of kiss_fftr

http://digiphd.com/programming-reconstruction-fast-fourier-transform-real-signal-kiss-fft-libraries/

Kiss FFT on a dsPIC33

From what I can see, I haven't done anything different from what the above websites and forums have done. I've included my code below. Any help or advice is greatly appreciated.

void Sample_RUN()
{
    int size = 33;
    kiss_fft_scalar zero;
    memset(&zero,0,sizeof(zero));
    kiss_fft_cpx fft_in[size];
    kiss_fft_cpx fft_out[size];

    kiss_fftr_cfg fft = kiss_fftr_alloc(size*2 ,0 ,NULL,NULL);

    signed short samples[size];

    for (int i = 0; i < size; i++) {
        fft_in[i].r = zero;
        fft_in[i].i = zero;
        fft_out[i].r = zero;
        fft_out[i].i = zero;
    }

    printf("Data Collection Begins \r\n");

for(int j = 0; j < size; j++)
{
    for(;;)
    {
        dr_status = My_I2C_ReadByte(STATUS_REG);
        dr_status = (dr_status & 0x04);
        if (dr_status == 0x04)
        {
            //READING FROM ACCEL OUTPUT DATA REGISTERS
            AccelData[0] = My_I2C_ReadByte(OUT_X_MSB_REG);
            AccelData[1] = My_I2C_ReadByte(OUT_X_LSB_REG);
            AccelData[2] = My_I2C_ReadByte(OUT_Y_MSB_REG);
            AccelData[3] = My_I2C_ReadByte(OUT_Y_LSB_REG);
            AccelData[4] = My_I2C_ReadByte(OUT_Z_MSB_REG);
            AccelData[5] = My_I2C_ReadByte(OUT_Z_LSB_REG);

            // 14-bit accelerometer data
            Xout_Accel_14_bit = ((signed short) (AccelData[0]<<8 | AccelData[1])) >> 2;     // Compute 16-bit X-axis acceleration output value
            Yout_Accel_14_bit = ((signed short) (AccelData[2]<<8 | AccelData[3])) >> 2;     // Compute 16-bit Y-axis acceleration output value
            Zout_Accel_14_bit = ((signed short) (AccelData[4]<<8 | AccelData[5])) >> 2;     // Compute 16-bit Z-axis acceleration output value

            mag_accel = sqrt(pow(Xout_Accel_14_bit, 2) + pow(Yout_Accel_14_bit, 2) + pow(Zout_Accel_14_bit, 2) );

            printf("%d \r\n", mag_accel);

            samples[j] = mag_accel;

            break;

        } // end if
    } // end infinite for
} // end for

for (int j = 0; j < size; j++)
{
     fft_in[j].r = samples[j];
     fft_in[j].i = zero;
     fft_out[j].r = zero;
     fft_out[j].i = zero;
}

printf("Executing FFT\r\n");
kiss_fftr(fft, (kiss_fft_scalar*) fft_in,  fft_out);

printf("Printing FFT Outputs\r\n");
for(int j = 0; j < size; j++)
{
    printf("%d \r\n", fft_out[j].r);
}

kiss_fft_cleanup();
free(fft);
} // end Sample_RUN


texts: Defining the SNR or PSNR for color images (3 channel RGB files)

texts:
In image compression applications, I know that for an $8$-bit $0$ to $255$ level grayscale image the PSNR (peak signal to noise ratio) can be defined as:
$$
\text{PSNR} = 10 \log_{10} \frac{\sum_{m,n} 255^2}{\sum_{m, n}|s(m,n)-\hat{s}(m,n)|^2}
$$
where $s$ is the original 2D image and $\hat{s}$ is the reconstructed image (decompressed). My question is how does one define PSNR (or even SNR for that matter) in 3 color space like a 3 channel RGB image, in which each pixel is associated with a 3-tuple $(R, G, B)$, where $R$ is a Byte representing the value of Red channel and so forth, assuming that the image is an 8-bit depth image.


texts: How to mix two signals without changing the overall loudness?

texts:
I have two audio signals that I want to mix at various mixing ratios. Initially, I simply went for something like

$y(t) = \alpha \cdot x_1(t) + (1-\alpha) \cdot x_2(t)$
where $\alpha$ is the ratio between zero and one and $x_1$ and $x_2$ are the two signals.

However, I have seen a few panning curves that did not mix signals linearly. They told me that a linear mix would change the overall loudness while mixing.

Is there something to that or is a linear mix the correct way to do it?


texts:
I'm starting to learn signal processing, and am trying to understand Nyquist rate a bit better.

From what I understand, if I sample at a rate > Nyquist rate I'm supposed to have no data loss.

I'm testing on $\displaystyle f(t)=\sin(2t\pi)$.

To my understanding, its frequency is $1\ \rm{Hz}$, so the Nyquist rate is supposed to be $2\ \rm{Hz}$.

I tried FFT-ing the same function with sampling rates of $3\ \rm{Hz}$ and $10\ \rm{kHz}$ and got different results: (function + FFT displayed on same plot)

Why are the results different? Doesn't the fact that I'm over the Nyquist rate means that the FFTs are supposed to be the same?

This is the code I used in Octave:

x= [0:1/3:4]
x2 = [0:0.0001:4]
f = sin(2*x*pi)
g = sin(2*x2*pi)
subplot(2,1,1)
plot(x,f,x,fft(f))
subplot(2,1,2)
plot(x2,g,x2,fft(g))


texts:
what i know is that for a system to be invertibel it should be one-one ,
but I am confused that if i am given a transfer function of a LTI system how can I prove or verify if it is invertible.

Another query is that can a system has more than one inverse systems , sometime before I used to think that inverse pairs are unique but just solving an example of finding inverse of differentiation as LTI system i came to result that it has got two inverses

1.u(t)

2.-u(-t)


texts:
Sorry if the question looks pretty naive. My goal is to up-sample a given signal x[n] by a factor of M using the zero order hold interpolation function.

The basic idea of up-sampling is to add M-1 zeros after each sample. So that makes sense. That forms MN new samples, where N is the length of the sampled signal x[n]. Now if I want to apply ZOH should I go and hold each sample value for one sample interval? Say if M=2 the above discrete signal would have become like this after applying ZOH:

Is my understanding correct?


texts: What criteria should be used for smoothing

texts:
Actually I have some measurement which I want to get rid of noise
I want to use different filter techniques but I am wondering what criteria I should use to check if I am removing noise or not
or if my selected parameter is optimal.

My measurement is mass spectrometry data.


texts:
I have to calculate periodicity of e^j(2n + π/4)

If cos2n is Aperiodic then what is the periodicity of  cos(2n + π/4) ?
Please explain in steps for beginner!


texts: How to construct Polyphase (Frank) codes in MATLAB

texts:
I have written a piece of code in MATLAB to generate Frank codes - Pastebin link for pulse compression.

I know that Frank codes are stepped frequency approximations to Linear Frequency modulation(LFM).

LFM Parameters are obtained here:

PW = 100e-6;% Pulse Width
PCR = 100; % Pulse Compression Ratio
CPW = PW/PCR;% Compressed pulse width
Fm = 2/CPW; %Frequency sweep

Stepped frequency approximation to LFM:steppedFreq = 0:Fm/(N-1):Fm;
The phase matrix is generated in the line:Matrix = mod(Matrix*incPhi,360);
Frank code is generated inside the for loop: FCP = [FCP,exp(1j*(2*pift + Matrix(i,p)*pi/180))];
The autocorrelation in dB is calculated here:AutoCorrelationdB = 20*log10(abs(AutoCorrelation)/max(abs(AutoCorrelation)));

My question:

The Peak side lobe level obtained is only around $3.5\textrm{ dB}$. Am I following a correct method for generating Frank codes? The peak side lobe level is given by the formula 20*log10(1/(N*sin(pi/M))) as per the book Principles of Modern Radar: Basic Principles by M.A. Richards - Page 825 which is equal to $29\textrm{ dB}$ for my case($N = 100,M = 10$).


texts:
For a given time series which is n timestamps in length, we can take Discrete Wavelet Transform (using 'Haar' wavelets), then we get (for an example, in Python) -

>>> import pywt
>>> ts = [2, 56, 3, 22, 3, 4, 56, 7, 8, 9, 44, 23, 1, 4, 6, 2]
>>> (ca, cd) = pywt.dwt(ts,'haar')
>>> ca
array([ 41.01219331,  17.67766953,   4.94974747,  44.54772721,
        12.02081528,  47.37615434,   3.53553391,   5.65685425])
>>> cd
array([-38.18376618, -13.43502884,  -0.70710678,  34.64823228,
        -0.70710678,  14.8492424 ,  -2.12132034,   2.82842712])

where ca and cd are approximation and detailed coefficients. Now if I use all of them I can construct my original time series back using inverse DWT. But instead I want to use a fewer coefficients (like in Fourier Transform if we use only first few coefficients, we can approximately reconstruct the original time series). If I just use ca or just use cd I don't get the desired results. If I use only we coefficients from each of them (like first 4), I get only half of the time series.

How should I select the coefficients (from ca and cd) so that I can approximately create the original signal from them (i.e. most of its energy)?


texts: RADAR Video Signal and Matched Filtering

texts:
In order to make my question more clear and give more details
I'm trying to understand the processing signal procedure in radars,i understood till this moment that a transmitter generates a signal called transmitted signal with a center frequency and then when this signal meets a target an echo signal reflected to radar and captured with a received stage including many RF and non RF components.After amplification and noise rejection with LNA a mixer is used to melange received and transmitted signal to produce a signal called video signal and then the signal processing stage take place.
My question are : can anyone explain me what's the role of the matched filter in radar signal processing stage what are the alternatives methods?


texts: Choices of convention and notation for the Fourier transform?

texts:
The definitions of the Fourier transform and inverse Fourier transform I learned in college were

$$
F(j\omega) = \int_{-\infty}^{\infty} f(t) e^{-j\omega t}\ dt
$$
$$
f(t)=\frac{1}{2\pi}\int_{-\infty}^{\infty}F(j\omega)e^{j\omega t} d\omega
$$

The salient characteristics of this convention are

Non-unitary transform; frequency-domain units are radians (variable is $\omega$)
"Time-domain" units are in time (variable is $t$)
Function transforms are denoted by capital letters ($F$ vs. $f$)
The $j$ in $F(j\omega)$ strictly denotes that the function is a Fourier transform
And of course, the usual EE convention that $j=\sqrt{-1}$.

Nowadays I use a much different convention, essentially that used on
the wikipedias:

$$
\hat{f}(\xi) = \int_{-\infty}^{\infty} f(x) e^{-j2\pi\xi x}dx
$$
$$
f(x) = \int_{-\infty}^{\infty} \hat{f}(\xi) e^{j2\pi\xi x} d\xi
$$
The characteristics of this convention are

Unitary transform; frequency-domain units are normalized frequency (variable is $\xi$)
"Time-domain" units are unitless (variable is $x$)
Function transforms wear hats ($\hat{f}$ vs. $f$)
Variables in the Greek alphabet denote transformed variables in the Latin alphabet ($\xi$ vs. $x$)

I greatly prefer this convention for several reasons.

Using a unitary convention greatly increases the symmetry and clarity of Fourier duals:
compare

$\mathrm{rect}(x)\leftrightarrow\mathrm{sinc}(\xi)$,
$\mathrm{sinc}(x)\leftrightarrow\mathrm{rect}(\xi)$ to
$\mathrm{rect}(t)\leftrightarrow\mathrm{sinc}(\frac{\omega}{2\pi})$,
$\mathrm{sinc}(t)\leftrightarrow\mathrm{rect}(\frac{\omega}{2\pi})$.

Using $x$ instead of $t$ for the "time-domain" variable makes the equations more
agnostic of one's problem domain. This makes it much easier to analogize about
2D image processing concepts in terms of 1D signal processing concepts, without
the cognitive dissonance of using $t$ as a variable representing
distance, or having to change variables around when going from one domain to the other.
I find capital letters to be more useful for denoting discrete-valued variables/functions than for representing transformed functions.
Using the hat more clearly denotes the Fourier transform as an operator that is
applied to $f$, where the resulting function accepts a frequency-domain parameter $\xi$. Compare this to the far more ungainly $\mathcal{F}\{f\}$, the
"traditional" way I learned in college to denote the Fourier transform as an operator,
which just seemed way too confusing to me at the time ($\mathcal{F}{f(t)}$ vs
$\mathcal{F}\{f\}(t)$ vs $\mathcal{F}\{f\}(\omega)$ etc.)
I generally found that doing signal processing analysis with radians just sprinkled
a lot more $\pi$s around than I felt necessary. Using units of normalized frequency
makes a lot more sense to me, particularly when working through problems involving
sampling theory.

Of course, it would be quite vain of me to consider my choice of convention to be
superior to that used by others. But I'm having a hard time coming up with good
reasons to prefer the convention I originally learned in college (ie, reasons
that don't involve tradition).

Presently, I can think of one decent reasons for preferring the "traditional" convention:
Using the non-unitary transform, and the $F(j\omega)$ parameter notation, greatly
improves notaional consistency with the
Laplace transform. Also, hats might be easier to lose/confuse than capital letters.

Can anybody think of other reasons to prefer the "traditional" (non-unitary) convention?
Is this "traditional" convention the same as what you learned a signal processing course
(if you took one)?
Which convention do you prefer?


texts: Impulse response with sweep from measurement

texts: Does someone have a matlab script to get the impulse response from the recorded measurements using log sweep? I have the input file (sweep) and the output and I need to get the impulse response and then calculate reverberation times for octave bands.


texts:
I have a general task of discriminating images of shaded cylinders that significantly vary in 3d orientation, and almost insignificantly in size and shape.

I have treated it as a regression problem on a dataset of these oriented cylinders, but my problem is with feature computation for each sample.

Basically, what is a good way to estimate the gradient orientation from the shading of cylinders on these images?

Having limited experience, I have trouble understanding what linear or non-linear filters I should apply, so that they would be gradient-sensitive and compute orientation discriminatively for this task.

The sample image is given here(each cylinder image in a dataset is distinct):


texts: How to implement a $j$-level $M$-band wavelet transform of an image?

texts:
I want to implement an $M$-band (or multi-band) wavelet transform, to be used for feature extraction on images.

Is there a built-in Matlab function available?
Do I have to implement is using filter coefficients?
Where can I get filter coefficients for $M$-band wavelets?


texts: What method to use for interpolation and extrapolation?

texts:
Below are discrete samples { t1, f(t1) }, { t2, f(t2) }, ... ,{ tn, f(tn) } using Mathematica syntax.

{{7.0,0.354887404925574},{7.3,0.4003399403324751},
{7.6,0.5849632195845474},{7.9,0.8785638270289906},
{8.2,1.235637591701261},{8.5,1.6025351028031707},
{8.8,1.925797159944803},{9.1,2.160385431197419},
{9.4,2.276553177467603},{9.7,2.2643104784151262},
{10.0,2.1348061618705962},{10.3,1.9184189440030162},
{10.6,1.6598520161702173},{10.9,1.4109826017641867},
{11.2,1.2225616685298717},{11.5,1.1360369427321668}}

Now I plot the samples.

The samples are from a bandlimited function f(t) that I defined. However, suppose they are discrete samples of an unkown function, but we know the Fourier spectrum of f(t) is band-limited to frequencies 0.25 Hz and below. What would be a good method to use for interpolating between the samples and extrapolate beyond the samples?  Here  I mentioned that polynomial interpolation has less error than cubic spline interpolation in a case like this? What method would have even less approximation error in a case like this?


texts: How to compute generator matrix from a parity check matrix?

texts:
I have a parity matrix ("H") that is not in canonical form (the identity matrix is not on the right side).

I'm trying to programatically calculate the generator matrix ("G") from it.

The Wikipedia entry on Hamming codes talks about the relationship between parity check matrixes and generator matrixes:

http://en.wikipedia.org/wiki/Hamming_code

It says that H*transpose(G)=0

I thought I could figure out G by taking the Nullspace of H.  However, I end up with many fractional numbers and don't know how to use that.  The examples I've seen use gauss-jordan elimination to put the matrix into row-echelon form.  However, shouldn't I be able to do it numerically using svd or something like that?

Here's some code where I multiply a message by a generator matrix (the example is taken from Wikipedia).  I would like to get the same message when I multiply by the generator that I have calculated.

import numpy as np
import scipy.linalg

def nullspace(A, atol=1e-13, rtol=0):
    A = np.atleast_2d(A)
    u, s, vh = np.linalg.svd(A)
    tol = max(atol, rtol * s[0])
    nnz = (s >= tol).sum()
    ns = vh[nnz:].conj().T
    return ns

H = np.mat( [[1,1,1,1,0,0],
             [0,0,1,1,0,1],
             [1,0,0,1,1,0]] )

G = np.mat( [[1,0,0,1,0,1],
             [0,1,0,1,1,1],
             [0,0,1,1,1,0]] )

M = np.mat( [1,0,1] )

print "Message * generator=", M*G

GT2 = nullspace(H)
G2 = GT2.T

print "Message * calculated generator=", M*G2


texts: How to change the FFT phase domain of each frame by 90 degrees

texts:
I have read a signal in Matlab, resampled and implemented an FFT of each frame on it, now I want to rotate the domain of phase in each frame 90 degrees.

I have a vector of FFT and used the function named rot90(matrix), that rotates a matrix 90 degrees, but I'm not sure it is what I wanted to work correctly on my function.

How can I do that in some other way?  Or does the rot90 correctly work on changing the phase of domain in FFT which has been imported into a vector?


texts: Is there a way to use decimation or linear interpolation to shrink or stretch an audio signal in the time domain?

texts:
I am able to shrink/stretch an audio signal using Python code for a phase vocoder, as well as the stretchAudio function from Matlab's Audio Toolbox. Although both methods do indeed alter the audio signal in the time domain without changing the pitch (which is what I want), both methods damage the spectral structure enough that the sound quality becomes metallic and reverberant, which is not acceptable for the experiment I need to conduct.
I have been told that it is possible (though unorthodox) to shrink and stretch the signal with no unwanted artifacts by using decimation and linear interpolation. Unfortunately I cannot imagine how to do this. I'll appreciate any information or explanations you can offer. Ideally I'll be able to implement this in Python or Matlab.


texts: Applying Nyquist theorem to digital vs. analog audio quality

texts:
I had a recent conversation with a friend about analog vs. digital recordings.  He shared his opinion that music recorded by analog techniques is of superior sound quality to music recorded by digital techniques.  His reasoning was that whenever music is turned into digital, not all of the information is captured, and thus, some of the music is lost.

I was not too sure about his statements as I recently took a DSP course and learned a bit about the Nyquist-Shannon theorem.  As human hearing is typically in the range of 20 Hz to 20 kHz, I was under the impression that the common sampling rate of 44.1 kHz should be enough to capture all information that is needed to reproduce the sounds that we can hear.  Therefore, I thought that differences between music reproduced from digital and analog should unnoticeable to human ears.

Who is correct?  If anyone, could shed some light on this and clear up any misunderstandings, I would greatly appreciate it.  Thank you very much.

By the way, I am new to Stack Exchange, and I have already tried to find similar questions but to no avail.  Hopefully, this is not a repost.


texts: Are there any advantages of a cascaded FIR vs direct form FIR?

texts:
I've been reading up on a few different realizations of FIR filters and recently came across the concept of a cascaded FIR filter. That is, an FIR filter of higher order, represented by a cascade of second order direct form FIR filters.

What are the advantages of using a cascaded FIR filter over a direct form FIR filter? Does it help reduce quantization errors?

I'm also somewhat familiar with IIR filters being implemented as cascaded second order filters. Are there similarities between this and a cascaded FIR filter?


texts:
Let: $Y=|X_1+X_2|^2$ with $X_1 \sim N(\mu_1,\sigma_1^2)$ and $X_2 \sim N(\mu_2,\sigma_2^2)$. $X_1,X_2$ are independent complex random variables. Consequently, $Y=Re(X_1+X_2)^2+Im(X_1+X_2)^2$

My question:
Does Y follow a Rice law? I know that $Re(X_1+X_2)$ and $Im(X_1+X_2)$ follow gausian law.


texts: I have been assigned responsibility as Lab instructor of DSP at undergrad Level and so i have to equip my lab,please recommend which processors should i purchase for hardware implementation of dsp concepts


texts: Why use Active Contours segmentation (snake) over Level Sets segmentation and vice versa in image processing?

texts:
I am reading about segmentation and I cannot seem to figure out why use active contours over level sets and vice versa. Basically the way I understood it, level sets is relatively the same segmentation method as the snake method but in a higher dimension.

What is the benefit of using one over the other?


texts: Why delete high frequence in fft return the area of the most changes?

texts:
I'm new to ||image-processing|| and || fft filters ||

I have a relative smooth $\mathtt{2D}$ (circle) gaussian surface (height $10$) with several "holes" in it, and the surrounding area [has] some noise (height below $0.5$).

Here's what I did, I transfer[ed] the matrix $\mathcal{A}$ with $\mathcal{A}_f= \text{fftshift}( \text{fft}(\mathcal{A}))$, then I used the for loop to delete all the high frequency component, delete the component with magnitude compar[able] to DC component ($\approx 2.5\mathtt{e}5$), i.e. if $\mathcal{A}_f(i,j) > 1\mathtt{e}3$ , then [set] $A_f(i,j)=0$.

Then, I did a backwards transformation $\mathcal{A}_\text{result}=\text{ifft}(\text{ifftshift}(\mathcal{A}_f))$.

What's so interesting is that, $\mathcal{A}_\text{result}$ clearly identified all the holes (the region with the most changes) as [spikes], and the rest of the graph is almost $0$ with some noises.

My question is that:

What happened here? Why the image returns the value of holes as [spikes]?
Is there any other way to identify the holes with Fourier or convolution filter?


texts:
Does the length of a Fourier Transform affect the ability to discern a small event in the data?

This is a tricky question to ask, let me clarify. I don't care about when the event happened and I don't care about the resolution of the event (it doesn't have to be some precise measurement) but I want to SEE the event. I realize short events/pulses will affect the results in a weird ways, but it doesn't matter, I just want to know some event/pulse happened. Will the length of an FFT affect how long this event/pulse needs to be before I become aware of it?


texts:
I sample a signal at a certain frequency for a finite amount of time to get a sequence $$(x_n)_{n=1}^N = (x_1, x_2, ... , x_N)$$

with the intention of analyzing its power spectral density by calculating its DFT.

I decide that the tail end of the sequence shouldn't be analyzed (that is, I want to discard all $x_n$ for $n\gt a$ for some $a\leq N$), but I want the DFT to have the same number of samples (in this case, $N$ samples).

One approach would be to truncate the sequence at $x_a$, remove the mean, apply a Hamming window to this truncated sequence, pad the truncated sequence with $N-a$ zeroes, and then calculate its DFT.

Question: Let's say that the section I don't want to analyze is an interval in the middle of the sequence. How do I calculate the DFT of this and make sure the DFT has $N$ samples? Should I remove the mean, apply two Hamming windows (one each on each section I don't want to discard), set the elements in the middle that I want to discard to zero, and calculate the DFT?

This is related to my other question here.


texts: I have seen this notation in the book Schaums-Outline a couple of times now and I can't quite understand it. I'd very much appreciate if someone explained what it means. I am thinking that it means Transform, as in the input goes in the system and transforms? Thank you very much!


texts: Simple FFT filtering vs. e.g. butterworth filtering

texts: I am currently working on functional connectivity analysis of EEG, and need to bandpass filter my data into different frequency bands (Delta, Theta, Alpha and Beta). An important thing is that the filter doesn't cause phase distortion. I know a butterworth filter and processing the data in both the forward and reverse directions (e.g. with filtfilt in Matlab) is a good approach, however I was still wondering about the simple FFT/IFFT filtering approach. What are the exact disadvantages of this method? Does this method cause phase distortions? What are 'edge effects' that occur with this method?


texts:
I was posed the following homework problem:

  2.10 The following input-output pairs have been observed during the operation of a time-invariant system:
  \begin{align}
x_1(n)&=\{\underset{\uparrow}{1}, 0, 2\}\overset{\mathcal T}{\longleftrightarrow} y_1(n)=\{\underset{\uparrow}{0}, 1, 2\}\\
x_2(n)&=\{\underset{\uparrow}{0}, 0, 3\}\overset{\mathcal T}{\longleftrightarrow} y_2(n)=\{\underset{\uparrow}{0}, 1, 0, 2\}\\
x_3(n)&=\{\underset{\uparrow}{0}, 0, 0,1\}\overset{\mathcal T}{\longleftrightarrow} y_3(n)=\{1,\underset{\uparrow}{2}, 1\}\\
\end{align}
  Can you draw any conclusions regarding the linearity of the system ? What is the impulse response of the system ?

I thought that I had a decent grasp on linearity and time-invariance, but I am having trouble relating them to a specific problem.  I know that linearity means that the system satisfies the superposition principle - and that the weighted sum of the input signals is equal to the weighted sum to each output signal.

How do I apply that to this problem?  I have the solution below, but I am unsure how they get there:

  2.10

  The system is nonlinear. This is evident form observation of the pairs
  $$x_3(n)\leftrightarrow y_3 (n)\text{ and }x_2(n)\leftrightarrow y_2(n).$$
  If the system were linear, $y_2(n)$ would be of the form
  $$y_2(n)=\{3, 6, 3\}$$
  because the system is time-invariant. However, this is not the case.


texts:
I have a bandpass signal x. I am taking hilbert transform of it. I want to reconstruct amplitude and phase of the signal.Therefore, i am using Hilbert transform.

hil = hilbert(x);

f = ?

amp = abs(hil);

figure, plot(f,abs(hil);

phase = angle(hil);

figure, plot(f,angle(hil)

Here how to define the frequency axis, so i can get the amplitude graph 's length equal to my bandwidth. Moreover, is this the correct way for amplitude and phase reconstruction? My bandwidth is here 40 KHz. Thank you everyone in advance


texts:
I use emgucv (an opencv wrapper) to find circles in image.

To test it, I drew a circle on image in photoshop.

I used HoughCircles algorithm with a very small distance between circles' centers and big range of radiuses.

It found a lot of circles where no one should be and didn't find the one I drew.

Am I missing something?

Original Image:

Result of circles detection:

Source:

static Image<Bgr, byte> detect_circles(Image<Bgr, byte> original)
{
    Image<Bgr, byte> res = original.Copy();
    CircleF[] circles =
        res
        .Convert<Gray, byte>()
        //.SmoothGaussian(9)
        .HoughCircles(new Gray(100), new Gray(100), 1, 0.1, 1, 150)[0];
    res = res
        .Convert<Gray, byte>()
        //.SmoothGaussian(9)
        .Convert<Bgr, byte>();
    foreach (CircleF circle in circles)
        res.Draw(circle, new Bgr(Color.Cyan), 2);
    return res;
}

Parameters of HoughCircles are described here http://www.emgu.com/wiki/files/1.4.0.0/html/6f78c3d8-fb1a-5983-2862-549c49019d49.htm

I understand why it detects circles many times - the minimal distance between centers is really small, but why isn't the yellow circle detected?

EDIT
Lowering radius to 75 or less eliminates all circles.

I played with tresholds and set parameters to HoughCircles(new Gray(200), new Gray(75), 1, 10, 5, 150)[0];, but results are still poor with house image:

However, it detects black and white circle:

Currently, I'm trying to detect circles without HoughTransform


texts: How the power spectral density changes under frequency scaling?

texts:
Let the power spectral density PSD of a random process be
$$\phi(w) = \sum_{k = \infty}^\infty r(k)e^{-i\omega k}$$
where $\omega \in [-\pi,\pi]$ and $r(k)$ is the correlation function. I have to show that under a re-scaling of the frequency
$$\omega = \bar\omega T_s$$
the PSD changes as follows
$$\bar\phi(\bar\omega) = T_s\phi(\bar\omega T_s) = T_s\sum_kr(k)e^{-i\bar\omega T_s k}$$
My guess:
I tried to obtain an expression for $r(k)$ under the same re-scaling, if I can obtain something like $\bar r(k) = T_sr(k)$ then it is proved. So from the expression for the autocorrelation function
$$r(k) = \frac{1}{2\pi}\int_{-\pi}^{\pi}\phi(f)e^{ifk}df = \frac{T_s}{2\pi}\int_{-\pi/T_s}^{\pi/T_s}\phi(\bar f T_s)e^{i\bar{f} T_sk}d\bar f$$
I am highly tempted to say that this is $T_s r(k)$ but I am lying to myself.


texts: VHDL fixed point implementation of IIR filter

texts:
I have a filter described by the following transfer function H(z):

$$H(z) = \frac{156 - 156z^{-2}}{16384 - 32443z^{-1}+16073z^{-2}}$$

How will this be implemented with the first term in the polynomium being different from 1?

Normally i would implement the filter with something like:
$$y[0]=156\cdot x[0]-156\cdot x[2] +32443\cdot y[1]-16073\cdot y[2]$$

but in this case, it is missing the term:
$$-16384\cdot y[0]$$

How may this term be inserted? I have tried just inserting it, inserting and shift the y's by 1. I just get noise doing this (looks like overflow).

It is to be implemented in VHDL on a FPGA.


texts: I have read in my textbook and i don't understand this part, that the Direct Form II implementation of an IIR filter is a bit tricky in memory addressing.There is need of clever memory addressing.  Memory is the place that we store partial summations(states of the filter). Anyone that understands the problem and explain to me?


texts: Estimate process error for Kalman filter on financial data

texts: I'd like to apply a Kalman filter, using Octave, to financial data but due to the nature of the data it will be difficult to impossible to specific the process error in advance of applying the filter. Can anyone suggest a way to specify the process error online from the incoming data simultaneously with the calculation of the filter itself? I'm trying to adapt the code from this website to suit my purposes.


texts: Estimation of accelerating target using position measurements only

texts:
I am currently thinking about approaches to estimating the position and velocity of an accelerating target.

At this time, I have tried a few approaches that work alright. I have tried two variations of Kalman filters, the first where it estimates position and velocity given the following:

Dynamics:
\begin{align}
\dot{x} &= v + \eta_1\\
\dot{v} &= \eta_2
\end{align}
Measurement:
$$y = x + \eta_3$$
where $\eta_i$ are noise from a Gaussian distribution.

The other Kalman Filter approach was based on the following:

Dynamics:
\begin{align}
\dot{a_1} &= \eta_1\\
\dot{a_2} &= \eta_2
\end{align}
Measurement:
$$y_{i+1} = y_{i}+a_1 \Delta t + a_2 \frac{\Delta t^2}{2}$$

I also implemented a filter using local regression based on the last $N$ position samples in the time series.

All of these filters do fairly well, but I still question if there might be something better. I have tried looking for any papers or lectures on the subject but struggle to find anything worthwhile.

One other thing that coworker and myself discussed was potentially using Euler's Equation for Rigid Body Dynamics to add some constraints into a target's ability to turn too rapidly based on using a ballpark inertia matrix (assuming we're going after a small car).

This obviously makes the dynamics nonlinear and would push us to using something like an Unscented Kalman filter. Does anyone know whether this would be worth it? We suspect it could help our estimate not make any unrealistic jumps that it might otherwise make with the purely linear model, but don't know if this would make a big enough difference.


texts: How do we find the capacity of MIMO wideband point to point system?

texts:
This question is in the context of digital communication .

In many text books (wireless communication), when people derive the capacity of point to point communication system (one transmit one receive end) with multiple transmit and multiple receive antennas, people consider the narrow band flat fading channel. Below I write down the output equation of system with $N$ transmit antennas and $M$ receive antennas

$${\bf Y_{M\times 1} = H_{M\times N}X_{ N\times 1}+ Z_{M\times 1}}$$

The solution to find the maximum capacity is to do Singular Value Decomposition (SVD) of the channel as follows

$${\bf  H = U D V^H}$$

The transmitter uses matrix ${\bf V}$ that is the transmit signal is
$${\bf X'= VX}$$ while the receiver uses matrix ${\bf U}$ as follows

$${\bf Y'= U^HY}$$

My question is what about wideband channels, time varying frequency selective channels that is systems with channel such as

$${\bf H_{M\times N}(t)} \,\,\,\,\,\, t =0... T_{Delay}$$

How do we find the  MIMO capacity of such channels.
In one case, I think once can assume multicarrier (OFDM) system and divide the wideband channel into smaller narrow band and apply the algorithm I mentioned above. But what if its not multicarrier system? What is the optimal scheme, what should the transmitter and receiver do?

Thank you in advance


texts: Python scipy.signal.wiener filter for speech processing

texts:
As far as I know Wiener filter can be used in Image processing.I wonder that if i can use Python scipy.signal.wiener() for speech processing as well.

Thanks in advance.


texts: Determining Type and Bandwidth of a filter

texts:
Given a filter, if it is given as an equation such as:

$$f(x,y) = \left(\frac{\partial^2}{\partial x^2} + \frac{\partial^2}{\partial y^2}\right) \exp\left(-\frac{x^2 + y^2}{\sigma^2}\right)$$

Or in a kernel such as:
$$
\left[\begin{array}{rrr}
0 & 1 & 0 \\
1 & -4 & 1 \\
0 & 1 & 0
\end{array}\right]
$$
How much can I find out about the filter. Specifically can I find out if it is a highpass/ lowpass/ bandpass filter (if so how?), and can I find out the bandwidth of the filter?

If it helps, the context is image processing.

Thanks


texts:
In a book Conceptual Wavelets in Digital Signal Processing by Lee Fugal 2009 on page 246 the author talks about aliasing present in DWT subbands due to downsampling by 2 and states:

  Recall from DSP that for a signal at 0.3 Nyquist aliasing from
  downsampling will "reflect" the signal across Nyquist. Thus we see the
  aliasing components at Nyquist minus 0.3 Nyquist or 0.7 Nyquist.

I thought it was safe to downsample a signal below 0.5 Nyquist by 2, isn't that correct ?
Also on the image below the signal at 0.3 Nyquist and the alias at 0.7 Nyquist have different amplitudes.

I would think the aliasing in approximations can only occur because of imperfect filtering i.e. because some of the high frequencies above 0.5 Nyquist were also captured before downsampling by 2.
But the author also shows using UDWT ( undecimated DWT ) with the same filters that without downsampling approximations after filtering have only frequencies around 0.3 Nyquist:

So where does aliasing come from in DWT in this example?


texts: Z transform getting different answer for transform of rational function

texts:
Why am i getting different answers and which one is correct??

In this also


texts:
So I have this school project where my aim is to improve a loudspeaker in general, my idea is to mesure the impulse response of the room using a mic, then use this mesure to conceive a loudspeaker that can compensate the effects of the room.
My question is how could I exploit the room impulse response in conceiving that filter let's, and what kind of filters should I use? would that even be possible?

PS: sorry if the question sounds dumb, I have zero experience and knowledge with this kind of stuff.

Thanks in advance!


texts: What information is lost, if any, in normalizing Seismic/Earthquake time-frames in an STFT to equal variance?

texts:
This might be more of a statistical question, but let us assume that we take a spectrogram, or STFT, where time is on the x-axis, and frequency is on the y-axis in this matrix. What information might be lost - or 'changed', if we decide to normalize each column by its own standard deviation, so that the variance of each column is equal to 1.

I understand that we would not be able to see sudden changes in overall power changes over time, etc, that is obvious, but what other features might be contorted and/or lost if we did this?

Thanks.


texts: How to prevent "zipping" effect on a modulated fractional audio delay line? (Flanger)

texts:
I am implementing a Flanger using a fractional delay line.  I am modulating the length of the delay line using a sin function.  The delay line already uses linear interpolation to compute the delay output for the fractional sample.

When the delay length is decreasing (and pitch is increasing), the modulated length sounds just about perfect, with no artifacts.  However, when the delay length is increasing (and pitch is decreasing), I am getting a kind of "zipper" effect, with intermittent clicks, that one would expect from a non-interpolated delay line, as if sharp edges are being produced.

My guess is that I need to do additional interpolation beyond the simple fractional interpolation, but I have some questions.

First, why would I only hear artifacts during the period where my modulated delay length is decreasing?

Second, what is the best method to reduce these artifacts?  My first instinct is an all-pass filter, but is it typical to use an all-pass filter as well as an interpolation over a fractional delay length?  I just want to make sure I'm getting it right, and not wasting unnecessary cpu cycles :).

Some code will help.  In this code, config holds all delay line info, and delaySamples is the current working length of the delay line.  There are two read pointers, two write pointers, and two feedback values - one for each channel.  Thanks for taking a look!

void delayconfig_setDelayTime(DelayConfig *config, float delay) {
    config->delayTime = delay > 0 ? (delay <= 1 ? delay : 1) : 0;
    if (config->delayTime < 0.0001) config->delayTime = 0.0001;
    config->delaySamples = config->delayTime*SAMPLE_RATE;
    int channel;
    float *rp, *wp;
    pthread_mutex_lock( &delayMutex);
    for (channel = 0; channel < 2; channel++) {
        rp = &(config->rp[channel]);
        wp = &(config->wp[channel]);
        *rp = *wp - config->delaySamples;
        while (*rp < config->delaySamples) {
            *rp += config->delaySamples;
        }
     }
     pthread_mutex_unlock( &delayMutex);
}

float interp(float *delayBuffer, float delaySamples, float position) {
    position = fmod(position, delaySamples);
    int prev = floorf(position);
    int next = fmod(ceilf(position), delaySamples);
    float frac = position - prev;
    return delayBuffer[prev] + frac*(delayBuffer[next] - delayBuffer[prev]);
}

void delay_process(void *p, float **buffers, int size) {
    DelayConfig *config = (DelayConfig *)p;
    float out;
    int channel, samp;
    float *wp, *rp;
    for (channel = 0; channel < 2; channel++) {
        rp = &(config->rp[channel]);
        wp = &(config->wp[channel]);
        for (samp = 0; samp < size; samp++) {
            // here is where I'm changing my delay length.  The values are tentative while I'm figuring this out, and aren't really improtant.
            // The important thing is thing is that it's a sin function
            delayconfig_setDelayTime(config, 0.0061f + 0.006f*sin(M_PI*config->count++*INV_SAMPLE_RATE));
            pthread_mutex_lock(&delayMutex);
            if (*rp >= config->delaySamples) (*rp) -= config->delaySamples;
            if (*wp >= config->delaySamples) (*wp) -= config->delaySamples;
            float interpolated = interp(config->delayBuffer[channel], config->delaySamples, (*rp)++);
            int wpi = floorf((*wp)++);
            pthread_mutex_unlock(&delayMutex);
            out = interpolated*config->wet + buffers[channel][samp]*(1 - config->wet);
            if (out > 1) out = 1;
            config->delayBuffer[channel][wpi] = buffers[channel][samp] + out*config->feedback[channel];
            buffers[channel][samp] = out;
        }
    }
}


texts: why there is no 0 on the right side? (matlab, low pass filter)

texts:
I took even number of sample (in this case 6) from sinc, hamming window, and multiple of those two.
then after fourier transform, frequency-domain variables have zero only left side, in this case its x is -pi.
I'm wondering why there are no zeros in right side (where x = pi), and has positive value.

here's my work using fourier transfrom


texts:
I was reading in a book that  below stated are the Properties of Discrete-time Sinusoidal Signal:

Property 1. The discrete time sinusoids whose frequency are separated by an integer multiple of 2$\pi$ are identical.

Property 2. The frequency of oscillation of discrete time sinusoids sequence increases  as $\omega$ increases from 0 to $\pi$. If $\omega$ is increased from $\pi$ to 2$\pi$ then frequency of oscillation decreases.

I was able to understand the mathematical property implementation of above two property but have some basic questions for clarification:

Is it that the above properties are applicable for all Discrete-time periodic Signals?
As per property 1 - if two sinusoids signal has frequency separated by integer multiple of 2$\pi$ - then the signal having the greater frequency will have more cycles than other. Then how they both can be same?
As per property 2 - what is meant by "frequency of oscillation"? How can a frequency of a signal vary (increase) from 0 to $\pi$ and (decrease) from $\pi$ to 2$\pi$ - isn't it should be same from 0 to $2\pi$?


texts:
If a practical filter can't remove all unwanted frequency components like ideal filter, does that  mean unwanted frequency component are still present after filtering?

how can we use such distorted output in practical use ?


texts:
Hello i'm trying to implement a basic TDOA without noise and solve the hyperbolic TDOA equations using Fang's solution but i end up with a complex number as a coordinate (negative solution), what can i do to fix this.?
Here are the steps i follow :
1- I create a signal and i add different delays to the signal, so i end up with 3 signals having a delays of 5 10 5 microseconds delay of the original signal
2- I do a crosscorrelation to extract the timing difference (delays) T12 T13 T23
3- I convert GPS locations of the 3 simulated sensors to x, y coordinates
4- I use Fang algorithm to get the x, y coordinate of the emitter
here is my code, what did a do wrong ?
    clear;clc;

%tx signal
c = 3*1e8;
Fs = 1000000;
Fsig = 10000;
t= 0:1/Fs:0.001;
A=2;
sig = A*cos(2*pi*Fsig*t);
signoise = sig + 2*randn(size(t));
figure();
plot(t,sig)

%delayed signals
siga = delayseq(sig',5*1e-6,Fs);
sigb = delayseq(sig',10*1e-6,Fs);
sigc = delayseq(sig',15*1e-6,Fs);
%noise delayed signals
signoisea = delayseq(signoise',5*1e-6,Fs);
signoiseb = delayseq(signoise',10*1e-6,Fs);
signoisec = delayseq(signoise',15*1e-6,Fs);
figure();
plot(t,siga)
figure();
plot(t,signoisea)

%cross correlation
[Cab, lagab] = xcorr(siga,sigb);
[Cac, lagac] = xcorr(siga,sigc);
[Cbc, lagbc] = xcorr(sigb,sigc);
[Cnab, lagnab] = xcorr(signoisea,signoiseb);
[Cnac, lagnac] = xcorr(signoisea,signoisec);
[Cnbc, lagnbc] = xcorr(signoiseb,signoisec);

figure()
subplot(311);plot(lagab,Cab/max(Cab))
subplot(312);plot(lagac,Cac/max(Cac))
subplot(313);plot(lagbc,Cbc/max(Cbc))

figure()
subplot(311);plot(lagnab,Cnab/max(Cnab))
subplot(312);plot(lagnac,Cnac/max(Cnac))
subplot(313);plot(lagnbc,Cnbc/max(Cnbc))

%time delays
[~,Iab] = max(abs(Cab)); Tab = lagab(Iab); % divide by FS
[~,Iac] = max(abs(Cac)); Tac = lagac(Iac);
[~,Ibc] = max(abs(Cbc)); Tbc = lagbc(Ibc);
[~,Inab] = max(abs(Cnab)); Tnab = lagnab(Inab);
[~,Inac] = max(abs(Cnac)); Tnac = lagnac(Inac);
[~,Inbc] = max(abs(Cnbc)); Tnbc = lagnbc(Inbc);

%distance between receiving nodes
R21 = (c*abs(Tab))/Fs ; R31 = (c*abs(Tac))/Fs ; R23 = (c*abs(Tbc))/Fs ;

% solve equations
%coordinate of simulated target
%TX +33.667103, -7.361047
%coordinates of sensors
rx1_lat = 33.669804 ; rx1_long = -7.376904 ;
rx2_lat = 33.649544 ; rx2_long = -7.336493 ;
rx3_lat = 33.700279 ; rx3_long = -7.333216 ;
[geo_ref_lat,geo_ref_long ] = georef(rx1_lat, rx2_lat, rx3_lat, rx1_long, rx2_long,rx3_long);
[ x1,y1 ] = latlong2xy( rx1_lat, rx1_long, geo_ref_lat, geo_ref_long );
[ x2,y2 ] = latlong2xy( rx2_lat, rx2_long, geo_ref_lat, geo_ref_long );
[ x3,y3 ] = latlong2xy( rx3_lat, rx3_long, geo_ref_lat, geo_ref_long );
x1 =0; y1=0; x2=640; y2=0; x3 =-320; y3=100;

%linear coefficients
g =((R31*(x2/R21)) - x3)/y3;
h=((x3*x3)+(y3*y3) - (R31*R31)+ R31*R21*(1 - (x2/R21)^2))/(2*y3);
%quadratic coefficients
d = -(1 - (x2/R21)^2 + g^2);
e = x2*((1 -((x2/R21)^2))-2*g*h);
f = ((R21^2)/4)*(((1-((x2/R21)^2))^2)- h^2);
%target coordinate calculation
rx = (-e - sqrt(e^2 - 4*d*f) )/ 2*d;
rrx = (-e + sqrt(e^2 - 4*d*f) )/ 2*d;
if rx > 0
    x=rx;
else
    x =rrx;
end
y = g * x + h;
[lat, long] = xy2latlong( x, y, geo_ref_lat, geo_ref_long )


texts: Calculating poles with complex numbers and quadratic equation

texts:
given: $z^2 + 0.8 \sqrt2 z + 0.64 = 0 $

Then, I am using the quadratic equation:

$ z_{1,2} = \frac{-0.8 \sqrt2 \pm \sqrt{(0.8\sqrt2)^2-4 \cdot 0.64}}{2} $

Wolfram Alpha says it the end there should be: $-0.4 \sqrt2 \pm j 0.4 \sqrt2$, but I get something different:

$$ = \frac{-0.8\sqrt2\pm0.8\sqrt2-2\cdot0.8j}{2} $$
$$ = -0.4\sqrt2\pm0.4\sqrt2-1.6j$$


texts: Is Kalman Filter for LTV systems applicable on Hybrid systems?

texts: As all of us know Kalman Filter is designed for LTV (Linear Time Variant) systems. But nobody in the literature applies that on Hybrid systems. In my opinion Linear Hybrid systems are a subset of Linear Time Variant (LTV) systems, So my question is why don't people use Kalman Filter for Hybrid systems with linear modes and resort to robust estimation approaches?


texts:
hi i'm going to design a low pass FIR filter for an EEG signal for the detection of eppileptic siezure and i want to know what is the suitable design Method to the filter? i need this FIR filter just to smooth the signal to use it for discret wavelet transform.
thanks


texts:
I want to know why the single-side band phase noise is more customary rather than dual-side band phase noise?(even both side band are not the same)

In addition, Could you explain this sentence according to formula for phase noise measurement problems?


texts: How to extract the people and objects from an image separately?

texts:
For example, I have an image

There are 7 people in the image and one apple and a bird.
How can I extract every person and every object from this image and put the 7 people and 2 objects into 9 different new images? How can I also identify which is person and which is object?


texts: What is the "pitch marker" in the LP-PSOLA algorithm?

texts: The LP-PSOLAR algorithm uses a the Linear Prediciton Coding (LPC) to calculate an error vector from a signal. This error vector is used to calculate the pitch markers. What do these pitch markers represent in the original signal in generall? Do they represent a change in fundamental frequency or a change in phoneme (I think both assumptions are wrong)? The following figure depicts the error vector (red) and the signal (green). The second picture depicts an additional example.


texts: How to understand FFT results of scipy.fftpack?

texts:
I calculated FFT for a speech wav-file using scipy.fftpack. How do I read (understand) the return of FFT? I have read that it supposed to be like so: y[0] is 0Hz loudness, y[1] is 1Hz loundess, ... y[n] is nHz loudness ... But seems like it is not like that exactly.

Q1: What will I get when I do abs(y)? I know that we get list of complex numbers from FFT and need to square() or abs() them. But what we will have after that? Is this Decibels?

Q2: Why do we need normalize wav-data before doing FFT? What does depend on this? Before and after normalization I get different results from FFT. If I do normalization, then results of FFT are measured by hundreds, if I don't the results are measured by 1.x small values... Is this Decibels also?

# Read wav-data
fs, data = wavfile.read('eric.wav')

# this is a two channel soundtrack, I get the first track
wavdata = data.T[0]

# this is 16-bit track, b is now normalized on [-1,1)
wavdata = wavdata / (2.0**15)

Q3: What is length of the returned list from FFT? Seems like the length of the result depends on length of given sound file... But in Q1 I supposed to get list of frequencies and their loudness independently from a given source of data. For now, if I cut in half wavdata I will get twice shorter resulting list from FFT...

Complete simple code:

import matplotlib.pyplot as plt
from scipy.fftpack import fft
from scipy.io import wavfile

# load the data
fs, data = wavfile.read('eric.wav')

# this is a two channel soundtrack, I get the first track
a = data.T[0]

# calculate fourier transform
y = fft(a)

# show
plt.plot(abs(y), 'g')
plt.show()

Q4: What do I process results form FFT to get it in form Db vs Hz?

Wav-file could be found here: https://aacapps.com/lamp/voices Thanks.


texts: Obtain motion between image features by means of the homography matrix

texts:
I have been reading several really good answers about how to obtain camera pose (rotation, translation, etc), such as this one and this one, but I am not sure how this applies to my problem.

My problem: I have two images of a planar scene (terrain image from above), and I want find the motion that the camera has experienced between the two images $(dx, dy)$.
What I have done: I have image1 and image2 of a terrain with their features matched, and obtained its homography via OpenCV's C++ function:

cv::Mat H = cv::findHomography(image1points, image2points, CV_RANSAC);

Which looks like it is indeed an affine transformation:
$$\pmatrix{a&b&c\\d&e&f\\0&0&1}$$
What I need help with:

In this matrix, I don't know what is the reference frame of the $dx$, $dy$ parameters. $(dx, dy) = (c, f)$
How can I extract the rotation angle and scaling factor between the 2D axes of the two images. (Right now I am using this suggestion, but results don't seem reliable).
Once I have all the four parameters: $dx$, $dy$, rotation angle, scaling. How can I actually compute the motion of the camera (between the images) using the first image's axes as my reference frame.


texts: What type of coding has been used in this communication?

texts:
I am trying to decode this signal coming from a control board for car ultrasound sensors.

The first part of the signal seems to be a kind of sync frame. In the second part, instead, I should find the sensor id and the detected distance. The third part should be a reset.

I think it's encoded in PWM or Manchester encoding.
Can anybody give me some more information?

UPDATE N.1:
Opening the case, i found this board:

It is driven by this microcontroller: UPD78F9222MC(T)-5A4-A - Microcontrollore 8 Bit, 78K0S/Kx, 10 MHz, 4 KB, 256 Byte, 20 Pin, SSOP.
So trasmission should be UART or LIN (but i think that is UART).

I expect as payload some bits (min. 3) that can identify one of eight's sensor, and a float that rappresent distance.


texts: Designing a half band FIR filter with Scilab

texts:
I'm trying to design a half band interpolation filter using Scilab's eqfir function, which uses Remez's algorithm internally:

hn = eqfir(N, [0 .23; .27 .5], [1 0], [1 1]);

In despite of a symmetry of a transition band around 0.25 it doesn't give me a true halfband response with zeroed odd coefficients. Maybe I should use remezb or remez function directly, but I don't fully understand meaning of their input parameters.

Equivalent MATLAB function confusingly called remez gives perfect result, according to some sources in internet (I can't prove it).


texts: what does "fixed multipath channel model" means?

texts:
I want to check the effect of this channel model on my signal transmitted with "impulse response-Ultra Wide Band" transmission (use very short pulses ~0.5 ns each), but i don't know where to find this channel impulse response or how can I generate it?
if there is only one line of sight (LOS) path and one non-line of sight (NLOS) path, if I assume the channel impulse response something like h=[1 0 0 0 .4 0 0] and then filter(h,tx signal), it would be correct?
best regards


texts: Finding Reference Audio Signal in Test Audio Signal and Cropping Accordingly

texts:
As seen in the diagram, below I have a reference audio and a test audio. I want to find at what part of the test clip the reference audio be heard. Once, that is found I want to crop the test file from the point where the match begins and the point where the match ends. How can I do this matching and cropping of audio signals using Python? Some code will be of help.

The diagram below(from wiki) is for illustration purposes only

My audio clips:
Reference audio:  africaChirp
Test audio:       Africa

I want to find the time in seconds at which africaChirp appears in Africa. africaChirp was cropped from the source file, Africa, found here.

I have also included my code to show my progress:

import numpy as np
#import librosa
import logging
from scipy.io import wavfile

rate2,test = wavfile.read('africa.wav')

#indices
testStart  = 6000;
testEnd    = 200000;

refStart   = testStart + 11000;
refEnd     = refStart + 2000 - 1;

testSig=test[testStart:testEnd]
refSig=test[refStart:refEnd]

refStartRel=refStart-testStart+1
refEndRel=refEnd-testStart+1

no_samples_test=testSig.shape[0]
no_samples_ref=refSig.shape[0]

xcorr=np.zeros((no_samples_test-no_samples_ref+1,1))
xcorr_norr=np.zeros((no_samples_test-no_samples_ref+1,1))

refSig_norm= np.linalg.norm(refSig)
#print(xcorr.shape[1])
for i in range(1,xcorr.shape[0]):
    testSig_samples=testSig[i:(i+no_samples_ref)]
    xcorr[i]=np.sum(np.multiply(testSig_samples,refSig))
#    norrFilt=(filt-np.mean(filt))/(np.std(filt))
    linalgnorm=np.linalg.norm(testSig_samples)
    xcorr_norr[i]=xcorr[i]/np.multiply(refSig_norm,linalgnorm)

xcorr_max_id=np.max(np.abs(xcorr_norr))

print(xcorr_max_id)