texts:
I am trying to perform time-frequency analyses using the PyWavelets (pywt) toolkit for python. My ultimate goal is to perform time-frequency analyses for EEG signals but I am starting with something simpler.
For a sanity test, I am creating a simple signal of length 2 seconds, with sample rate 250Hz, containing 2 sine waves - one of 3Hz and one of 10Hz. I would like to create a time-frequency plot that has two horizontal lines - one for the 3Hz and one for the 10Hz, which looks like this (only for illustration purposes):

For this purpose, I tried using code from the following tutorial : http://ataspinar.com/2018/12/21/a-guide-for-using-the-wavelet-transform-in-machine-learning/, specifically in section 3.1 of the tutorial.

This is a minimal example based on the code from the tutorial:

from UliEngineering.SignalProcessing.Simulation import sine_wave
import pywt
import numpy as np
import matplotlib.pyplot as plt

def plot_wavelet(time, signal, scales,
             waveletname='cmor',
             cmap=plt.cm.seismic,
             title='Wavelet Transform (Power Spectrum) of signal',
             ylabel='Period (seconds)',
             xlabel='Time'):
    dt = time[1] - time[0]
    [coefficients, frequencies] = pywt.cwt(signal, scales, waveletname, dt)
    power = (abs(coefficients)) ** 2
    period = 1. / frequencies
    levels = [0.0625, 0.125, 0.25, 0.5, 1, 2, 4, 8]
    contourlevels = np.log2(levels)

    fig, ax = plt.subplots(figsize=(15, 10))
    im = ax.contourf(time, np.log2(period), np.log2(power), contourlevels,
    extend='both', cmap=cmap)

    ax.set_title(title, fontsize=20)
    ax.set_ylabel(ylabel, fontsize=18)
    ax.set_xlabel(xlabel, fontsize=18)

    yticks = 2 ** np.arange(np.ceil(np.log2(period.min())),
    np.ceil(np.log2(period.max())))
    ax.set_yticks(np.log2(yticks))
    ax.set_yticklabels(yticks)
    ax.invert_yaxis()
    ylim = ax.get_ylim()
    ax.set_ylim(ylim[0], -1)

    cbar_ax = fig.add_axes([0.95, 0.5, 0.03, 0.25])
    fig.colorbar(im, cax=cbar_ax, orientation="vertical")
    plt.show()

def generate_sine_wave(length, samplerate, frequencies):
    wave = np.zeros(int(length * samplerate))
    for frequency in frequencies:
        wave += sine_wave(frequency=frequency, samplerate=samplerate,
        length=length)
    return wave

signal = generate_sine_wave(2, 250, [3, 10])
N = len(signal)
t0 = 0
dt = 1/250
time = np.arange(0, N) * dt +t0

scales = np.arange(1, 256)
plot_wavelet(time, signal, scales)

This plot from this code doesn't give me the plot I want, it looks like this:

I tried many modifications for this code but none gave me the result I want. And there are a couple of things I don't understand about the code:
- What is the purpose of the "period" variable in the "plot_wavelet" function and how do I make the y-axis show frequencies instead?
- What is the purpose of the "scales" variable?
- How do I define a frequency range that I want the result to include?
- How do I use linear scaling for the frequencies instead of log scale?

If anyone can give some pointers regarding this I will be very happy. Been spending some time trying to plot normal time-frequency plots but still haven't been able to find a python tool that performs this simple plot which makes sense to me.
Thank you,
Elad


texts: I have trouble finding the bandwidth of a signal. Say I have an info bearing signal m(t)=sinc(2t/pi). I found the fourier transform of the sinc function and found that the angular frequency was 1/pi. I am confused whether the the bandwidth is w or 2w. Since it is band-limited, does that mean only the positive w is counted and the bandwidth is just 1/pi?


texts:
If I have a system specified by

$$P(D)y(t)=Q(D)x(t)$$

and I specify initial conditions $y(0^-)=a, \ y'(0^-)=b,\ x(0^-)=c$ does the term $x(0^-)=c$ correspond to the zero state response or zero input response?


texts: What cause frequency change of the acoustic signal (3 kHz to 10 kHz)?

texts: I am working on Acoustic Resonace testing in which I excite the sample and then record the sound (3 kHz to 10 kHz) by microphones. I do few times repetation of the same measurement in series (one after other) in which amplitude remains same in all the measurements but frequency is changing by 0.5 to 5 Hz even though threre is no change in the set-up and measurement conditions. Doppler shift is calculated but it is very small. I do not know the reason. Can anyone please help me?


texts: finding power spectral density from a vector

texts:
I have been given a vector:
\begin{equation}
v= \:\begin{pmatrix}\frac{1}{\sqrt{2}}&\frac{1}{\sqrt{2}}\end{pmatrix}
\end{equation}
my job is to find the power spectral density from this vector
\begin{equation}
\left|\Phi \:_{vv}\left(e^{jw}\right)\right|^2
\end{equation}
Can somebody please direct me in the right direction to get started on solving this problem?
I know I am supposed to use the Z transform, then evaluate the Z transform at the unit circle hence the term  \begin{equation}e^{j\omega }\end{equation}
but this is a vector and there's no dependence on a discrete time index.
Looking forward for your help. Any simple and convenient help is appreciated. Thank you very much in advance.
Update 1:
If,
\begin{equation}
v\left(n\right)\:\:=\:\frac{1}{\sqrt{2}}x\left(n\right)+\frac{1}{\sqrt{2}}x\left(n-1\right)
\end{equation}
then:
\begin{equation}
V\left(e^{j\omega }\right)\:=\:\frac{1}{\sqrt{2}}X\left(e^{j\omega \:}\right)+\frac{1}{\sqrt{2}}e^{j\omega \:\:}X\left(e^{j\omega \:\:}\right)
\end{equation}
therefore:
\begin{equation}
\frac{V\left(e^{j\omega }\right)}{X\left(e^{j\omega }\right)}\:=\:H\left(e^{j\omega }\right)=\frac{1}{\sqrt{2}}+\frac{1}{\sqrt{2}}e^{j\omega \:\:\:}
\end{equation}
How to prove the response is a low pass filter response?


texts: Anybody with experience with online double integration of acceleration?

texts:
I've found good literature for offline proccesses, and I've gotten good results. However, when it comes to online applications, I've found nothing good. Applying any filter without a linear phase response will give me too much distortion once I get to displacement. However, any filter I've used with linear phase response gives me way too much "time lag" (apart that it's very high order). Below is the proccess most people apply:

Raw Acc --> [High Pass Filter (HPF)] --> [Integrate (Int)] --> [HPF] --> [Int] --> [HPF] --> Displacement Signal

As you can imagine, this procces is trivial if you use non-causal filters... But I've not gotten a good solution for the online proccess.

My current conclusion is that I need a "low order, linear phase, causal filter." There is active research in these types of filters, but they are somewhat complicated to apply. So before I start making leeway, I decided to ask this in a forum to see if anybody could give some input or fresh ideas.


texts: How do you calculate the gain of a matched filter?

texts:
I know that you can calculate the gain of a low-pass filter by summing the filter coefficients.  I don't know how to calculate the gain of an arbitrary matched filter.

For instance, I have created a matched filter for an 802.11a long training symbol (for the purposes of this question that detail doesn't matter- just thought some of you might be curious).  My MATLAB code for creating the filter is:

longSymFreq = [0 1 -1 -1 1 1 -1 1 -1 1 -1 -1 -1 -1 -1 1 1 -1 -1 1 -1 1 -1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 ...
           1 1 -1 -1 1 1 -1 1 -1 1 1 1 1 1 1 -1 -1 1 1 -1 1 -1 1 1 1 1];
longSymTime = ifft(longSymFreq);
intentionalTimeOffset = 4;
% Barrel shift by intentionalTimeOffset to avoid the corruption of the early data samples.  Due to the
% cyclic prefix doing this is not a problem.
longSymTime = [longSymTime(end-(intentionalTimeOffset-1):end) longSymTime(1:end-intentionalTimeOffset)];
longSymFilter = conj(fliplr(longSymTime));

The sum of this filter is 6.938893903907228e-018 +3.122502256758253e-017i. The average of the absolute value of the taps, though, is  0.107538417337840, so clearly the sum is not giving me any information on what kind of gain I will get when the filter gets the matched signal.

How do I calculate that gain?  The reason I care is because my final filter will be fixed-point, and I can't have an overflow when I get the signal that I'm looking for.
Is the gain the energy of the filter?


texts: Designing a lowpass filter to minimize aliasing in pre-decimated streaming audio

texts:
I need to apply low-pass filter to PCM files. There are several methods such as FIR filters, IIR (butterworth-chebyshev..) filters but it seems to me applying Fast Fourier transform and eliminating higher frequencies is the closest way to an ideal filter.

What is the fastest and closest to ideal filtering method?

It is required for anti-aliasing before changing the sampling rate of sound.(Fcutoff=Fs/2) And will be applied every block of 1 sec. data. The main requirement is, after changing the sample rate, the new audio quality must be close as possible to original audio quality. (Not noisy.)

Thanks.


texts:
Desinging a very basic 1st order integrator with the continous transfer function:

$H(s) = -1 / (0.001 s)$
[No zeros, one pole at origin]

I was expecting the unit step response to be positive-slope.
However in my Python code I get a negative slope.

num = (0 , -1)
den = (0.001 , 0)
Hs = sig.lti(num,den)
t, s = sig.step(Hs)
plt.plot(t,s)

Provides:


texts: I don't understand harmonics, why do they happen?

texts:
I don't understand why harmonics occur in signals. So if I receive a time domain sinusoidal signal at 10 Hz and I perform the FFT of it, I will observe peaks at 10 Hz, 20 Hz, 30 Hz, and so on... with amplitudes decreasing, but why? Should it just not be one peak at 10 Hz?

For e.g. if I was to synthesize the time domain signal with this frequency graph, would I not then have now a sine wave of 10 Hz, 20 Hz, 30 Hz, etc. added up together when it should just be a sine wave at 10 Hz?

Maybe I haven't worded the question correctly, but hopefully, someone could try understand and lead me to some resources to help get my head around harmonics in general...


texts:
I am doing an experiment where i have to excite a plate and scan a region on it using a laser signal.
I am acquiring the signal from the laser continuously using an NI daq tool. i then have to divide this  signal into a set of discrete intervals, (each corresponding to a 1 mm segment in the scanning region), in which the time between the segments should have integer number of harmonic excitation wave cycles.
The speed that the laser moves in on the scanning region is 1 mm/min.
The excitation frequency is 100Khz, and the sampling rate of the daq tool is 1Msps.
however, i am not sure what should be the number of samples N for the tool?


texts: Extremely computationally intensive image/video compression schemes which offer better compression than industry standard JPEG/H.264

texts:
I am trying to search for image/video compression schemes which offer superior compression performance (holding image quality as constant) when compared to widely adopted industry standards (i.e. JPEG/H.264), but for reasons of them being either too computationally or resource intensive, implementing them on CPU-based workstations is infeasible and therefore unadopted in common standards.

I could only think of fractal compression as a good example. Does the community know of any more of such examples?


texts: How does a correlation receiver ensure which transmitted data does a user see?

texts:
Hello! I understand that using correlation, one can set up a system wherein multiple users can transmit at the same time using the same channel. And theoretically, I understand that if the correlation is equal to 0, then one can restrict which one will be able to receive which kind of data. For example, If User 1 transmits data X and User 2 transmits data Y, add them, and send them in the same channel, then User 3 can receive data X provided that it knows the correlation. And another user cannot receive data X.
What I don't quite understand is the mathematics behind it. How do I prove that data X transmitted by User 1 gets received by User 3, and not another User. What equations can I use, or how does this use the autocorrelation function $$ R_{xy}\left[ k \right] =\sum_{n=-\infty }^{+\infty }x\left[ n-k \right]y*\left[ n \right] $$
Thanks!


texts: Auto-correlation of absolute squared stochastic process

texts:
Consider the stochastic process $a(t) \in \mathbb{C}$. Its autocorrelation function is given as
$$
\phi_{aa}(\tau)=\left(a(t)\star a(t)\right)(\tau)=\int_{-\infty}^{\infty}a^*(t)\cdot a(t+\tau) \mathrm{d}t
$$
I now want to somehow express the autocorrelation function of $|a(t)|^2$ as a function of $\phi_{aa}(\tau)$.
$$
\begin{align}
\phi_{|a|^2|a|^2}(\tau)&=\left(|a(t)|^2\star|a(t)|^2\right)(\tau)=\int_{-\infty}^{\infty}|a(t)|^2\cdot |a(t+\tau)|^2 \mathrm{d}t\\
&=\int_{-\infty}^{\infty} a(t)\cdot a^*(t)\cdot a(t+\tau)\cdot a^*(t+\tau) \mathrm{d}t
\end{align}
$$
So far I tried to somehow express the second integral using the first one, without success. I also tried to solve the problem in the fourier domain.
Is it in general possible to express the second autocorrelation in terms of the first one? Are there maybe any special assumptions to be made?


texts: Problem identifying the analytic expression of such determined signal

texts:
I came across this problem

I am supposed to find the Fourier transform of $g(t)$, but I am not able to find the analytical expression of such signal.

The teacher suggests that I should consider the inclined part in $\left[-T, 0\right]$ as the integral of a determined function.

It turns out it is the integral of some $\rm{rect}()$ function. However, the teacher noted that I should subtract from it the (???) step function.

Can you explain to me how to find the fourier transform of $g(t)$ more comprehensively?

EDIT 1:

I tried to solve it, and I came to this solution. Is it correct?


texts: What exactly happens with Spread Spectrum Modulation

texts: With regard to DSSS and CDMA(DS), what does it mean to spread a signal over a spectrum of frequencies in terms of individual frequencies? Is it about sending the same signal redundantly on multiple frequencies, or is the data stream actually divided and sent as multiple discreet signals over various frequencies? I've read explanations claiming either.


texts: Are oversampling and downsampling the same thing?

texts:
According the books I have on DSP,

is oversampling, sampling a signal at a much higher samplingrate then normally required, so to reduce the sample-rate (and increase the resolution of the signal) afterwards
is downsampling (decimation), lowering the samplerate of a signal, e.g. to reduce the CPU-requirements of signal-processing blocks later down the chain

So can I conclude that these two techniques are basically the same?

And does this mean that -as a concequence- downsampling will also increase the signal-resolution, just as with oversampling?

Or am I missing something?

Kristoff


texts: Proper method for generating Channel coefficients in MATLAB

texts:
I am trying to estimate the coefficients of a Moving average model using popular estimation method such as Least Squares (LS). For educational purposes, I am trying to see if LS can work well when the coefficients are complex valued or not. I have not seen any article or text book where LS is applied to complex parameter estimation. In many papers, I have seen that the input data is complex valued, channel is complex valued and the measurement noise is complex valued. When is this setting applicable?

What if only the channel coefficients are complex valued (input and noise are real valued), then where is this setting applicable?
What is the channel coefficients and the input are complex valued, then where is this applied?


texts: $2\pi$ periodicity of discrete-time Fourier transform

texts:
In my signals and systems course, we have learned that the discrete-time Fourier transform is $2\pi$ periodic, but the continuous-time Fourier transform is not periodic in general. For reference, we are using the following definitions of each transform:

Continuous-Time:

$$
x(t) = \int_{-\infty}^{\infty} X(j\omega) e^{j\omega t} \, d\omega \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ X(j\omega) = \int_{-\infty}^{\infty} x(t) e^{-j\omega t} \, dt
$$

Discrete-Time:

$$
x[n] = \int_{\langle 2\pi \rangle} X(e^{j\omega}) e^{j\omega n} \, d\omega \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ X(e^{j\omega}) = \sum_{n=-\infty}^{\infty} x[n] e^{-j\omega n}
$$

I'm searching for some intuition as for why the DTFT is periodic, but the CTFT is not. In class, my instructor presented the following argument: for a discrete-time signal,

$$
e^{j\omega n} = e^{j\omega(n + 2\pi)}
$$

and thus any $x[n]$ can be expressed as a sum of individually $2\pi$ periodic functions. However, I don't see why that argument only applies to discrete-time signals - I feel as if it also works for continuous-time signals.

Any someone explain?


texts: What are the historical milestones in image Deconvolution?

texts: Norbert Wiener came up with the Wiener Deconvolution in 1949 or something like that. But what happened after that? When was Richardson-Lucy deconvolution developed for example? And what happened between that and Adobe's deblur demo in Creative Cloud?


texts: How does constant frequency response relate to equiripple?

texts:
The teacher says As a consquence, you can think of the frequency response of a filter as a shark. It must always move and it can never be rest. An important case is equiripple.

I am very confused about the abrupt conception..

Why constant frequency response can never be rest?
2.how does constant frequency response relate to equiripple?

Thanks you!!


texts:
I want to detect the regions of voice in a song. Currently, I am using the fact that the vocals in the song are recorded as center panned. So, I am removing all center panned audio from the song. However, this removes other instruments such as bass also. So, it sometimes gives false indication of voice being present.

I want a way ( better? than this naive approach?) to be able to detect portions of the song where a singer is singing. There is no specific type of music, I'd like an implementation for any type of song. A sample might be http://www.youtube.com/watch?v=w_Rut4qm33g but I up for any song for which this can be done, even if it has some specific properties.

My current implementation is -

[y, fs] = wavread('song.wav');

subplot(2, 1, 1);
plot(y)

left = y(:,1);
right = y(:,2);
yOut(:,1) = (left - right)/2;
yOut(:,2) = (left - right)/2;
wavwrite(yOut, fs, 'tmp2.wav');

fftL = fft(left);
fftR = fft(right);

N = size(fftL)
N = N(1);

M = size(fftR)
M = M(1);

N = min(N, M);

for i = 1:N
  dif = fftL(i,1) / fftR(i,1);
  dif = abs(dif);
  if (dif > 0.7 && dif < 1.5)
    fftL(i,1) = 0;
    fftR(i,1) = 0;
  end;

end;

leftOut = ifft(fftL);
rightOut = ifft(fftR);
yOut(:,1) = leftOut;
yOut(:,2) = rightOut;

subplot(2, 1, 2);
plot(yOut)

N = size(yOut);
N = N(1);
for i = 6:N
    yOut(i) = 1/5* (yOut(i-1) + yOut(i-2) + yOut(i-3) + yOut(i-4) + yOut(i-5));
end
wavwrite(yOut, fs, 'tmp.wav');


texts: why wavelet (CWT) doesn't show accurate results always?

texts:
hmm any one can help please? I have a signal that contains some modes in it. I've run a CWT transform but I haven't got my desired results. so I implement a test signal that contains freqs [0.1,0.3,0.6] Hz to see whats the problem with my codes. but the result was accurate. once I change the freqs to [0.1,0.4,0.6] or [0.1,0.5,0.6]Hz,The results wasn't accurate anymore on the plot.

you can see the plot here:

It might be for the damping effect of the 0.6Hz mode or ... I don't know actually :(
I think I must fix why this happening first to get my actual signal modes. here's my codes.

    t=linspace(0,30,300);
Fs=ceil(inv(t(2)-t(1)));                               % sampling freq
 x=sin(2*pi*t*0.1).*(t<10)+sin(2*pi*t*0.3).*...
     (t<30)+sin(2*pi*t*0.6).*(t<10).*exp(-t*.1);       % my signal[0.1Hz,0.3Hz,0.6Hz]
wname = 'morl';                                        % define wavelet name
scales = 1:1:128;                                      % scales range
coefs = cwt(x,scales,wname,'lvlabs');                  % Get coefs of x
freq = scal2frq(scales,wname,1/Fs);                    %convert scales to freq range
surf(t,freq,abs(coefs));shading('interp');             % 3D surface plot
axis tight; xlabel('Seconds'); ylabel...               % seting the axis 3D surface
    ('Pseudo-Frequency (Hz)');                         % seting the axis 3D surface
axis([0 length(t)/Fs 0 1 0 max(coefs(:))*1.1])         % seting the axis 3D surface
figure;
sc=wscalogram('image',coefs,'scales',freq,'ydata',x);  % get scalograme of x
xlabel('Time'); ylabel('Frequency of gen');            % set axis
hold on
abscof=abs(coefs)';                                    % |coefs|'
modI=max(abscof);                                      % get  max |coefs| coresponde to freqs of x
modI=modI/max(modI);                                   % scale each clumn 0-1
figure;
plot(freq,modI)                                        % Plot all modes. contain all
grid on
axis([0 1 0 max(modI)*1.1])                            % seting the axis
xlabel('Pseudo-Frequency (Hz)'); ylabel('abs(coefs)'); % seting the axis

Thanks for your respond.


texts: Enhance image in matlab - exp operation - imageJ software-LPR

texts:
I use imageJ software, imageJ has a EXP command (process >math >exp ).

original image:

output image processed by EXP command in imageJ software:

in this link explain how do that ImageJ: http://imagej.1557.x6.nabble.com/Process-gt-Math-gt-Exp-td5009733.html

How can I do that in matlab?

It is the matlab code which I wrote,Please correct my mistakes.

clear all;
close all;
clc;
img=imread('http://s6.uplod.ir/i/00594/fdg3933aznwz.jpg');
im=rgb2gray(img);
im=im2double(im);

figure,imshow(im)

    for i=1:size(im,1)
        for j=1:size(im,2)

          in = (im(i,j)+1);
          result(i,j) = 255*exp(in/46.01);

        end
    end
figure,imshow(mat2gray(result))


texts: Camera calibration/pin hole camera model and working out 3d position

texts:
I have a calibrated camera and have the intrinsic parameters. I also have the extrinsic parameters relative to a point (the world origin) on a planar surface in the real world. This point I have set as the origin in the real world coordinates [0,0,0] with a normal of [0,0,1].

From these extrinsic parameters I can work out the camera position and rotation in the world plane 3d coordinates using this here: http://en.wikipedia.org/wiki/Camera_resectioning

Now I have a second point which I have extracted the image coordinates for [x, y]. How do I now get the 3d position of this point in the world coordinate system?

I think the intuition here is that I have to trace a ray that goes from the optical center of the camera (which I now have the 3D position for as described above), through the image plane [x,y] of the camera and then through my real world plane which I defined at the top.

Now I can intersect a world coordinate 3d ray with a plane as I know normal and point on that plane. What I don't get is how I find out the 3d position and direction when it leaves the image plane through a pixel. It's the transformation through different coordinate systems that is confusing me.


texts: How do I obtain the frequencies of each value in a 2D FFT and what do they mean?

texts:
My goal is to analyze the frequencies in an image representing water simulation data before and after, for example, a Gaussian filter. The direction of these frequencies is not important to me. Ideally, I think I want to plot these frequencies in a 2D graph, where x represents the frequency, ranging from 0 to 0.5, and y represents the amplitude.

I understand how to obtain the 1D frequencies, as is explained here:
https://stackoverflow.com/questions/4364823/how-do-i-obtain-the-frequencies-of-each-value-in-a-fft. From this, I also understand how to obtain the frequencies in x- and y- direction.

What I do not fully understand is what the direction-independent frequencies of my output values are. Intuitively, I would expect to calculate them like so:

// from output to frequencies to periods
fx = kx / N; fy = ky / M
px = 1/fx; py = 1/fy

// direction independent frequency of output value
period = sqrt(px*px + py*py)
frequency = 1/p

However, when I read about this particular subject, I find something different:

From what I understand, u and v are the x- and y- frequencies respectively, in cycles per unit distance. This would mean that, if I have a signal with x- and y- frequencies of both 0.5, the resulting frequency is 0.707... ? This is over the Nyquist limit, even more so diagonally! I have a feeling I am missing something, but I can't find what.

Additionally, what do the frequencies with an x- or y- frequency of 0 or 0.5 mean? In 1D, they would be the DC and Nyquist component. How does this translate to 2D, where the other may have a perfectly fine value? More practically, which frequencies can I use for my graph?


texts: Im trying to use GNUradio 3.8 with an sdr to pick up some wifi packets 2.4 and 5 GHz but im seeing a ton of dropped samples from my sdr. Im wondering if my dropped samples have to do with the sample rate. Ive seen online sdrs have a mixer that downconvert the frequency band to baseband and then its sampled. But i believe one cannot configure arbitrary sample rates, as the receiver expects a given number of samples per symbol. Is this correct. If im trying to sample 2.4Ghz and 5Ghz a/b/g/n how do i figure out my sample rate/dropped samples issue. Thanks


texts: Can we normalize data to unit variance without distorting the phase?

texts: Consider we have one dimension time samples. The noise in the samples made some portions of the time samples amplitude very high. Obviously the short variance for those time samples will have high variance. I want to do running variance (of some window size)  and normalize data by dividing by the variance. Is this procedure would destroy the phase of the phase of the signal? Is there a way to normalize data with unit variance without distorting the phase?


texts:
I am not EE or DSP engineer, however I am working on a project that uses TDOA estimation for location finding. I am able to get the localization algorithm working using cross correlation to estimate TDOA.
The challenge is that the receivers are separated by a distance and I am trying to find a method where I wouldn't have to transfer the whole recorded signal (which is very large) . So the question is:

Can I perform correlation using a smaller subset? or metadata on received signals?
Can I use metadata or a parametric model of the received signal? So that I can transfer just the parameters or metadata -which would be much smaller in size- for TDOA estimation? What parameters or metadata would that be?
Thanks in advance


texts: please give the reason why every notation for DFT is valid?

texts:
$X$ represents sample in frequency domain and $x$ represents samples in time domain.

NOTATION 1

$ X[k] = \sum\limits_{n=0}^{N-1} x[n] \ e^{-j \frac{2\pi}{N} n k} $

$ x[n] = \frac{1}{N} \sum\limits_{k=0}^{N-1} X[k] \ e^{j \frac{2\pi}{N} n k} $

NOTATION 2

$ X[k] = \frac{1}{N} \sum\limits_{n=0}^{N-1} x[n] \ e^{-j \frac{2\pi}{N} n k} $

$ x[n] = \sum\limits_{k=0}^{N-1} X[k] \ e^{j \frac{2\pi}{N} n k} $

NOTATION 3

$ X[k] = \frac{1}{\sqrt{N}} \sum\limits_{n=0}^{N-1} x[n] \ e^{-j \frac{2\pi}{N} n k} $

$ x[n] = \frac{1}{\sqrt{N}} \sum\limits_{k=0}^{N-1} X[k] \ e^{j \frac{2\pi}{N} n k} $

NOTATION 4

$ X[k] = \sum\limits_{n=0}^{N-1} x[n] \ e^{j \frac{2\pi}{N} n k} $

$ x[n] = \frac{1}{N}\sum\limits_{k=0}^{N-1} X[k] \ e^{-j \frac{2\pi}{N} n k} $

Please observe the scaling factor $\frac{1}{N}$ and change of a negative sign $-$ over the exponent term ${e^{\pm j\frac{{2\pi }}{N}nk} }$. Why is every notation of DFT valid?


texts: Finding frequency respone of a differential/integral LTI system

texts:
So suppose that we have an LTI system defined by the differential/integral equation below, where $x(t)$ and
$y(t)$ denote the system input and output, respectively. How would I find the frequency response of this systems?

I haven't been taught this yet and the text book has no examples on it, I'm really confused. I'd really appreciate the help. This is the system:

$$
\frac{d}{dt}y(t) + 2y(t) + \int_{-\infty}^t 3y(\tau)d\tau + 5\frac{d}{dt}x(t)-x(t) = 0
$$


texts: First I defined 5 signals with same length (40 samples) with different frequency and sampling frequencies, then I've put them together like [X1 X2...] and took it's fourier transform and the result is in the corresponding figure, the I took those 5 signals with same length (200 samples) and sum the up and took it's fourier transform, the result is in the corresponding figure, what makes these two signals fourier transforms different? why is it?


texts: Butterworth filtering behaving unexpectedly -MATLAB

texts:
I'm new to signal processing but I'm trying to understand how the Butterworth filter works. To do so, I did the following: I assumed a sampling frequency of 100Hz and wanted to attentuate everything after half the Nyquist frequency. The code I used is the following

[b,a] = butter(2,0.5);
fs = 100; %Sampling frequency
t = 0:1/fs:1-1/fs;
y=0.123*sin(2*pi*20*t+0.234)+0.123*sin(2*pi*10*t); %Pair of sine curves
plot(abs(fft(y))) %This behaves as expected, with two peaks at 10 and 20
dataOut = filter(b, a, y);
figure,
plot(abs(fft(dataOut)))

I expected the second plot to be identical to the first because there are no frequencies above the Butterworth filter's cutoff anyway. However, the signal is artifically inflated (by a small amount) for all components below 25Hz and then goes to zero. See the original signal and the filtered signal below.

Is this normal behavior? If so, it is effectively adding noise in my passband, is it not? Also, this effect is a lot worse if I use a higher order Butterworth filter.


texts: Identifying license plate number of a thief's car from a Picture

texts:
I recently had the mail in my mailbox stolen from my home. I caught the whole thing on video and was able to identify the woman. Just a few days after the mail theft incident I went into a local post office and saw the same lady that stole our mail. Unfortunately the postal office I was in did not know the protocol to perform with the perpetrator in sight, and the police that I was on the phone with could not come and arrest her.

I was however able to capture the video a picture of her license plate but I cannot find it through free license plate searchers online. Is there any other sources that I am missing that may be able to decipher the license plate and or what state it might be in?

I wish I had access to some database/map that gave me a map of Dodge Durango's in my area. Or some way I could have detected her phone then got her current location.


texts: How is wavelet time & frequency resolution computed?

texts:
Mallat gives analytic wavelet time & frequency widths/uncertainties as
$$
\begin{align}
\sigma_{ts}^2 &= \int_{-\infty}^{\infty} (t - u)^2 |\psi_{u, s}(t)|^2 dt
               = s^2 \sigma_t^2 \tag{4.51} \\
\sigma_{\omega s}^2 &= \frac{1}{2\pi}\int_{-\infty}^{\infty} \left(\omega - \frac{\eta}{s} \right)^2 |\hat\psi_{u, s}(\omega)|^2 d\omega
               = \sigma_\omega^2 / s^2 \tag{4.54}
\end{align}
$$
where
$$
\begin{align}
\psi_{u,s}(t) = \frac{1}{\sqrt{s}} \psi^* \left( \frac{t-u}{s}\right),\ \ \hat\psi_{u,s}(\omega) &= \sqrt{s} \hat\psi(s\omega) e^{-i\omega u} \tag{4.53} \\
\eta = \frac{1}{2\pi} \int_0^\infty \omega |\hat\psi (\omega)|^2 d\omega \tag{4.52} \\
\end{align}
$$
$$
\sigma_t^2 = \int_{-\infty}^{\infty}t^2 |\psi(t)|^2dt,\ \ \sigma_\omega^2 = \frac{1}{2\pi}\int_0^\infty (\omega - \eta)^2 |\hat\psi(\omega)|^2 d\omega
$$
But how would one actually code this? Continuous math can't just be ported directly; the following considerations arise:

How to treat $\psi(t)$ for wavelets defined in frequency domain? We ifft, which now mixes the discrete and discretized. Any normalization considerations?
How to define $t$ and $\omega$, particularly in light of (1)? What are their ranges? For $\omega$ one can presume $0$ to $\pi$ - but what of $t$? Even if we go to infinity, one must still define the interval over which the wavelet decays.
This answer discusses center frequency computed for wavelets sampled directly in time-domain; is the approach the same here?
How to tell whether the implementation(s) is correct? One can always code integrals to spew numbers.


texts: Where does this star came from? [EDIT - Detailed Question]

texts:
First of all, it's a rare topic in google, so I can't find intuitive explanation about step-invariant, so I don't understand actually what it is, except to solve zero order hold transfer function.

In this pdf, page 15 to 18 I've been learning about zero order hold (ZOH).
http://www.engr.usask.ca/classes/EE/480/notes/myee480-p4-sampleHold.pdf

As you can see above, suddenly the laplace transform has become starred, why does it happened?

EDIT

First thought, I think it was like distributive starred property. But why suddenly it has a star while you still have starred curly bracket? Is it a typo?

And also, from the wikipedia
https://en.wikipedia.org/wiki/Starred_transform
It's written that $X^*(s) = L[x(t).dirac_T(t)] = L[x^*(t)]$
The star is only on the big X and small x, and it's not on the L one, so why the creator made it star on the L one?

Furthermore, if you also take a look at page 17 (top right). First, (1-e^-Ts) are converted into laplace transformation form, and then it gets starred, and then it is separated, and then it return to the first original (1-e^-Ts) form. What's the use? It's seems illogical.

If you don't mine, please also explain intuitively what is step-invariant z-transform and why the creator use step-invariant z-transform method to find the transfer function and not the other method.


texts: How to calculate SNR with sample noise and noisy signal only

texts:
I want to calculate the SNR for a speech signal recorded within a noisy environment. I also sampled purely the noise within the environment.

The SNR is based on the ratio of power of clean signal and the power of noise signal. So my naive attempt to get SNR is:

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

$SNR = \frac{P_{signal + noise}}{P_{noise}} - 1$

However I realized that:
$P_{signal+noise} \propto (A_{signal} + A_{noise})^2 = A_{signal}^2 + A_{noise}^2 + A_{signal}A_{noise}$
$P_{signal+noise} = P_{signal} + P_{noise} + avg(A_{signal}A_{noise}) \neq P_{signal} + P_{noise}$

I couldn't find anything about this in the Wikipedia article nor other threads with this particular question.


texts:
I'm teaching an undergraduate linear algebra course, and looking for applications.  The New Horizons spacecraft is approaching Pluto, and returning images I find fascinating:
http://pluto.jhuapl.edu/index.php

They briefly refer to 'image deconvolution'.  I expect they are using the most sophisticated tools available, some nonlinear, but my vague understanding is that some simple methods are linear algebra based.

Can anyone provide a reference or expository paper on linear algebra methods for image deconvolution that would be a good starting point?


texts: Deriving the Convolution Kernel of the Inverse of a Signal

texts:
Let $y$ be the inverse (in the sense of convolution) of $x$, i.e.

$$x \star y = \delta$$

Context: $x[n]$ is a discrete signal defined for $n = 0,\ldots, N$. We can assume $x[n] = 0$ if $n \not\in [0,\ldots, N]$.

How to compute the inverse of $x$ (for the convolution)?

\begin{align}(x\star y)[0]&=x[0] y[0] = 1\implies y[0] = \frac{1}{x[0]}\\
(x\star y)[1]&=x[1] y[0] + x[0] y[1] = 0\implies y[1] = -\frac{x[1]}{x[0]^2}\\
(x\star y)[2]&=x[2] y[0] + x[1] y[1] + x[0] y[2] = 0\implies y[2] = -\frac{x[2]}{x[0]^2} + \frac{x[1]^2}{x[0]^3}
\end{align}

I tried to find $y[3]$ manually, but I don't see a general formula appearing...


texts: Blind Source Separation of Real World Mixture

texts:
I have been toying with both non-negative matrix factorization (NMF), independent component analysis (ICA) and independent vector analysis (IVA) for separating speech mixtures. I'm trying to separate two sources using recordings from two omni-directional microphones. When I generate a mixture synthetically  in an instantaneous fashion all algorithms provide excellent separation. When I generate convolutive mixtures using room impulse response data from the web the performance is still good. However all the algorithms fail miserably when the input mixture is a real-world recording, like a male and a female reading aloud in a room.

All the examples I could find online, for example this one, also use synthetic convolution. This paper seems to suggest the same, when it says

  In controlled laboratory experiments, BSSD algorithms perform very well. In the real world,
  however, they flounder. If we focus our research more on the practical acoustic engineering necessary
  to obtain signals with less reverberation and noise, then our current algorithms will thrive.

I'd like to know if any new algorithms have been discovered that deal with this kind real-world mixture and provide satisfactory results.


texts: Why do we say that a good time response means a bad frequency response?


texts: Can FFT information be used to obtain the DTFT?

texts:
If $x[n] = \left\{\frac 14, \frac 14, \frac 14, \frac 14\right\}$
and the resulting DTFT is
$$
\frac 12\exp\left(\frac 32\omega\right)\left(\cos\left(\frac 32\omega\right)+\cos\left(\frac 12\omega\right)\right)\tag{1}
$$

I'm looking for a general, computational method for obtaining the general DTFT formula, that works in almost all cases, that doesn't involve doing anything by hand. Is there enough information in a FFT magnitude and phase result, assuming there were enough bins used and appropriate zero-padding was done, to work out the DTFT?

To reiterate, pretend like all you have is the graph below. I'm asking if you can somehow derive the formula equation $(1)$ without doing anything else but looking at that graph. I'm asking if that is possible using just FFT information.


texts: What are characteristics of shadows in an image given an outdoor setting from an image processing point of view?

texts:
I'm wondering what basic characteristics of shadows are. I'm looking from a camera image/video processing point of view. I'm considering the case of an outside scene in direct sunlight.

These are the characteristics I could quickly come up with, but I guess there are more.

There are strong edges on the shadow borders
The shadow is ‘darker’ than the surrounding area
The shadow usually ‘deforms’ when an object is rotated
Due to absence of the primary lighting in the shade, the color tends to be dominated mostly by the main diffuse lighting source (which is in most cases the sky --> blue)

I'm wondering which other characteristics I might miss.


texts: digital IIR filter delay and oversampling

texts:
Can oversampling decrease the delay of digital IIR filter? Imagine there is some digital signal going into processor that applies low pass filter.Lets say its 1 KHz sample rate and the filter is second order gaussian lowpass with -3db point at 100 Hz.

The putput of this digital filter will be delayed,this delay will vary with frequency.Can this delay,in the band of our interest which is 0 - 500 Hz for 1 KHz sample rate,be decreased if we increase the sample rate of the incoming signal?

What if the incoming signal was 2 KHz samplerate ( 2x oversampling ),would it decrease the digital filter delay?

I have read that the delay can be decreased by increasing bandwidth or by putting -3db cut off point higher in frequency.Is that true? I know making the low pass have higher frequency decrease the delay,but what about the bandwidth?

If we increase the sample rate,we increase the bandwidth,but in case of low pass filter it will be the bandwidth thats being attenuated.I have feeling that the author who wrote about the bandwidth thing meant the passband bandwidth and in that case its same thing as making the low pass higher.

I tried two filter simulating softwares,the Iowa Hills IIR and MicroModeler.com and got conflicting results.The Iowa Hills showed that the delay in the band of interest is increased slightly by oversampling while MicroModeler showed small decrease.

Does oversampling increase,decrease or not change the delay?


texts:
I'm really new to DSP, I'm actually studying Computer Science and took an elective on DSP so my knowledge is pretty limited.

I've learned that pure white noise signal  for example has all possible frequencies, that means that it also has zero frequency so it has a non zero DC component(does that mean it?) but pure white noise by definition has a zero mean and thus has a zero DC component..
What am I missing?

Thanks!


texts: morphological processing : Hit or Miss shape detection

texts:
I am currently looking at shape detection for Hit or Miss. I am having a bit of trouble with the concept of the window that they have you to detect the shape. Up till now reading about hit or miss they just give an example of a target set of pixels and a target image 1 and the step for this are as follows:

The first step in Hit-or-miss translation is the erosion of the image by the target configuration (shape), thus producing the hits. The logical operation is given by $A\ominus B$ where A is the image and B is the target shape to be found.
The second step, we take the complement of the image $\bar{A}$ and the target shape $\bar{B}$. The we erode the compliment to produce the misses with in the image. The logical operation for this is given by $\bar{A}\ominus\bar{B}$.
The final step take the intersection of the two eroded images and any surviving pixels give the location of the target shape in the original image A. The logical operation for this final step is given by $(A \ominus B) \cap (\bar{A} \ominus \bar{B}$).
Any surviving pixels give the location of the target shape in the original image A

However when I looked further into this method for shape detection I came across the following website:
(http://oramos.epizy.com/teaching/16/dip/lectures/07_Morphological_Image_Processing_1.pdf?i=1)
and on slide 34 to 35 it has the following for shape detection

in there example for the shape detection they are using another structuring factor which they have named window, which it what I am having and issue with. with why have they done this? Is this a generally way when using hit or miss for shape detection?


texts: Is Spectral Coherence (MSC) dependent to the initial amplitude of the comparing signals?

texts:
Given the signals

\begin{align}
x(t) &= A_1\sin(\omega t)\\
y(t) &= A_2\sin(\omega t)
\end{align}

Do $A_1$ and $A_2$ play a role in the $C_{xy}$ coherence estimator? MATLAB's mscohere.m shows no differences for $A_1=A_2$ and $A_1\neq A_2$ at all.


texts:
I have several circle detectors. I want to evaluate their performance in finding the spherical steel markers in X-ray images. The radii of the circles are distributed in a narrow range around 8 px.

It is important that all markers are detected, it is not so important that there are no false positives.

So the first thing that comes to mind is AUC of precision-recall curves as a measure of goodness.

There is however a problem: some detectors return a probability map of some point being a center of the circle and have up to two parameters, while others operate on edge images and return circle center coordinates. Moreover one of the latter ones has many parameters to tweak. In order to have many points on the precision-recall curve for this detector I would have to sample the multidimensional parameter space.

Although technically it is not a problem I have reservations as of conceptual validity of this, since there is some a priori knowledge of reasonable values of those parameters and also they could be optimized by using a training set of images. This renders irrelevant the precision-recall curve points that were obtained with nonsense parameter, but these points nevertheless influence the AUC. Continuing this line of thought leads to a cross-validation approach, which I've never seen being used in articles on circle detection.

What is the correct way of evaluating circle detectors for a given task.

P.S. Also asked this on cross-validated stack exchange, since the question fits somewhere in between that an this community.


texts: How to estimate the number of taps needed for subsequent channel estimation algorithms?

texts:
I recently implemented an MMSE channel equalizer, and I have read about many other types of channel estimation/compensation algorithms out there. However, one thing that is never talked about it how to estimate the number of taps in your model of the channel you are trying to estimate. How is this accomplished?

For example, in the MMSE implementation I have, I know the training sequence, and thus, and use the training sequence to minimize my error. However, what if the channel impulse response is longer than the training sequence? I would never see its effects, and thus its effects on the training sequence will not be seen. How does one then estimate the number of taps needed for channel estimation?

Thanks!


texts: How to extract features from nonstationary signal using SVD (singular value decomposition)?

texts:
I am trying to extract features from a nonstationary signal (frequencies and time locations). For this purpose, I computed a wavelet transform (complex morlet) of the signal in MATLAB and obtained the scalogram as follows:

Than I tried to decompose the scalogram matrix by SVD, in order to localize the peaks and the spreads of energy in the image. The problem is that every matrix obtained from the decomposition (one for every singular value) contains informations about more than one single atom (peak in the image). I've read many articles about rotating the SVD basis in order to decompose the original matrix in matrices connected each to a single atom, but I'm not able to apply it in practice.
If we consider the standard SVD:

A=U*S*transpose(V)

a source in particular:

  [Bashor & Kareem, Efficacy of Time-Frequency Domain System
  Identification Scheme Using Transformed Singular Value Decomposition]

talks about a new SVD given by:

A=Y*Z*transpose(X)

where Y, Z, and X are the transformed singular vector and singular value matrices, defined as:

Y=U*C;
X=V*D;
Z=transpose(C)*S*D;

and the trasformation matrices are found by:

E[Y]=transpose(C)*M*C

"where C are the eigenvectors of M that maximize the mean and M is a matrix of the singular vectors". My problem is to understand the mean of the latter sentence and to apply it in MATLAB. Please help me!


texts: Why are equalizers moving average model (FIR)

texts:
Let the equalizer coefficients obtained, say $w$ and the input to the equalizer is $y$ that is a noise corrupted received signal, $rx$ then the equalized signal, which is the output of the FIR based equalizer, should be equal to the transmitted signal / source signal. This is the working principle. But, we often perform the operation :

equalizer_output = filter(w,1,rx).

Question 1: Most equalizers are modeled as FIR filter. My Question is why? I  do not understand how this operation gives the input or how is this performing deconvolution?

Question 2:  For example considering a single input single output channel, $x$ is a BPSK modulated source signal and there is multipath fading with 3 taps (not Rayleigh), then the transmitted signal is
$$y(t) = h(1).x(t-1) + h(2).x(t-2) + h(3).x(t-3) + x(t)+ w(t)$$ where $w$ is the Additive White Gaussian measurement / channel noise. The above model is FIR model and not any filter. This is not the equalizer. In order to devise an equalizer inorder to get the input $x$, do we again devise a FIR filter as an equalizer whose input would be $y$? $h$ is the channel impulse response but it is not any model as such.

Question 3: When do we model a channel as an IIR model and then the equalizer would be an IIR or FIR filter?


texts: I had a question regarding multi-taper estimated coherence. It appears when the number of tapers is set to 1, all coherency values, per frequency, are always 1. It's obvious solving for autospectra $S_{xx}$,$S_{yy}$ and cross spectra $S_{xy}$ between two complex numbers produces this with a single taper, using $C_{xy}^2=\frac{|S_{xy}|^2}{S_{xx}S_{yy}}$. And common matlab functions also reveal this applied to real data. But I struggle to undestand intuitively why having only a single taper completely botches the estimate of coherence, such that all values are one, when expanding the number of tapers gives what could be thought of as a real estimate of the underlying values. Why does the orthogonal basis of tapers have to have $K\ge2$ to obtain a sensible values? Are there any analogies or physical metaphors as to why that is?


texts: Direction of sound using microphone array

texts: I want to estimate the direction of arrival of sound (angle in a 2d plane) using a microphone array. I'm hoping to follow a time-delay based method using a 4 mic array. The method requires me to find the time delay of the signal upon arriving at the different microphones. For example, in the 4 mic array, I'm required to find the time delay of the signal between mics 1 and 2, 1 and 3, and 1 and 4 and so on for all other pairs. It would be very convenient if I could have a 4 mic array that could simply be plugged into my laptop and I guess an NI Labview algorithm would take care of the rest. And some one somewhere suggested that the microphone array can be created by using 4 usb (mini) mic and connecting them to a USB hub. First of all, can this be done? Secondly, since its a USB mic, the signal will already be digitized right? Any suggestions regarding how to extract information about time from this? I do not have any prior experience with signal/sound processing.


texts: Digital modelling of circuits with diode (i.e. guitar distortion)

texts:
For the last few days I was struggling to come up with an idea how to model a guitar overdrive effect which works in realtime. One of the simplest circuit diagrams that produce it looks as follows:

The plot depicts output for 400Hz 1V sine wave at the input.

Normally I'd derive transfer function of the circuit, but in this case I think it cannot be done because diode is a nonlinear component and transfer functions exist only for linear differential equations.
Nevertheless the program I used for the simulation (Falstad Circuit Simulator) generates valid solution somehow... I was thinking of maybe deriving differential equation for the whole circuit and then applying some numerical scheme to find the solution - this however could be easily become unstable and it would be considerably harder for me to analyze. Are there some tools that could readily generate equations (be it difference, differential or transfer functions) for such circuit?

EDIT
I already tried with waveshaping. I came up with an idea to find coefficients of a polynomial to generate best fitting waveshaping function using a genetic algorithm. The algorithm converged nicely, but unfortunately, using a polynomial as the function model (tried up to 5th order) I cannot get anything that would resemble the desired output waveform.


texts: Relation between frequency and phase in PLL?

texts: Apparently both frequency and phase are independent properties but what is the relation between frequency and phase in PLL?so that when one is locked ,other is also locked


texts: Aperture Jitter in Digital to Analog Converters

texts:
I have noticed in the literature that there is an internally induced timing jitter inside Analog to digital converters called (aperture jitter). It is caused by the sample-and-hold circuit of the ADC.
So what about the digital to analog converter? does it contain a sample-and-hold circuit? does it induce aperture jitter?
thanks


texts:
I'm very new to the DSP world, and honestly I'm not even sure if this is the right place for this question.
Anyway, I found this piece of code on github, it's a kind of filter (I think), and I would like to know if this can be identified as a commonly used or well known concept. Does it have a name I can use to google? Where do I start to learn more about this, like how does one come up with this code.
The (relevant) code:
This is calculated once:
// Set the loop bandwidth to bw Hz.
w = 6.28f * 20 * bw * bsize / fsamp;
w0 = 1.0 - exp (-w);
w = 6.28f * bw * ratio / fsamp;
w1 = w * 1.6;
w2 = w * bsize / 1.6;

z1 = 0.0
z2 = 0.0
z3 = 0.0

This is calculated every loop:
// Run loop filter and set resample ratio.
z1 += _w0 * (w1 * err - z1);
z2 += _w0 * (z1 - z2);
z3 += _w2 * z2;

rcorr = 1 - z2 - z3;

In these snippets err is the input of the filter and rcorr is the output. bsize, ratio and fsamp are some constants.
For completeness, this code is from here on github.


texts: Sampling Theorem and Signals Explained to a Mathematician

texts:
Let $f:\left(-\frac T2,\frac T2\right)\to\mathbb{R}$ for some $T>0$. The Fourier coefficients of $f$ are $$\left\{\begin{matrix}a_0&=&\displaystyle\frac 1T\int_{-T/2}^{T/2}g(t)\;dt\\a_k&=&\displaystyle\frac 2T\int_{-T/2}^{T/2}g(t)\cos\left(k\frac{2\pi}Tt\right)\;dt\\b_k&=&\displaystyle\frac 2T\int_{-T/2}^{T/2}g(t)\sin\left(k\frac{2\pi}Tt\right)\;dt\end{matrix}\right.\;\;\;\;\;(k\in\mathbb{N})$$
and the Fourier polynom of degree $n\in\mathbb{N}$ itself is $$\mathcal{F}_n[f](x):=a_0+\sum_{k=1}^n\left(a_k\cos\left(k\frac{2\pi}Tx\right)+b_k\sin\left(k\frac{2\pi}Tx\right)\right)\tag{1}$$ Now, for any $g\in L^2$, where $$L^2:=\left\{g:(-\pi,\pi)\to\mathbb{C}:g\text{ is continuous almost everywhere}\right\},$$ the complex Fourier coefficients $c_k$ of $g$ satisfy Parseval's identity, i.e. $$\sum_{k\in\mathbb{Z}}\left|c_k\right|^2=\frac{1}{2\pi}\left\|g\right\|_{L^2}^2\tag{2}$$

Now, we can interpret $f$ as a $T$-periodic signal that we want to transmit over a channel. I'm asking myself the following questions:

What is the signal bandwidth?$^1$
What is the frequency spectrum?
What is the channel bandwidth?
What does the sampling theorem state?
I've read that the square of the $k$-th coefficient, i.e. $a_k^2+b_k^2$, is proportional to the "energy contained in this harmonic". I think this is somehow related to $(2)$. But I have no idea what is meant by energy.

I've read all the definitions, but (as I'm a computer science and mathematics student with almost no relation to physics) I wasn't able to answer the questions above by myself.

I know that $(4.)$ has something to do with the fact, that we need to use some kind of discrete Fourier transformation, i.e. we consider an equidistant grid $$x_j=-\pi+j\frac \pi N\;\;\;\text{for }j=0,\ldots,2N$$ and (maybe) use the composite trapezoidal rule to approximate $$c_k=\frac{1}{2\pi}\int_{-\pi}^\pi f(x)e^{-ikx}\;dx\approx\frac{1}{2N}\sum_{j=0}^{2N-1}f\left(x_j\right)\exp\left(-ik\frac{2\pi}Tx_j\right)$$ So, I think the sampling theorem targets the question how huge do I need to choose $N$ in order to reconstruct (what exactly does that mean? If the Fourier polynom has infinitely many summands we cannot reconstruct the original function) the signal and at which size of $N$ it would be pointless to choose an even bigger $N$.

$^1\;\;$My lecture notes distinguish whether or not $\displaystyle\mathcal{F}[f]:=\lim_{n\to\infty}\mathcal{F}_n[f]$ is actually finite (i.e. $\exists k_0\in\mathbb{N}:\forall k\ge k_0:a_k=b_k=0$). They state, that "the signal bandwith is the difference between the lowest and the highest frequency"?  What does that mean? In the first place, I wasn't even sure if signal bandwidth is a property of $f$ or $\mathcal{F}[f]$. Considering $f$, I would not understand why $f$ should have multiple frequencies and how I would calculate them. So, I think we need to consider $\mathcal{F}[f]$. More precisely, I think we need to look at the "frequencies" of the sine and cosine functions in the $k$-th summand in $(1)$. Obviously, these frequencies are both equal to $$\mathcal{f}_k:=\frac kT$$ and independent of $f$. But, I still don't understand how I can determine the "highest" frequency.


texts: Describe quality of rectangular signal detection

texts:
I have some process, which produces some rectangular signal. I have an algorithm, which recovers this signal. To test my algorithm I compare the recovered signal with known:

My question is:
Could You help me with some common and well-established methods to describe the quality of my detector?
Of course, I am able to calculate the number of non-detected jumps, delay its deviation. The question is that I don't want to use homemade solutions. Hope there should be a big science with well-established methods and criteria to perform such tests.


texts: Why is it necessary to implement octaves in sift

texts:
I've been studying sift very hard for two weeks.
I found much materials about scale space.
It is very hard to understand scale space depthly.

What I've found and confusing things are that

'scale' in scale space means the sigma of gaussian function.
'octave' is used to represent images that are reduced.

In paper by Lowe, for each octave, images are represented. Is it not necessary? In other words, is only scale space sufficient?

I've seen many web sites as well as here, but scale space is very hard. Is there anyone who can explain in detail?


texts: Filter for DC component in FFT2 of image

texts:
I am trying to get the main frequency of the Fourier Transform of the image below, which is the intereference pattern detected by a CMOS sensor.

When I apply fft2, I got the DC peak at 0 frequency, that I know it can be suppressed if I do FT = fft2(image-mean2(image)). However, I only obtain a 0 in the (1,1) position, but the "neighbor" frequencies in the first row and column have still a higher magnitude that the peak I want to detect, which is in the (6,11) position.

Is there a formal way to filter the image, meaning without imposing FT(1,:) = 0, FT(:,1) = 0, in order to be able to extract directly that peak?


texts:
I'm using a set of features extracted from a signal for classifying the data window with KNN algorithm. Since the features have different value ranges, their influence on distance calculation is different when you use euclidean distance in KNN.

To equalize the influence of these features on classification:

I can normalize features with min-max normalization and then use euclidean distance.
I can use mahalanobis distance.

What are the advantages of these two approaches over eachother?


texts: Need critical help: How to detect and distinguish two very similar looking signals?

texts:
Hi guys I have a really tough signal processing question here.

How do you detect and distinguish two very very similar looking waves?

I need to distinguish between these two signals for an online application and the techniques so far have all failed. These two signals have very similar and often unpredictable amplitudes. Almost identical frequency. So the only way I can attempt to distinguish between the two is using time domain features.

Signal 1:

Signal 2:

The data is streamed live in every single second (at 128 samples per second). My approach is to:

use a window of size 128 samples to obtain the data
Calculate the time domain features of the data
features such as:

derivative between the mean of the current 128 samples and previous
128 samples,
derivative between the max point of the current 128 samples and
previous 128 samples
skewness of the data
kurtosis of the data
deviation from the mean

If derivative goes down, then we say it is signal 1 and if derivative does down we say it is signal 2

But the problem is that the two signals look very very similar. So if the window is incorrectly placed (i.e. on the rising or falling phase after the initial signal), then it can give me the complete opposite result!

Can someone give me some suggestions as to what features I should use or what technique I should use to distinguish between this two very similar looking signals!


texts: different moving average filters differences

texts:
Suppose we want to use a moving average filter (3-point moving average) for $X[n]$ (where $Y[n]$ is output). What are the differences among

$Y[n]=\frac13X[n-1]+\frac13X[n]+\frac13X[n+1]$,
$Y[n]=\frac13X[n]+\frac13X[n+1]+\frac13X[n+2]$, and
$Y[n]=\frac13X[n]+\frac13X[n-1]+\frac13X[n-2]$ ?


texts: Software based synchronizing of multiple data streams/sensors with slightly differing sampling rates

texts:
Situation:
I try to synchronize the data streams of multiple sensors (ADXL372) of the same type but with different data output rates. The data sheet states all sensors should have the same sampling rate but in reality they differ with up to +- 10%.

My initial idea which is nearly completely implemented is the following:

estimate the real sample rate for each sensor (by dividing the received number of samples by a specific timespan)
get the batches of the aviable samples from the FIFOs of all sensors
calculate/estimate the real timestamps for these data samples of the batches by using the system clock of the master and the sensor specific estimated real data output rates
interpolate via sinc interpolation at the desired timestamps (dependent on the desired nominal sampling rate)

This approach brings because of the batch-wise data arrival some nasty and quite complicated case-based reasoning with it.

My Question:
Is there are more elegant and straight forward way to tackle this problem without using a hardware based sensor synchronization via interrupts?


texts: Distortion in sound after multiplying frequency spectrum by constant

texts:
I make a simple sound equalizer that operates in frequency domain and lets user to adjust frequencies in sound by using 4 sliders. The first one responsible for 0 - 5kHz, the fourth one for 15-20kHz.

Steps are as follows:

I read wav file and store it in float array
I perform complex fft on that array (separately for left and right channel)
I multiply real and imaginary parts of bins representing 0-5kHz frequencies (both positive and negative) by 1.1 3.981 to increase these low frequencies by 10% 12dB in the final sound.
I perform ifft on array
I alternate real parts of left and right channels (returned by ifft) to create the final audio

The problem is that after this process the sound is distorted. It sounds like the speakers were not plugged in correctly. I found that if I divide values returned by ifft by arbitrary constant then the final sound is right, but is much quieter. I make the division in time domain, on the results from ifft.

The problem doesn't occur if I multiply frequencies by a number less than 1. So if frequencies are attenuated no further division in time domain is needed.

I suppose there is a mistake in the whole process. But if all steps are fine, how should I deal with distorted sound? Is dividing in time domain a proper solution? What number should I use to divide the results then so the sound is not distorted?

EDIT

This is the code I use to perform presented steps. I use Apache Commons math implementation of FFT and SimpleAudioConversion class taken from there http://stackoverflow.com/a/26824664/2891664

Unfortunately, code highlighting doesn't work.

// read file and store playable content in byte array
File file = new File("/home/kamil/Downloads/Glory.wav");
AudioInputStream in = AudioSystem.getAudioInputStream(file);
AudioFormat fmt = in.getFormat();
byte[] bytes = new byte[in.available()];
int result = in.read(bytes);

// convert bytes to float array
float[] samples = new float[bytes.length * 8 / fmt.getSampleSizeInBits()];
int validSamples = SimpleAudioConversion.decode(bytes, samples, result, fmt);

// find nearest power of 2 to zero-pad array in order to use fft
int power = 0;
while (Math.pow(2, power) < samples.length / 2)
    power++;

// divide data into left and right channels
double[][] left = new double[2][(int) Math.pow(2, power)];
double[][] right = new double[2][(int) Math.pow(2, power)];

for (int i = 0; i < samples.length / 2; i++) {
    left[0][i] = samples[2 * i];
    right[0][i] = samples[2 * i + 1];
}

//fft
FastFourierTransformer.transformInPlace(left, DftNormalization.STANDARD, TransformType.FORWARD);
FastFourierTransformer.transformInPlace(right, DftNormalization.STANDARD, TransformType.FORWARD);

// here I amplify the 0-4kHz frequencies by 12dB
// 0-4kHz is 1/5 of whole spectrum, and since there are negative frequencies in the array
// I iterate over 1/10 and multiply frequencies on both sides of the array
for (int i = 1; i < left[0].length / 10; i++) {
    double factor = 3.981d; // ratio = 10^(12dB/20)
    //positive frequencies 0-4kHz
    left[0][i] *= factor;
    right[0][i] *= factor;
    left[1][i] *= factor;
    right[1][i] *= factor;

    // negative frequencies 0-4kHz
    left[0][left[0].length - i] *= factor;
    right[0][left[0].length - i] *= factor;
    left[1][left[0].length - i] *= factor;
    right[1][left[0].length - i] *= factor;
}

//ifft
FastFourierTransformer.transformInPlace(left, DftNormalization.STANDARD, TransformType.INVERSE);
FastFourierTransformer.transformInPlace(right, DftNormalization.STANDARD, TransformType.INVERSE);

// put left and right channel into array
float[] samples2 = new float[(left[0].length) * 2];
for (int i = 0; i < samples2.length / 2; i++) {
    samples2[2 * i] = (float) left[0][i];
    samples2[2 * i + 1] = (float) right[0][i];
}

// convert back to byte array which can be played
byte[] bytes2 = new byte[bytes.length];
int validBytes = SimpleAudioConversion.encode(samples2, bytes2, validSamples, fmt);

You may listen to the sound here
https://vocaroo.com/i/s095uOJZiewf


texts: Is there a problem with using the WAV format for non-audio signals?

texts:
I have biological signals sampled at 1 kHz. The signals tend to behave fairly simply, sinusoidally. The software I've used to collect these data uses their proprietary format (*.adicht) and so I have to export to something I can work with in MATLAB, for example. I also have audio recordings from the same sessions for importing to praat, which accepts WAV files.

The formats available for export include WAV, tab-delineated text, and an unwieldy .mat conversion process that sometimes causes the program to crash.

My question is whether there is a disadvantage to exporting everything as WAVs, or a specific reason why I would want to use text over WAVs? Is there a drawback to using the WAV format for non-audio signals, or is it just unnecessary?

It will save me a lot of time if I export to a single format, and since I know I need WAV for audio analysis in praat, it would be easier just to export the non-sound signals that way as well (this program does not handle macros/batch scripting very well).


texts:
In digital communication systems, we use forward error correction codes such as LDPC, turbo, convolutional codes (to decrease the bit error), then we have to use an appropriate decoder at the receiver side.

For example if using convolutional codes, one should use Viterbi decoder. My questions are next:

What is the optimal decoders for LDPC, and turbo codes?
What is the role of a detector then? Is a detector a demodulator or something else (I have read that they could be MMSE, ZF, etc) ?

I think I am confused with what is the function of each of the detector, demodulator, decoder?


texts: Why can adding delay improve the phase fit in fitting complex transfer functions?

texts: When you fit an IIR filter to a complex transfer function you can use a delay to get a stable filter and improve the fitting results in your phase response. Can anyone explain me the reason for this and/or link me to some literature explaining this? I can't find any good literature on this.


texts: Easiest Pattern to Recognize with Machine Vision

texts:
I need to detect the exact position of some kitchen tools using machine vision. I've the possibility to label the tools with a pattern, to make the detection (more specifically the image segmentation) easier.
What is the easiest pattern to detect using machine vision?
The pattern should be:

Easy detect in presence of partial occlusions.
Easy to detect with varying and degraded light conditions.
Easy to detect with widely used computer vision algorithms, in particular lightweight algorithms that can run on edge devices.
Hard to mistake for another object (in a kitchen).
Possibly carrying some additional information.

A QR code fits this description pretty nicely. My guess is that the easiest pattern will contain a sharp alternation of two colors, likely black and white.


texts: library for computing differential signatures from 2D planar curves

texts: For one of the lectures on 2D planar differential geometry in the series "Image and Video Processing: From Mars to Hollywood With a Stop at The Hospital", the lecturer discusses differential signatures based on parameterization of a 2D planar curve (starts at approx minute 17 in the link attached). I'm not sure if there is some other terminology used but I'm having a hard time finding a software library that can extract such differential signatures once a curve has been segmented/identified in an image. Is there some other name that such a process is called or is there some other method that can extract similar features? I tried searching the OpenCV library but I wasn't certain.


texts:
As much as I understand the F should be the interval medians (correct me if I wrong), according to the next slide, where is also the Loss function defined:

What I don't understand is the next note in the question:

What does this assumption gives me ?
Why do I need it ?
What information does it gives me that the integral over the reciprocal of $f$ is 0 ?
How does this assumption expressed in the proof of the MAD or in it's loss?
Thank you in advance.


texts:
I'm working on color-balancing images with as little input from the user of my app as possible, specifically to remove color casts caused by scanning aged paper. Photoshop's Auto Color action works great, with no input at all, but I don't even know where to begin in implementing something like that.

Where can I find an example of how to do that? I've done extensive searching and haven't found a good example. To see the correction I'm talking about, take a look at this question on Stack Overflow.


texts: Whether convolution followed by down sampling equals wavelet decomposition

texts:
I know that wavelet decomposition equals convolution followed by down sampling by two.I tried to test this on mat lab on haar wavelet. I write the below code and compared with the default wavedec command in mat lab. The code I wrote is shown below.

clear all
clc
h=[0.7071    0.7071];% Haar scaling filter
g=[-0.7071    0.7071];%Haar wavelet filter
x=[1:10];% Input
h=fliplr(h);% h(-m)
g=fliplr(g);%g(-m)
s=conv(h,x);
s=downsample(s,2)
d=conv(g,x);
d=downsample(d,2)
[a L]=wavedec(x,1,'haar') % for comparison

After running this program I get s =  0.7071    3.5355    6.3639    9.1923   12.0207    7.0710.
d =  0.7071    0.7071    0.7071    0.7071    0.7071   -7.0710  and the wavedec out put as a = 2.1213    4.9497    7.7782   10.6066   13.4350   -0.7071   -0.7071   -0.7071   -0.7071   -0.7071. L =   5     5    10

I dont know why wavedec and my code gives different out puts, will any one help???


texts: Line coding for a modulation order that is not power of 2

texts:
In case a symbol encodes a non-integer number of bits, how is done the bit-symbol pairing?

For example, we have a 3-levels FSK with bit rate of 1Mbps and a sequence 01011001. What is the symbol period? What is the sequence of symbols?

Note: My guess is that the actual bit period and symbol period are the same. Hence, the use of 3-levels only helps to increase somehow the robustness of the error detection (similar to Hamming coding or 8b/10b encoding). Thus, we apply a bipolar AMI (Alternate Mark Inversion) to the bit sequence to obtain {0,+1,0,-1,+1,0,0,-1}. Finally, in the receiver, we demodulate every symbol 0 as a bit 0, and every symbol +1 and -1 as a bit 1.


texts: What is the relationship between Noise variance and Binary Rate?

texts:
I have one channel with its maximum capacity $C_s$ defined by SNR [30dB] using the Shannon Theorem.

Using that information I can get the top limit of my binary transmission rate. $R\le C_s$.

I want to transmit a gray leveled television signal with 4,5MHz bandwidth (only pixel information). So I can feed 576*720*25Hz pixels per second with 20 gray levels, at the limit of $C_s$.

The question is, how can I get the noise variance if I increase the binary Rate (using for example 25 levels) greater than $C_s$. I can imagine that if I increase $R$, noise variance is increased, but how can I simulated using a matlab program.

The noise is consider gaussian additive noise with median zero, and variance $\sigma^2$. The image is equally distributed around all pixel levels.


texts: response of LTI system to a Random Input Signal

texts:
what is LTI filter? what is the output when x(t) is input?

let x(t) be the input signal to the system and y(t) denote the output signal. The output of the system may be expressed in terms of convolution integral as

Why we are not taking average of h(t) also?

How comes E(X(t-tau)) to mx?


texts: How to undo dynamic Doppler effect by software?

texts:
I have a signal affected by Doppler effect. In general, the Doppler effect changes the scale of the time and frequency domains. So, to undo this phenomenon, I am using a sampling rate converter. Two possible implementations using polyphase structures are shown in Figures 1 and 2. They both work fine as expected. The recovered signal has no Doppler shift.

.

However, while in presence of dynamic Doppler, i.e. the compression/expansion factor varies over time, I am not sure if this solution is appropriate. I am buffering the signal, and for each buffer I compute the corresponding $L$ and $M$ factors that undo the Doppler effect. Nevertheless, there exists a trade-off between buffer length and the frequency resolution. In other words, in a buffer I still have a varying Doppler shift, so the $L/M$ ratio should not be a constant during a single buffer.

Is there a way of apply a sample-to-sample method to undo dynamic Doppler effect? I am currently interested in software-based solutions, not hardware-based ones. For example, in hardware I would dynamically modify the sampling rate. What about in software? How can I dynamically modify the sampling rate?

References:

Both figures were taken from:

R. E. Crochiere and L. R. Rabiner, Multirate Digital Signal Processing. Englewood Cliffs, NJ: Prentice-Hall, 1983


texts: Does Hamming encoding preserve orthogonality?

texts:
The question I have is this-- if I have two binary vectors, i.e. $x_1, x_2 \in \mathbb F_2^k$ that are orthogonal, i.e. $x_1^T x_2 = 0$, and let's say I Hamming encode each of them separately with an $(n,k)$ code to produce $y_1, y_2 \in \mathbb F_2^n$, respectively.

Can we make any general statements about the orthogonality of $y_1$ and $y_2$? Will they be orthogonal also?


texts:
At first  I had trouble proving the time variance for this as I would do the usual mistake as in question Is the system represented by the equation $y(t) = x(2t)$ time invariant?. The solution has graphical representation of all the shifts in the process and they are the following.

I get the shift from the first picture to the second. It gets compressed, I know that property. I also understand what happens in the third picture. The $x_1(t)$signal is shifted to the right because of $t-2$ . The fifth picture is fine as well, it's just a shift to the right again from the second picture.

What I'm having trouble with is the 4th picture. I know that $y_2(t)=x_2(t)=x_1(2t-t_0)$ I forgot to mention, all the graphs are for $t_0=2$.

Shouldn't the 4th picture be a shift of 2 to the right?
And the last one maybe $(2t-2t_0)$ so $2t_0=4$ units to the right?


texts: Auto Detection of Rotation Angle on Arbitrary Image with Orthogonal Features

texts:
I have a task at hand where I need to detect angle of an image like the following sample (part of microchip photograph). The image does contain orthogonal features, but they could have different size, with different resolution/sharpness. Image will be slightly imperfect due to some optical distortion and aberrations. Sub-pixel angle detection accuracy is required (i.e. it should be well under <0.1° error, something like 0.01° would be tolerable). For reference, for this image optimal angle is around 32.19°.

Currently I've tried 2 approaches:
Both do a brute-force search for a local minimum with 2° step, then gradient descend down to 0.0001° step size.

Merit function is sum(pow(img(x+1)-img(x-1), 2) + pow(img(y+1)-img(y-1)) calculated across the image. When horizontal/vertical lines are aligned - there is less change in horizontal/vertical directions. Precision was about 0.2°.
Merit function is (max-min) over some stripe width/height of the image. This stripe is also looped across the image, and merit function is accumulated. This approach also focuses on smaller change of brightness when horizontal/vertical lines are aligned, but it can detect smaller changes over larger base (stripe width - which could be around 100 pixels wide). This gives better precision, up to 0.01° - but has a lot of parameters to tweak (stripe width/height for example is quite sensitive) which could be unreliable in real world.

Edge detection filter did not helped much.

My concern is very small change in merit function in both cases between worst and best angles (<2x difference).

Do you have any better suggestions on writing merit function for angle detection?

Update: Full size sample image is uploaded here (51 MiB)

After all processing it will end up looking like this.


texts: Correct way of derivating in frequency domain with FFT

texts:
I believe I am very close to the answer and only need a small nudge to get to the answer.

What I want:
I want to take a signal, use FFT to transform it to the frequency domain (FD), multiply it by $jw$, and then transform it back to the time domain (TD).

Why do I want it:
Because it's something that I should be able to solve in my position, I want to know how to do it properly. And because it would be fun to make a very low-end spectrum analyzer with an Arduino and instead of sending a pulse I can send a step instead, derive the output to get an impulse response. I know that I also can send square waves and use a Goertzel filter and look for the fundamental sine in the square wave, but... as I said earlier. I want to know how to do this properly.

What I've tried:
I thought I'd go for the simplest case first, a square wave and a triangle wave.

The fourier series for a square wave is:
$$\text{square_wave}(x) = \sum_{n=0}^\infty\frac{\sin\biggl(x(2n+1)\biggr)}{2n+1}$$

The fourier series for a triangle wave is:

$$\text{triangle_wave}(x) = \sum_{n=0}^\infty\frac{\sin\biggl(x(2n+1)-\frac{\pi}{2}\biggr)}{(2n+1)^2}$$

The derivative of a triangle wave is a square wave, from the equation above it's clear that multiplying by $jw$ phase shifts each sine and amplifies each sine correctly to get rid of one $(2n+1)$ factor.

I know that the derivative of the 0 Hz component is 0, so in the FD I know all values that I need to multiply my signal with, except for the highest frequency component, but I'll set that one to 0 too because I don't know what it should be.

I also know that the frequency spectrum is mirrored around the middle for real valued inputs, and that the second half of the spectrum is just the conjugate of the first half.

This means that the vector I need to multiply the signal with in the FD for a 32 bin FFT looks something like this in matlab/octave code:

derivative = [0,i*1:15,0,-i*15:-1:1]
%comments:
%0 = 0
%1:15 = 1,2...14,15
%15:-1:1 = 15,14...2,1

derived_signal = ifft(fft(signal).*derivative)

My make-a-sense-o-meter says that it makes sense, yet when I multiply my signal with it I get something that is very close to the derivative, but not 100% correct. I get a better result if I multiply by the FFT of [0,-1,zeros(1,29),1] which is a first order derivative approximation. See figures below for octave plots.

Here is the code I used in case anyone else wants to mess around:

triangle=[linspace(-1,1,16),linspace(1,-1,16)];

subplot(1,2,1)

plot(0:31,triangle)

xticks([0 7 15 23 31])
axis([-1 32 -1.1 1.1])

title("32 point triangle wave")
grid

subplot(1,2,2)
hold on

dt_jw=real(ifft(fft(triangle).*[0,i*(1:15),0,-i*(15:-1:1)]));
plot(0:31,dt_jw)

dt_convolution=real(ifft(fft(triangle).*fft([0,-1,zeros(1,29),1])));
plot(0:31,dt_convolution)

axis([-1 32 -1.1 1.1])
xticks([0 7 15 23 31])
yticks([1 dt_jw(floor(length(dt_jw)/4)) dt_convolution(floor(length(dt_jw)/4)) 0 -1])

title("d/dt(triangle)")
legend("fft(tri)*jw","convolution with [-1,0,1]")

grid
hold off

I feel like I'm very close to the answer and that I'm missing something very obvious.

So why does multiplying by $jw$ not derive my triangle wave into a nice square wave? Because so far it makes more sense to convolve my triangle wave by a 1st order derivative approximation.


texts:
I am trying to understand reconstruction of analog signal
I am using the files available on mediafire
There are two files, M-files through which we get input values from user and then feed those values to simulink model(also available on media fire)
I am pondering,where in this simulink model,can i apply/insert settings for mu-law companding method forexample if i want to have mu=255
Links of files are given below:
https://www.mediafire.com/file/bc0n2a0jbngeojk/mfile_sampling.m/file
https://www.mediafire.com/file/mulc5tsrm7b8b8u/sampling.slx/file
I have also attached snapshot of simulink model


texts: How to detect and remove ringback-tone and ivrs voice etc from the beginning of an audio call recording

texts:
In an audio recording (say a telephone conv. b/w two people), how would I programatically detect and remove the dial-tone at the beginning of a call using python.
Ex :
As you can see the first 15 seconds or so is just a dial tone like tring-tring-tring-tring.

Are there any audio analysis libraries in python that could  help me achieve this?

If this is not the right forum, kindly point me to the right place.


texts: The sum part of the formula for a signals power

texts:
$$P_x=\lim_{M\rightarrow \infty }\frac{1}{2M+1}\sum_{n=-M}^{M}\left | x[n] \right |^2$$

I have used this formula to find out the powers for different signals, but the sum part of the formula still puzzles me.
Lets take one example:
$$x[n] = 4i+1$$
Simply calculating the absolute value, I got this:
$$|x[n]|^2=|4i+1|^2=(\sqrt{4^2+1^2})^2=17$$
17 seems to be the answer I got after going through the rest of the formula, but I am not sure how the sum works. By using Wolframa, I arrived at:
$$\sum_{n=-M}^{M}17 =34M+17$$
Which would complete the limit part of the formula with the final result of 17, as discussed. How does this sum function, as described above?


texts: How to Synchronize multiple real time audio streams before mixing them?

texts:
I have been working on a VoIP solution in which I have to mix multiple audio streams coming from various sources. I have been facing muffled sound after the mixing of streams. I have implemented ASW and AAW techniques from the following paper Audio mixer for multi-party conferencing in VoIP

Is there any way to synchronize various streams before addition? I have been searching for a solution for a long time.


texts:
I have got this question: let's suppose that I have three signals, representative of the same variable, but taken on three different component of a same device; in my case, three load signals, representative of the out-of-plane bending moment Mx of each of the blade of a wind turbine.

Is it any possible to effectively and efficiently detect the degree of imbalance or asymmetry of such signals?

With asymmetry and imbalance I mean a single parameter/variable which gives information about how the three signals differ from each other.

I would then set-up a threshold value to this degree of difference, in order to further trigger a certain process when the threshold has been overcome.

The first idea I came up with is multiple correlation, but perhaps there exist tons of better methods.

EDIT

Each signal coming from each blade;
Blades placed with 120 deg phase shift;
Azimuth angle vs. Time available.
Regarding balance vs. unbalanced, I only know that unbalanced condition leads to higher loads on blades. In general, the three signals will always be unbalanced: what I would like to ascertain is the degree of imbalance; is it over a defined allowed limit or not?


texts: How can a signal be both periodic and random?

texts: Do any examples of such signals exist where the signal is both periodic and random? Because as I see it, if a signal is periodic then the randomness kinda goes away because you know what the signal will look like after some time.


texts: Causal unstable system turn into stable anticausal?

texts:
I would appreciate it very much if someone would be able to provide some clarity, help or comment on this problem.
I have been reading several papers on time series identification such as

https://www.jstor.org/stable/24305996
https://www.jstor.org/stable/24307363
https://www.jstor.org/stable/24308842

and system identification

https://doi.org/10.1016/S1474-6670(17)56646-X
https://doi.org/10.1109/78.258141
https://doi.org/10.1109/9.827371

among several others.

The question is, given an unstable causal system, is it possible to turn it into an anticausal but stable system in order to simulate it? (assuming that I have the complete input sequence).

I think it might have to do with the time reversal property of the Z-Transform, i.e.

$\mathcal{Z} \left\{ x[n] \right \} = X(z)$ with it's ROC given by $r_2<|z|<r_1$, then

$\mathcal{Z} \left\{ x[-n] \right \} = X(z^{-1})$ with $\frac{1}{r_1}<|z|<\frac{1}{r_2}$

however i can't figure it out.

In the Forssell and Hjalmarsson paper says that backward filtering is common in off-line signal processing applications, like the zero-phase filtering (filtfilt in Matlab) and the implementation of non-causal Wiener filters. The relevant (at least for my question) equations are the (31), (32) and (33).

To illustrate the problem, please consider the following system given by

$y[n] = \frac{B(z)}{A(z)} u[n] = \frac{(z-0.1)}{(z-0.5)(z-5)} u[n]$;

assume that the complete input sequence $\left\{ u[n] \right\}^{N}_{n=0}$ is known (available).

Then, it is possible to separate the system as follows

$y[n] = \frac{B(z)}{A_s(z)} \frac{1}{A_a(z)} u[n],$

where $A_s(z)$ and $A_a(z)$ represents the stable and anti-stable monic parts of $A(z)$ respectively. Thus we can obtain the causal part of $y_{\text{C}}[n]$ by computing

$y_{\text{C}}[n] = \frac{B(z)}{A_s(z)} u[n] = \frac{(z-0.1)}{(z-0.5)} u[n]$

followed by

$y[n] = \frac{1}{A_a(z)} y_{\text{C}}[n] = \frac{1}{(z-5)} y_{\text{C}}[n]$

So here is my problem. The approach given in Forssell and Hjalmarsson is the following

in order to obtain $y[n]$ backward-filter the reversed sequence given by $\left\{ y_{\text{C}}^R[n] \right\}_{n=0}^{N}$ through the filter $\frac{1}{A_a(z)}$ as follows

$y^R[n] = \frac{1}{A_a(z)} y_{\text{C}}^R[n]$

the desired signal $y[n]$ is then finally obtained by reversing the sequence $\left\{ y^R[n] \right\}_{n=0}^{N}$

I apologize in advance for the length of the question and the orthographic mistakes.
Any comments, suggestions and help will be greatly appreciated. Thanks


texts:
Hello everyone!.
This is a template to QPSK transmission but Packet Encoder block is no longer available in new GNURadio versions, what do I need to replace this block in order to do a QPSK Transmission? Or are there any newer examples?
Thanks in advance. Be safe


texts:
I want to make sure that my units are all correct. I've been using the formula

$$
\frac{P_S}{P_N} = \frac{E_S}{N_0} \frac{R_S}{B}
$$

The dimensions that I'm confident of are

$P_S$, $P_N$ : Watts (Joules/sec)
$N_0$ : Joules/(sec*Hz)
$B$ : Hz

The last two are then (I think)

$R_S$ : symbols/sec
$E_S$ : Joules/symbol

If those are all correct, and given that

$$
\frac{E_S}{N_0}  = \frac{P_S}{P_N} \frac{B}{R_S}
$$

it seems like the units of $\frac{E_S}{N_0}$ are

$$
\frac{\text{Hz}}{\text{symbols/sec}} = \frac{1}{\text{symbol}}
$$

I was under the impression that it should be dimensionless. Is this correct?


texts:
Compute the two-dimensional DFT [4x4] for the following 4x4 image $
 \begin{matrix}
  0.5 & 0.5 & 0.5 & 0.5 \\
  0.5 & 0.5 & 0.5 & 0.5\\
  0.5 & 0.5 & 0.5 & 0.5\\
   0.5 & 0.5 & 0.5 & 0.5
 \end{matrix}
 $

I know that DFT is separable by dimensions – one
can calculate 4 vertical transforms first, then 4 horizontal ones

For each row we get [2 0 0 0] in the first and third row
and zero elsewhere.

For each column we get [1 0 1 0] in the first and third column
and zero elsewhere.

How from this two one-dimensional dfts obtain two-dimensional one?


texts: Calculating colour temperature from two sources of varying luminous intensity

texts:
I'd like to calculate the resultant colour temperature if I were to mix two different temperatures, each at a different intensity in lumens.

I have series of LEDs in two different temperatures, and would like to adjust the combined output using the two sources, but I can't find any information on this. Is it as simple as finding the mean, scaling for a higher luminosity in one source? I'm assuming that the latter portion won't be a simple linear relationship due to human perception.


texts:
I have two signals, I've done a Principal Component Analysis and separated my signals, I get one with noise and one with signal.  .

X = [Data1,Data2]';
Q = X*X';
[W,D] = eig(X*X',Q);
S = W'*X;

The problem is PCA normalizes my signal (the scales are vastly different). I would like to preserve the scale accurately, do I choose different eigenvectors?


texts:
Why do FIR systems need to be antisymmetric about M/2 to be linear phase?
where M=delay.Also im talking about discrete time.And why are hilbert transformers antisymmetric on n=τ?


texts:
I am working on classification and several times I encountered with this term.
What is hard quantization strategy?
What does it differ from soft approach?


texts:
I have implemented DFT from this link.

1) Tried taking dft for the three Channels(R, G and B) and reconstructed the original image by taking inverse dft for all three channels and merged them together, but the image reconstructed doesnot have the same contrast as the original image.

But while altering the flags used in the link as such

  dft(input, Complex, DFT_SCALE);
  dft(Complex, InverseDFTImage, DFT_INVERSE + DFT_REALOUTPUT);
  InverseDFTImage.converTo(InverseDFTImage, CV_8U);

The output is same as the input, but while applying Gaussian filter, there are few colour differences near the edges.

 1. Original Input Image

 2. Output without any filters(followed the Procedure in the link)

 3. After applying Gaussian Low Pass Filter

 Can someone clarify this doubt.?
 P.S Thanks in advance


texts: Can white Gaussian noise improve signal level in non-linear device?

texts:
In the system shown below, can white Gaussian noise amplify or attenuate the input signal?

Most of the time we check signal level proportional to noise level (such as noise figure) not singly.

I have obtained PSD of my desire system's output and it is a combination of

a) Dc term
b) reaction of input noise to itself
c) reaction of input signal to itself
d) reaction of input signal and input noise.

At system's output at frequency $\omega$ should I assume terms (c) and (d) as the signal level? Or c is enough?


texts: How to interpret a break in linearity when performing detrended fluctuation analysis?

texts:
I have time series with 1048 values and when I perform detrended fluctuation analysis on this time series (using the windows or scales of 2^4 to 2^10 values) to calculate the alpha-component I get the following result:

As you can see, the relation is linear with alpha 1.53 indicating a non-stationary process. However, there's a break in the linearity approximately at 2^7 to 2^8 which translates to the windows of 128 to 256 values. Then it gets into the previous pattern more or less.
How can I interpreret this break?
My idea is that we could say that on the windows from 16 to 128 values, there is a power-law relation between the sum of the fluctuations and the window size and the bigger is the scale, the (much) more likely we are to see big fluctuations.
However, at the windows between 128 and 256 values we some some anomalities emerging, which then subside at the windows of 256 values and higher.
Could we say that there is a certain "critical" area in this time series in scales between 128 and 256 size where we are likely to see highly unexpected events?
Do you have any other ideas how we could interpret this?


texts: How to measure the time dependent correlation of two signals

texts:
I have two signals (time series) shown in the plot below. Just by looking at the figure, we can see that the two main peaks of both signals are very closely aligned (correlated), however the red signal has additional features elsewhere which don't match the blue curve.

I am looking for some function which can tell me how correlated these two signals are at a given time. IE: at t = -18 and t = +10 where the peaks are located, the correlation should be very close to -1, while at t = -40, the correlation is probably close to 0.

Specifically, I want a robust way to tell that if I see a peak in the blue curve, then there is a corresponding (negative) peak in the red curve.

I've looked into Cross correlation, however this seems suitable for time series which simply have a constant time lag with respect to each other. In my problem the correlation between my two signals is changing with time. I've thought about dividing up the signal into small bins and computing the correlation of each bin, but I was hoping there is a better way.


texts: Effects of interchanging sine terms with cosine terms

texts:
Suppose we have a real signal $x(t)$. Now, we know that $x(t)$ can be represented as a sum of sines and cosines.
w be the angular frequency.

If $a(\omega)$ be the coefficients of the cosine terms, and $b(\omega)$ be the coefficients of the sine terms, then if we perform a transformation on this signal such that now $b(\omega)$ are the coefficients of not sines but cosines and similarly, $a(\omega)$ the coefficients of the sines, then how will the waveform transform$[x(t)]$  look like?

What will be the similarity between this transformed waveform and the original waveform?
What is the name for this transformation (is it Hilbert transformation? )

Please attach graphs for an example $x(t)$ to clarify.


texts: How to Extract frequency bands from Short-time Fourier Transform?

texts:
I am reproducing the results reported by the author in a research paper. In which he takes the STFT of EEG signals. The input data has a shape of (1 X500) and I used Scipy library built-in function to calculate STFT and the output has shape (257 x32) I need to extract the data between two frequency bands (6-13 Hz) and (17-30 Hz). The author reports the extracted bands to be of the size of (16 X 32) and (23 X 32) but in none of the setting, I am getting this frequency resolution. I tried contacting the author but no response so far. I hope some of you could direct me in the right direction.
Thank you very much.

wlen=64
nfft=1024
temp=S1_769_test[3,0,:]
win=signal.get_window(window='blackman',Nx=wlen, fftbins=True)

f, t, Zxx = signal.stft(temp,fs=500,window=win,noverlap=50,nfft=nfft,nperseg=wlen,
                        boundary=None,padded=False,return_onesided=True)

dat=np.abs(Zxx)/250

if  (nfft % 2):  # odd nfft excludes Nyquist point
     dat[2:,:] = dat[2:,:]*2

else:            # even nfft includes Nyquist point
     dat[2:-1,:]= dat[2:-1,:]*2

band1=np.where((f >= 6) & (f <=13))
band2=np.where((f >= 17) & (f <=30))

extracted1=np.squeeze(dat[band1,:])
extracted2=np.squeeze(dat[band2,:])

extracted2 = cv2.resize(extracted2, dsize=(32,15), interpolation=cv2.INTER_CUBIC)
Combined=np.vstack([extracted1,extracted2])
print (len(band2[0]))
print (len(band1[0]))


texts: How do the English pronunciations of "tiu" and "tou" differ?

texts:
I'm creating an app (I'm a software developer) that for different sounds (interjections from the user) will do different things.
For example if the user says:
"Tiu", than it will do task A,
if it will say "Tou" than it will do task B.

In digital sound, what's the difference between sound (user interjection) "Tiu" and "Tou"?

I need a fast way to say when the user said "Tiu" and when it said "Tou", I don't want to use word/speech recognition because it is too slow for my needs.

I'm mainly interested in the theoretical part of digital sounds. E.g. how can I put in the "Tiu" and "Tou" the following sounds "Ti Tiau Tiuu Tiiiu Too Toou Taou", what are their common "features".

(1) edit

After reading the answers, I must confess that I'm new to speech recognition and any similar domain. I didn't new in what I'm getting myself with this app. But overall the research is fun because I love algorithms and math.

Where I am now?

Currently I am reading/researching/learning about
CMUSphinx Open Source Toolkit For Speech Recognition http://cmusphinx.sourceforge.net/wiki/tutorial. I don't think that I will use this toolkit but it has a good explanation of the basis in Speech Recognition: Basics of Speech.

Also after reading the responses, I ended to the conclusion that a training phase might be quite helpful, anyway I'm investigating more on it.

New Question:

Do you now any good reading material that might help me in gaining more knowledge in this particular domain?

Can the recording device help me in identifying "tou" and "tiu"? e.g. if the device supports different recording filters - like low frequency filters etc...?


texts: Correct transfer function with 1st order IIR filter

texts:
What diffreneces it makes in magnitude and/or phase response when using

$$H(z) = \frac{b_0 + b_1z^{-1} + b_2z^{-2}}{a_0 + a_1z^{-1} + a_2z^{-2}}$$ by adding $b_2=0$, $a_2=0$

instead of

$$H(z) = \frac{b_0 + b_1z^{-1}}{a_0 + a_1z^{-1}}$$

for 1st order filter?

All software I'm using for to build VST plug-ins (SynthEdit, FlowStone, etc.) implements a biquad (BLT) module for coefficient input and now it looks like I can't get 90° phase response with a filter designed using Octave (by Octave plot phase is 90°).

EDIT: Ok, digged the web a bit more and found these three (1 2 3) articles published at analog.com. Is the situation same with one pole allpass filter vs biquad allpass filter (what are the phase responses for these?)?