texts: Extracting the DC component of a signal, that proportional to the displacement about the y-axis

texts:
I’m not sure that I clearly enough reflected the essence of a small problem in the title of the topic, but I’ll try to reveal its essence in the question itself.

https://www.wolframalpha.com/input/...

We have two signals.

If the signal is shifted more to the positive region (up along the $y-axis$), then we "mentally associate the $+1$ sign with it, if it is negative (down the $y-axis$), then we" mentally associate the $-1$ sign with it".

If both the positive and negative regions are approximately the same, then the DC component should be approximately equal to zero.

How is it possible to extract the DC component of the signal proportional to the displacement about the y-axis:

1. Use mathematical functions? If so, which ones?

2. Use filters? If so, which filter to choose to solve this problem?

I am an amateur in signal processing, I began to study this theme not so long ago.


texts:
I am working with signals that consist of consecutive equidistant dips. I am trying to write an algorithm that finds the absolute lowest (minimum) point in each of the dips.

We don't know the temporal period of the signal in advance. So, how can we partition the data in the horizontal direction (time), so that the program knows in what regions to look for a minimum?

Any suggestions would be greatly appreciated.

P. S. Here is an example of my signal after some minor smoothing:

For a more convenient analysis, I have excluded all the data points except those above a certain percentile (here $3 \sigma$) from the median as shown above. This is likely not a very robust approach, and I can't move much further down because the depth of the dips can vary considerably.


texts: Why discrete time signals are defined as sequence of numbers?

texts: When a discrete-time signal is obtained by sampling a continuous-time signal, why we are removing the information about sampling interval and only deal it as a sequence of numbers?


texts: Does the input data have to be passed through the Baum-Welsh function to compute the Viterbi decoder?

texts:
I'm using a Hidden Markov Model in order to train an application for gesture recognition.

Currently, I have gathered samples, and, using a library have trained these values (They have been passed through a Baum–Welch function in order to train the dataset.

I then (in real-time) have computed the gestures of each model, however, I get the wrong result back. I have only ever used a HMM and trained using MFCC features.

Does the actual input data have to be passed through the Baum-Welsh function too, in order to compute the Viterbi-Decoder algorithm? When using MFCC, I did not have to perform such an operation, but, I was lead to believe that the HMM can be trained using the MFCC features, in this instance the real-data is just of doubles.


texts: I have checked this and this Question in this site very much similar to my question. But I want to know are they Qt compatible? I want to start learn developing DSP application in Qt framework so I want some library compatible with Qt so that it can later be translated into Qtpython also? Can we use same libraries with Qt as it is? Will it make effect on changing data types to and from this library to QtObject? I am new to DSP and Qt. so may be the question seems silly.


texts: How to implement filter poles in noise shaping for ΔΣ modulator?

texts:
I am currently stuck trying to implement filter poles to stabilize a ΔΣ modulator. What I think I know is:

a noise shaping filter with only complex zeros along the unit circle destabilizes a 1 bit ΔΣ modulator when the order is beyond 2.
filter poles can be used to reduce the out-of-band noise, making the modulator more stable

For testing this approach, I am trying to realize a simple 2nd order modulator with 2 zeros and 2 poles.
Initially, I tried it without the poles and only with the two zeros which works and I implement it in the following way for testing (using python/numpy):
import numpy as np
roots = np.exp(1j*np.array([0.05, -0.05]))                  # two exemplary complex roots
b = np.poly(roots)                                          # and corresponding filter coeffs
errors = np.zeros_like(b)
signal = np.random.rand(100) - 0.5                          # any signal smaller than [-1,1]
samps = np.zeros_like(signal)
for iSAM in range(len(samps)):
    desired = signal[iSAM] + np.dot(b[1:],errors2[:-1])     # add the filtered errors to the input
    samps[iSAM] = np.sign(desired)                          # discretize to 1-bit
    errors = np.roll(errors, 1)
    errors[0] = samps[iSAM] - desired                       # calculate new error

As expected when FFT'ing the results, I see a frequency response like that of the desired filter.
Also as expected when adding another root at exp(i*0)=1 (creating a 3rd order modulator), the whole thing becomes unstable, even for small inputs.
I have no issue making filters with poles, and defining their frequency response. I am also able to take a time domain signal and filter it, with the designed biquad filter (2 zeros, 2 poles) and I obtain correct results.
The question is: how do I use the poles in the noise shaping algorithm. How would I even use a simple biquad filter for noise shaping ? I have watched many videos and papers today, but still don't understand it. Everyone draws these diagrams like this here from a video series i watched: https://youtu.be/IE8tU_10Hpg?t=63
A more detailed flow chart is in Stanley Lipshitz paper from 1991.
However, even if i follow this flow chart literally, I get no results. The state variables just explode. The guy in the video series also implemented a 3rd order filter with 3 zeros and 3 poles to define a stable 3rd order modulator. While I can reproduce the filter coefficients, and the Noise transfer function (NTF), I don't understand how to actually use the filter. In one video he makes a quick remark about testing the filter performance in a simulation. He says that performing the test is "trivial" or something like this. So obviously I am missing something very fundamental here :)
UPDATE:
After more days of trying, I am really at a loss. Can anyone please post an example of noise shaping with even a very simple IIR filter, even with only 2 zeros and 2 poles. The shaped noise spectrum should reproduce the magnitude response of the designed filter.
I am putting some bounty on it as much as I can. Because all the guides on the internet haven't helped me. I don't care about which programming language you use for it but the shaped spectrum should demonstrably produce the correct magnitude.
Best regards


texts: Artefacts from playing ultrasound through PA system

texts:
I encode data in audio by energising 5 frequencies between 17.5kHz and 19.5kHz:

I play the WAV on a sports stadium (20k seating, so BIG) PA rig, placing a microphone somewhere in the spectator seating area.

This is the data (I did it at vol=0.6 and vol=1):

As can be seen, there is some kind of 'ringing' occurring. Now the frequency channels are using are all integer multiples of a fundamental frequency (~100Hz), and the ghost frequencies appear at exact harmonics. If I crank up the volume I also get energy midway between harmonics.

There is one further effect: Ghosting at 1/2 f. This is most visible if I analyse a sweep (vol=0.8:

As can be seen, much of the energy at frequency f has been redirected to 1/2 f.

Can anyone explain these unwanted artefacts?

PS Often I observe a perfectly valid SE question attracts several instant down/close-votes before making it back to the surface. It always makes me scratch my head a little. It seems rather feeble to downvote without supplying a comment to summarise the decision logic.  e.g. Is it OT / malformed / inarticulate / lazy / etc, and how so?

PPS Someone has now suggested _intermodulation_ in a comment. Now this is valuable information. The question together with this keyword, once catalogued by Google, adds to the effectiveness of the Internet as a resource for Information. Yet the question is teetering on 4 (un--publicly-justified) close-votes. I do not think this is right. :/


texts: Why do I hear a "blip" at the end of an audio clip of a sinusoid?

texts:
I generated a one second audio clip of a sinusoid at 440 Hz (16-bit, 44.1 kHz), ensuring that the last sample is zero. However, I hear a faint "blip" sound at the end of the clip, and have noticed this with similar clips that I have found online. Do you know why this happens, and how I can get rid of the "blip"?

Thanks for your help!


texts: Which filters can I use to remove Poisson Noise from data?

texts:
I have a (continuous) function f and a vector v with values of f over an interval of integers as components, v = [f(0), ..., f(n)].

v is affected from Poisson noise such that the components are not equal to f(i) but to a poisson sample with mean f(i).

I need a way to remove noise from data, I found something about Poisson Noise in images but I don't think it's the same because of the correlation between pixel of the same image.


texts: Can discrete wavelet transform for denoising purposes be implemented in real time?

texts:
I have been researching effective algorithms for denoising biomedical signals (non-stationary) that can be implemented in real time either using FPGA or DSP. I can across many suggestions for algorithms and effectiveness but found DWT to be the one that can denoise most of the noises I am interested in (power line interference, surge, power dips..)
I used the wavelet toolbox in matlab and performed denoising and wanted to make sure that this method had been implemented effective before as real-time.
I read few papers too but want more opinions.


texts: What does mean when we say mel scale reflects how humans hear musical tone

texts:
According to the standard mel frequency conversion formula, the mel frequency corresponding to 10000 Hz is 3073.22.

Does it mean human ears perceive 10000 Hz frequency of any sound as 3073.22 Hz?


texts:
I am working on a digital synthesis project, in python and c currently. I have made a Sine and Saw wave generator and have now been working on FM between the two wave types. I have successfully made FM work with a Sine wave as both carrier and modulator, but whenever I add a Saw wave into the mix, The carrier frequency increase indefinitely. After a lot of research and trying to understand some more complex DSP concepts (instantaneous phase and frequency), I am feeling a bit lost, and hoping for some pointers to resources where I can learn more at a more basic level of understanding.
Essentially, the goal right now is to modulate the frequency of any wave shape with any other wave shape given only the amplitude of the modulator signal. This would in essence be a VCO emulation or a pitch envelope capable of audio rate modulation.
The code below is currently what I have come up with, which works, but only as intended when the modulator frequency is greater than the carrier frequency (I am assuming because this is phase modulation, not FM).

# self.count == the current sample
# self.fs == 48000
# fmcv == the amplitude value for the given sample number, between -1 and 1, of the modulator

pos = self.count / self.fs
value = math.sin(self.freq * 2 * math.pi * pos + math.pi * 2 * fmcv)
value = value * self.gain + self.offset
self.count = self.count + 1
return value

I have also tried the following which gives similar results.
pos = self.count / self.fs
value = math.sin((self.freq * (1 + (0.9 * fmcv))) * 2 * math.pi * pos)
value = value * self.gain + self.offset
self.count = self.count + 1
return value

Any help and pointers towards good resources where I can understand the concepts better are greatly appreciated.


texts: Compensating the Group Delay of an Analog Filter using DSP

texts:
I am having a problem in my current project where I need to measure different biological signals (like ECG) simultaneously.

As the instrumentation hardware is developed by different people over time, they are not identical to each other. All of them has different orders of low-pass and high-pass filters before their final amplification stage. These filters are mostly concentrated around the passband of [0.5-35] Hz. I want to compensate for the phase dispersion caused by those analog filters by designing my own digital filters. I have measured the transfer functions of those channels using chirp signals, to get an idea, please check the following figure. There might be small numerical errors in the calculation of the transfer function.

Not only eliminating the phase dispersion in the individual channels but also compensating the different amount of delay of those channels is important so that I can analyze fully "synchronized" signals. So far, I have been trying to design an all-pass filter in Matlab using iirgrpdelay function. However, the created compensation filters are not satisfying. The reason for that might be the huge variation in group delay (see the first figure) between [1 15] Hz, the region I want to compensate. Increasing the order of the filter doesn't help since I mostly get the following error from Matlab:

Poorly conditioned Hessian matrix. Cannot accurately compute the optimization because either the approximation error is extremely small (try reducing the
number of poles or zeros) or the filter specifications yield huge magnitude variations, such as mag=[1 1e9 0 0].

I don't want to leave the question this broad but I am asking for suggestions to design such compensation filters in the digital domain so that I can neutralize this phase dispersion and delay in the analog instrumentation.


texts: What is the effect of a larger window size on "temporal resolution"?

texts:
I guess my question boils down to what "temporal resolution" means?
I'm taking a signal processing class right now and we're learning about DFT and windowing at the moment. We've learned that when we increase the window size, $N$, we have greater "frequency resolution"

From the image we see that the more we increase, $N$, the more we get the actual $\Omega$ we want and the less smear there is.
Isn't this all there is to resolution? We're getting the $\Omega$ that we actually want? Is there something else important that I'm being really oblivious to?
My professor mentions that a larger window, $w[n]$, provides less "temporal resolution"... What does that mean? And how is it different than having good frequency resolution?


texts: Sound are digitalized in computers as an archive with its intensity amplitude at the given time. I want to ask a very simple question about frequency filtering. How it's done, if there's no frequency information stored in the digital audio? It's all intensity. I cannot understand.


texts:
I guess this is a stupid question or it is not clear.  I will try again

  I have a situation where I take the fft of a combined source, both at the same frequency but at different locations. I am trying to figure out what the relationship between the source and the combined.

  Maybe I am using the wrong terminology here.  A combined source in my application is at least two instances of the same frequency from different locations in the focal plane, combined in the same waveform.

  Is the phase of the combined complex value the sum of the phase of the source? so one could write something like:

  tanCombined = tan(combinedIm / combinedRe) = tan(s1Im/s1Re +
  s2Im/s2Re + ...);

Second Attempt.

Say I have a waveform waveOne that is a sin wave at a specific frequency that has an origin at a point in the focal plane relative to a single measuring microphone.

If I take the fft of this waveform I can calculate the phase angle and amplitude from the fft data, phaseOne and amplitudeOne.

Say I have another waveform waveTwo that is a sin wave of the same frequency that has its origin at a different point in the focal plane.

If I take the fft of this wave form I can calculate the phase angle and amplitude from the fft, phaseTwo and amplitudeTwo.

If I combine these waveforms into a single wave, waveThree and take its fft the same bin is excited as in the above two samples and both the amplitude and phase angle are different, as one would expect.

The question is, for the combined experiment, is there a relationship between the amplitude and phase of the combined fft value with those of the individual waveform.


texts: Is it possible to spread signal using sum of more than one orthogonal code

texts:
I was wondering if we can spread the signal using more than one spreading code. Assume we have the Walsh code used to spread the transmitted signal, the Walsh code is, for example, gotten based on Hadamard matrix:

V = [1  1  1  1
     1 -1  1 -1
     1  1 -1 -1
     1 -1 -1  1]

where every column of matrix $V$ represents one spreading code we can choose and they are all orthogonal. where, $V_1$ = [1 1 1 1], $V_2$ = [1 -1 1 -1], $V_3$ = [1 1 -1 -1] and $V_4$ = [1 -1 -1 1].  So, if I have $V_{21} = V_1 + V_2$, what's the advantages and disadvantages of using $V_{21}$ as spreading code since it's orthogonal also on all codes except $V_1$ and $V_2$

thank you


texts:
Assume i have a discrete signal, which i want to up-sample by factor 100.
Up-sampling using poly-phase algorithm sounds like a bad idea, in terms of cache low-efficiency due to low space-locality of the data.

Do you have any suggestions?

Thanks,

Itay


texts:
For situation that received signal is complex, how Early and late are calculated in spread spectrum tracking?
How I can consider both real and imaginary in error calculation?


texts: Equalizing frequency response in software

texts:
I'm playing audio through a speaker which I know to have a non-flat frequency response, with particularly poor response in the low ($<1\textrm{ kHz}$) ranges. My plan to get around this problem is to write a script which processes each audio file before passing it on to the speaker such that the energy is boosted in the ranges where the speaker's response is poor.

I know that it is possible to create a filter which does this (e.g. using the firwin2 function in Scipy), but I can't help but feel that this approach is overly naive, and that I will wind up accidentally introducing unwanted artifacts into the signal when I actually play it through the speaker.

So, is this approach doomed to failure?
If not, then why isn't it something that all speaker manufacturers do already?


texts: How does parallel structure implementation of IIR speed up the process ? What happens in case of FIR?

texts:
I was learning about digital filter structures and there I came to know that parallel implementation of IIR filters speeds up the process and I understand that.But what I am not convinced of is that parallel implementation of FIR filters doesn't speed up the process. I want to know the importance of parallel structures in FIR filters.
EDIT: I understand that if I have a digital IIR filter whose transfer function is $H(z)$ then its parallel realization would be
$$H(z) = \sum_{i}{H_{i}(z)}$$
where each $H_{i}(z)$ is no more complicated than bi-quadratic. So at the most we require two delay elements for each parallel part. So if order of $H(z)$ is 10 then ignoring time required for  multiplication, the minimum processing time is twice of the sampling period not ten times of that.
Now my question is what happens in case of digital FIR filters ?


texts:
Let's say I have the following LTI system:
$$\dot{x}(t) = \mathbf{A} x(t) + \mathbf{B} u(t)$$
I need to somehow show the following is true or false (proof):

This system is controllable if and only if for any $\mu$ such that $(−\mu\mathbf{I − A})$ is Hurwitz, there exists a unique positive deﬁnite solution $\mathbf W$ to the Lyapunov equation:

$$\mathbf A \mathbf W + \mathbf W \mathbf A^T − \mathbf B\mathbf B^T = −2\mu\mathbf W$$

Can anyone see the proof? I tried replacing $\mathbf A$ in the Lyapunov equation with $(−\mu\mathbf I − \mathbf A)$, and then adding the $−2\mu\mathbf W$, to the left side, but the $\mu$'s end up cancelling out, so I'm not sure.
I'd really appreciate any help.


texts: How to compare 2 matrices of MFCCs, keeping the time information

texts:
I have a corpus of several thousand sounds. Now I pick a sound sample S, and I want to find in my corpus the sound S' that is the most similar to S.
The application is for music, for a composition that I am working on :) I found a lot of questions which are all related to speech recognition. The problem here is different as rhythm is the most important info for me, even before timbre. If S' has a different length than S, it must be somewhat of stretched version of it.

The samples are between 0.5 seconds to 2 seconds (approximately). I have tried to compute MFCCs, apply DTW, but I don't get convincing results. I still believe MFCCs are the way to go, however I started to think DTW is not suited for my purpose, because it removes the rhythm information. For example (and if I understood well), DTW would recognize that the sounds "Puuuum pum tchak" and "Pum pum tchaaaak" are the same. But obviously, when it comes to music, they are not, as the timing is crucial.

So, how to compare 2 matrices of MFCCs, keeping the time information? Or is my approach completely wrong?

I was currently looking into procrustes analysis, as I have read that it compares 2 shapes, removing scaling, ... and this sounded good to me.

EDIT

With DTW I might have :

distance("Pum pum tchak", "Pum pum tchaaaak") < distance("Pum pum tchak", "Puuum puuum tchaaak")

in other words, the time wraping doesn't care about the fact that "Puuum puuum tchaaak" is just exactly the same as "Pum pum tchak" but with slower tempo.


texts: How to detect spheres in SEM (scanning electron microscope) images?

texts:
I want to determine the distribution of micro glass spheres in SEM (scanning electron microscope) images, which can be obtained after finding the contours of the little spheres. I think the difficulties are the variance of the brightness and the overlap among the spheres.

At the beginning, I guess canny edge detector may help to find the edges. However the result is not very good.

Thank you for your help and share!


texts:
Both Discrete Wavelet Transform (DWT) and Undecimated DWT possess an important property of energy preservation: on each level

$$\sum_i W_i^2 + \sum_j V_j^2 = \sum_k X_k^2$$

where $W$ and $V$ are detail and approximation coefficients, respectively.

It turns out that Laplacian Pyramid (LP) generally lacks this (important) property. Is it possible to construct a filter for LP decomposition that would preserve energy? I'm ready to sacrifice the simplicity of backward transform.


texts: Counter-example to show that this system is non-linear?

texts:
I have a discrete-time system y[n] = x[n]*x[n-1]

I need to show that this system is non-linear by using a counter example rather than by disproving with algebra and the properties of additivity and homogeneity.

I think that the system is homogeneous although not additive, but I can't think of an example to show this. Would someone help me out please?


texts:
I'm using the RSP1A SDR and I want to understand how to choose the best configuration for receiving a signal of 125 khz bandwidth.

I would like to know if when choosing the option 200 KHz IF bandwidth with 2MSamples/s sample rate:

we actually receive 2 Mhz of bandwidth and the remaining 900 Khz from both sides of the spectrum are attenuated

OR

we only receive 200 khz of bandwidth sampled at 2 MSamples/s rate.

Since i want to reduce the sample rate of the captured signal,  i also would like to know if

I only have to downsample (reduce the sample rate by a factor of N) since it is already filtered to a 200 Khz bandwidth

OR

filter and then downsample as it is usually recommended to avoid aliasing.

Links to the RSP1A technical information : https://www.sdrplay.com/wp-content/uploads/2018/01/RSP1A-Technical-Information-R1P1.pdf and the RSP1A datasheet https://www.sdrplay.com/docs/171113RSP1AdatasheetV1.6.pdf

EDIT for clarification :
As shown in the screenshot, for each sample rate (in this case I'm using the minimal allowed value : 2 MSamples/s), we can choose an IF bandwidth equal or less than the chosen sample rate value (so here i can choose between 1536, 600, 300 or 200 KHz).


texts: What's the unit of spectral intensity in calculation of RGB tristimulus?

texts:
According to CIE color space and relation of RGB with XYZ, we can express

$$
R = \int_0^\infty I(\lambda)r(\lambda)d\lambda
$$$$
G = \int_0^\infty I(\lambda)g(\lambda)d\lambda
$$$$
B = \int_0^\infty I(\lambda)b(\lambda)d\lambda
$$

where $r(\lambda),g(\lambda),$ and $b(\lambda)$ are the corresponding color matching functions and $I(\lambda)$ is spectral intensity function.

Now, I am trying to calculate RGB values of hyperspectral image captured by hyperspectral camera. And from the hyperspectral image, I can get spectral intensity values between 0 - 65535. But I am not sure about unit or range of the intensity function $I(\lambda)$ above. Is it values between 0 - 1?


texts: Butterworth High Pass Filter Amplitude Response

texts:
I have learned the Butterworth filter, normally it is used for low pass design. And the amplitude response is:

$$|H(jw)|=\frac{1}{\sqrt{1+(\frac{w}{w_{c}})^{2n}}}$$

mentioned in this Butterworth Introduction.
But as I know, the Butterworth can be designed as a high pass as well. Then what is the amplitude response for high pass? Is it simply like this?

$$|H_{hp}| = \frac{1}{|H(jw)|}$$


texts: Compare two voices and outline their similarity

texts:
I am trying to develop an application which records the voice of someone through a microphone. I will have a preset recorded voices for the same words. I then need to compare the real time recorded voice with the list of recorded voices and output a similarity in percentage format.

I did a lot of literature research about this and I found that it can be done using several algorithms such as:

FFT
MFCC
Cross-Correlation

My question is can this be done using JavaScript, PHP, MySQL ?

Or do I need to program this using Java or any other language? I really need some guidance in what to start looking for in order to start developing something and make it work.

I do not want to use any system that provides Text-To-Speech or vice versa. I purely want to analyse and compare audio files. This system will be used to aid people with speech disability so they wouldn't exactly know how to pronounce the exact words


texts: How does this represent a low-pass filter?

texts:
I am faced with the following code snippet to get an understanding of a F0 estimation algorithm (DIO). Have a quick look below:
static void DesignLowCutFilter(int N, int fft_size, double *low_cut_filter) {
  for (int i = 1; i <= N; ++i)
    low_cut_filter[i - 1] = 0.5 - 0.5 * cos(i * 2.0 * world::kPi / (N + 1));
  for (int i = N; i < fft_size; ++i)
    low_cut_filter[i] = 0.0;
  double sum_of_amplitude = 0.0;
  for (int i = 0; i < N; ++i)
    sum_of_amplitude += low_cut_filter[i];
  for (int i = 0; i < N; ++i)
    low_cut_filter[i] = -low_cut_filter[i] / sum_of_amplitude;
  for (int i = 0; i < (N - 1) / 2; ++i)
    low_cut_filter[fft_size - (N - 1) / 2 + i] = low_cut_filter[i];
  for (int i = 0; i < N; ++i)
    low_cut_filter[i] = low_cut_filter[i + (N - 1) / 2];
  low_cut_filter[0] += 1.0;
}

I struggle to understand how this realises a low-pass filter.

The arguments: N seems to be the cut-off frequency in samples, fft_size is the number of bins in our FFT, and low cut filter seems to be a pointer to an array that we should populate with our low-pass filter coefficients
The first line seems to be a Hann function with a window length of N.
Then a cumulative amplitude is calculated to negate and normalise the filter. I guess this is to ensure all numbers below are below -1.
Then we seem to do something which looks like copying the signal to the other end of the spectrum.
Then there is another copying part, which I don't get.
Then we add one to the first bin.

I realise the main confusion for me is that I would start making a low pass filter in a completely different way and I don't see the connections with the above algorithm.
For an n-th order Butterworth low pass filter, I would make a transfer function:
$$ G^{2}(\omega) = \frac{G_0^2}{1 + (\frac{j \omega}{j \omega_c})^{2n}} $$
I would then multiply this transfer function together with the FFT of my signal, that would be the easiest. I can see that this is not a Butterworth filter, but I don't know what kind of filter the above is.
Could you help me in providing some pointers to find the missing concepts in my understanding?


texts: Determing the frequency of a signal with a sample at a time

texts: How to determine the frequency of a signal with a value of the sample and value of the time instant the sample was taken ?


texts:
I am looking for a formula (Fourier series) to generate an impulse train waveform - a spike-wave with amplitude and period both $1$ – so that $f(x)$ has value $1$ at $x = 1,2,3,4...$ and $f(x)$ has value $0$ at all non-integer values of $x$.

Someone very helpfully gave me:

$$S = \frac 1 N \sum_{k=0}^{N-1}  e ^{j2\pi\frac{kn}{N}}$$

The same equation can be found on this site: Equation for impulse train as sum of complex exponentials. However...

I have two questions:

Is there an equivalent trigonometric function? If so, what is it?
Sadly, my maths A level is such ancient history that I am struggling with what the terms in the above equation mean. Specifically:

$S$ = series, i.e. the equivalent of $f(x)$ - yes?
$e$ = famous irrational number - yes?
$j$ = square root of $-1$ - yes?
$N$ and $n$ ... Now, here I get muddled. 30 years of doing no maths at all has left me less than fluent... I assume the lowercase ($n$) is the period/frequency of the impulse train. So that leaves uppercase ($N$) as... The number on the $x$-axis that we are solving for...? The duration of the signal...? Some factor that compensates for $\pi$ to create integer values...?

Sorry. I know this is basic stuff. But I'd really appreciate some help...


texts: normalize fft produced by fftw_plan_dft_r2c_1d

texts:
fftw_plan_dft_r2c_1d takes an array for real numbers and produces an array of complex numbers 1/2 the size of input array + 1.

per fftw's website:

  As a result of this symmetry, half of the output Y is redundant (being the complex conjugate of the other half), and so the 1d r2c transforms only output elements 0...n/2 of Y (n/2+1 complex numbers), where the division by 2 is rounded down.

When I normalize do I normalize by the size of the fft or the resulting fft_size / 2

    // normalize the fft
    for (unsigned int x = 0; x <(fftSize/2); x++)
        array[x] = array[x] / complex<double>((fftSize/2), 0);   <<<<<

or

    // normalize the fft
    for (unsigned int x = 0; x <(fftSize/2); x++)
        array[x] = array[x] / complex<double>(fftSize, 0);       <<<<<


texts: Is a leaky integrator the same thing as a low pass filter?

texts:
The equation governing a leaky integrator (according to Wikipedia at least) is

$\frac{d\mathcal{O}}{dt} + A\mathcal{O}(t) = \mathcal{I}(t)$.

Is a continuous-time leaky integrator thus the same thing as a low pass filter with time-constant $A$, up to some scaling of the input?


texts: Papers for Teaching an Introductory Course in Image & Signal Processing

texts: I'm preparing a digital signal/image processing introductory course and, besides the theory and practices I want the students to read and discuss a couple of research papers during the last one or two classes. It doesn't matter if the papers are new I just want to expose the students some first hand research material in its original format. Which papers could you recommend me? Thanks


texts: Sample and reconstruct a real exponential (just one period)

texts:
I have a function with an equation:

$$C = 1.6925\left( e^{-0.136t}-e^{-1.192t}\right) $$

Where $C$ is real and $t$ represents time in hours. Beneath is the representation of my function.

I am trying to find the best sampling step (based on Nyquist-Shannon theorem) to sample and reconstruct this function using a Fourier Transform.

After using a Fast Fourier Transform algorithm in MATLAB (fft), by setting:

x= fft(c);
xmag=abs(x); (amplitude estimation)

I find the below spectrum for the function for a $t$ between $0$ and $100$ sampled at $1000 \text{Hz}$  , with the highest amplitude at:

bin(1) = 1.1025e+04

and the second highest at bin(100001) with an amplitude of 9.9946e+03. the bin number 100001 represents also the length of xmag.

So my question is how would you interpret the spectrum? Specifically I would like to know how to determine the highest frequency at which I can sample this function and reconstruct it without aliasing?


texts: Butterworth low pass filter zeros location after bilinear transformation explanation

texts:
I am studying in a text book the transformation of a continuous time Butterworth low pass filter into a discrete time filter by means of bilinear transformation:
$$
    s = \frac{2}{T_d}*\frac{1-z^{-1}}{1+z^{-1}}
$$
which imposes the following relationship between discrete and continuous frequency variables:
$$
     w = 2*\arctan(\frac{\Omega*T_d}{2})
$$

As can be clearly seen from this formulas a value of $ \Omega $ = inf causes w = pi and a value of $ \Omega $  = -inf causes w = -pi. However, both values of w correspond to z = -1 in the Z plane

In the example a 6th order continuous time Butterworth low pass filter is designed. Its magnitude squared function in continuous time is defined by:
$$
  |H_c(j\Omega)|^2 = \frac{1}{1 + (\frac{j\Omega}{j\Omega_c})^{2N}   }
$$
From this formula it can be seen that as $\Omega$ goes to infinity the magnitude function goes to zero. So I can understand that in a 6th order filter there are 6 zeros in infinity (in S plane), which in discrete time means there are 6 zeros in w = pi and hence 6 zeros in z = -1. But:

What about the behavior of the system in s = -inf?
Isn't the magnitude squared function symmetric ?

Wouldn't it also cause the magnitude function to go to zero and should generate zeros on w = -pi and z = -1


texts: Audio signal series' beginning points(about 50) distort after a bandpass filter

texts:
I am using some bandpass filters to detect a certain freq of the sampled audio series in noisy environment. Everything is OK except this:
I found that for many bandpass filters I tried(butterworth, window based FIR etc.) The audio signals' beginning points(about 50~100) always distort after the filter. For example:
[![enter image description here][1]][1]

I am new to DSP so maybe I didn't express in an scientific way... What I mean by "distortion" is that in some cases these beginning points should have been filtered out but they were not, and in other cases vice versa.After these distorted points, everything becomes fine...
Could u plz help me on this issue?
Thank you very much

To make this question more clear, below is a plot consists of 2 waveforms, the blue one is the original audio signal sampled, and the brown one is the sampled signal passed butterworth filter.It doesn't like filter delay stuff.


texts:
I'm working on some problems that instruct me to find the impulse response of a given system. For example

$$y(n)=4y(n-1)-4y(n-2)+x(n)-x(n-1)$$

The first step I take is to find the homogeneous solution of the equation like so:

$$ \lambda^n-4\lambda^{n-1}+4\lambda^{n-2}=0
\\\lambda^{n-2}(\lambda^2-4\lambda+4)=0
\\\lambda^{n-2}(\lambda-2)(\lambda-2)=0
\\\lambda = 2,2
\\y_{h}(n) = C_{1}(2)^n + C_{2}(2)^n
 $$

Is this correct homogeneous form for when you have two of the same values for lambda? I know it is when the values are different from each other.

I also have another question about this practice. When I've finished this step, I then plug n=0 and n=1 into the original equation to find the values of C1 and C2. How do I know how any times to plug a value into the original equation?

Thanks.


texts: Fixed point Error Spectrum Shaping (noise shaping) for biquads

texts:
Based on that article and all the resources on the internet that advise the use of noise shaping for fixed-point filter implementations, I tried to make a few simulations on Matlab for the biquad I'm trying to implement.

Here is my filter's frequency response using Matlab's own filter function and plotted with the periodogram function :

When I implement this filter in Q31 with no noise shaping, I get the correct frequency frequency response :

Then, as expected, the Q15 implementation introduces some errors :

Trying to reduce this error with 1st order ESS gives doutable results, although it seems close to working (I don't exactly know what to expect so I'm not sure) :

Note: I was expecting, as the document indicates (table 1), to smoothen things around 0 for positive feedback and around Nyquist for negative.

Then I tried error cancellation by multiplying the quantification error by the feedback coefficients of my biquad, and then everything turned crazy :

Here is the filtering part of my Matlab code :

acc = int32(0); % Q4.26
coeffs_Q2_13 = int16(coeffs*2^13);

sYn1 = int16(0); % Q2.13
sYn2 = int16(0); % Q2.13
sXn1 = int16(0); % Q2.13
sXn2 = int16(0); % Q2.13

X = int16(in*2^15); % float to Q2_13
Y = int16(zeros(length(X), 1)); % Q2.13
Qnoise = int16(zeros(length(X), 1));
Qnoise1 = int16(0);
Qnoise2 = int16(0);
for i = 1:1:length(X)
    acc = int32(coeffs_Q2_13(1,1))*int32(X(i));
    acc = acc + int32(coeffs_Q2_13(1,2))*int32(sXn1);
    acc = acc + int32(coeffs_Q2_13(1,3))*int32(sXn2);
    acc = acc - int32(coeffs_Q2_13(2,2))*int32(sYn1);
    acc = acc - int32(coeffs_Q2_13(2,3))*int32(sYn2);
    acc = acc + int32(coeffs_Q2_13(2,2))*bitand(int32(Qnoise1), 32767);
    acc = acc + int32(coeffs_Q2_13(2,3))*bitand(int32(Qnoise2), 32767);
    sXn2 = sXn1;
    sXn1 = X(i);
    sYn2 = sYn1;
    Y(i) = bitshift(acc, -13);
    Qnoise2 = Qnoise1;
    Qnoise(i) = int16(acc - bitshift(int32(Y(i)), 13)); %bitand(acc,     int32(8191));
    Qnoise1 = Qnoise(i);
    sYn1 = Y(i);
    acc = int32(0);
end

My filter uses these coefficients :

ff0 = 0.04253225858264462
ff1 = 0.08506451716528925
ff2 = 0.04253225858264462
fb1 = 0.21971585162695534
fb2 = -0.6101551140424661

I'm working at Fs = 48000 and my input vector ("in" in the code) is an impulse simulated by a 48000 samples vector with the first sample being 1 and the rest 0.

What am I doing wrong?

EDIT : I've read as a comment to a question on dsp.stackexchange (to which I can't post the link due to the sus-mentionned limitations) that quantification being a non-linear process, an impulse response is not the correct way to visualize its effects. Is that the reason? should I sweep a sinewave instead?


texts: Why do we use sinc interpolation rather than just multiply the frequency domain signal by rect?

texts:
I know if we have a continuous-time bandlimited signal $x_{ct}(t)$ that is sampled frequently enough we get a signal that we can call $x_s(t)$.

If we take the Fourier transform of $x_s(t)$ to get $X_s(j\Omega)$, we end up with a Fourier transform of the sampled input that resembles $X_{ct}(j\Omega)$ at $\Omega = 0$ and repeating at $2\pi/T$ and $-2\pi/T$. If we want to get $X_c(j\Omega)$, we can multiply by a $\mbox{rect}()$ function.  It seems to me that we could then reconstruct the original signal by taking the inverse Fourier transform to get $x_{ct}(t)$

However, when reading on signal processing theory, we instead use a $\mbox{sinc}()$ function to perform reconstruction in the time domain since it is the "ideal interpolator". Why can't we instead use the method described in the frequency domain? It seems like it would be easier?


texts:
I've been working on a ECG signal collected during exercise through my chest mount heart rate monitor. My goal is to accurately detect the location of the R-wave; R-wave is the narrow peak similar to the ones I circled in red.

Can you suggest any method for preprocessing the data so that it will be easier to extract the signal?

I have tried wavelet transform but I am not getting any luck.

You can download the data here. Sampling frequency is 150 Hz.


texts: MMSE Estimation - Fusion of 2 Measurements

texts:
Let's say I have 2 measurements of the same phenomenon (for example current temperature) and I want to find the MMSE (minimum mean square error) estimator, i.e to minimize the MSE (mean square error). The measurements are independent and the noise in each one is Gaussian. The mathematical formulation is:

$$Y_1[n]=X[n]+V[n]$$

$$Y_2[n]=X[n]+W[n]$$
where:

$X[n]$ is the real temperature at time $n$.
$Y_1[n]$ and $Y_2[n]$ are the measurements at time $n$.
$V[n]$ and $W[n]$ are zero-mean normally distributed random variables which represent the noise, and have variances $\sigma_v^2$ and $\sigma_w^2$, respectively.

I need a clue or reference for how to solve it.


texts:
I wonder if an efficient method exist to compute how much a signal is periodic, it should be ~1.0 when the signal is totally periodic (like a sinusoïdal signal) and ~0.0 when totally random, like a white noise.

Edit : This question came with a big misunderstanding, it has been modified to fit the answer.


texts: Sampling of bandpass signal with bandpass filter

texts:
Trying to solve the following problem about bandpass signal sampling.
I have a signal whose Fourier transform is such that $X(w)= 0$ if $w>w_h$ or $w<w_l$.
The reconstruction is done using a bandpass filter rather than a lowpass and asks me for the minimum sampling frequency $w_s$ given that $w_l > w_h - w_l$.
I followed the steps of the sampling theorem and conjectured that if $w_s> w_h-w_l$ I should be able to reconstruct the signal with a lowpass filter. Indeed, denoting with $B=(w_h-w_l)/2$ I will have a copy of the signal centred at $0$ and with extremes $-B/2, B/2$ and then another copy centred at $w_s$ and with extremes $w_s-B/2$ and $w_s+B/2$. So, if $w_s > B$ I should have no aliasing. Is it correct? A lowpass filter should recover the signal centred at $0$.
Now, for the reconstruction with a bandpass filter. I have that the filter is such that $H(w)= T $ if $w_l\leq w \leq w_h$ or $-w_l\leq w \leq -w_h$. The question is: does this filter allow me to reconstruct the original signal $x$? I think it does not. First, it would give me two copy of the signal (right?) and also, there is no guarantee that there exist an integer $k$ such that $k w_s = (w_h+w_l)/2$.
The last question is then: assuming that $w_l>w_h-w_l$ what is the smallest sampling frequency $w_s$ and largest sampling interval $T$ that allow me to reconstruct the signal?
Honestly I do not understand, the issue to me remains the same, why would that assumption be enough to reconstruct the signal?


texts: Optimal control to maximize the ratio between two systems

texts:
I have two (or more) systems with analytic (but somewhat big and unwieldy) step responses $H_1(t)$ and $H_2(t)$ both of the same form (eq. A6a onwards in https://doi.org/10.1016/S0302-4598(97)00093-7), but with different coefficients:

(where $\Delta\Phi(t)$ is the output of the unit step response). [I hope you can excuse me not mathjaxing that!]. I would like to find the input transient pulse that maximizes the positive area under the curve in the output response for one system, while minimizing the output of the other system.
I've tried optimizing numerically via conjugate gradient, numerically computing the convolution integral
$$ \int_0^t H_n(t) F'(t)  \text{ dt} $$
using a cost function like $\int H_1(t)/H_2(t)$ or $(\int H_1(t))-(\int H_2(t))$, with and without a pulse energy constraint, but the results have been very poor for unknown reasons.
The usual analytic technique for radar pulses etc seems to use Lagrange multipliers and the variational calculus to solve. However, Mathematica doesn't seem to offer any reasonable solution when integrating over the convolution integral to get the energy functional, because of the complexity of the transfer function. I also tried using the Fourier convolution theorem, but the same problem arose.
This seems to be very similar to some radar optimization problems (maximizing power in one notch filter and minimizing crosstalk to another channel, perhaps?), but I haven't yet found any useful reformulations.
Sorry if this is a basic question, I'm really a novice in optimal control theory!


texts: Is there any technology or method that let user $Z$ knowS which message is $x_B$ and which is $x_C$

texts:
There is a device $Z$ which transmits the signal $x_A$ and receives the informations $x_B $ and $x_C$ simultaneously.

I think when this device receive the signal,it won't know which is $x_B$ and which is $x_C$,because the SINR of receiving $x_B$ and the SINR of receiving $x_C$ is too small,is there any method to avoid this situation?

The only method i know is that transmitting the  $x_B $ and $x_C$ in different frequency band,but is there any method that can solve this problem?Can we design the beamforming of the device ,which transmits signal to device $Z$, to solve this problem?

By the way,device $Z$ uses MIMO,multiple input (antennas),multiple output (antennas)


texts: What does nonnegative zero-phase response mean?

texts:
I am not exactly sure what nonnegative zero-phase response means. If a filter is zero-phase (i.e. symmetric and non-causal), then what does nonnegative imply? And what are the conditions to satisfy it?
Context: This is an error I get in Matlab when trying to design min-phase filters:
Error using firminphase>checknonnegative (line 79)
The filter has to have a nonnegative zero-phase response.
Error in firminphase (line 38)
checknonnegative(b);
Error in firgr>genfilter (line 323)
hRet = firminphase(hRet, s.zero, 'angles');


texts:
Is it possible to have a realtime sample rate conversion in a way that a peer A with an audio stream at 44.1 KHz sends it signal over the network to another peer that is on an audio stream at a 48 KHz sample rate.

If possible, how should this be accomplished? How can we workaround the fact that one peer is consuming data on a different rate than one is producing?

Thanks!


texts:
I was drawing a high pass filter response ,in a polar coordinates, the function is (z+1)/z and then it is 2+2*cos(w)
the plot is
What is the name of this plot, is it a frequency response or impulse response or some thing else.

and how to distinguish it from other curves names.


texts: How do I change the sampling rate without changing the speed and pitch in Python?

texts:
I am building a voice recognition algorithm, and the use case specifies that it should be able to identify the targeted speaker from various audio sources, which means that it must be able to process audiofiles with a different number of channels and originally recorded at varying sampling rates. Up to this point, I have been able to both convert all signals from stereo to mono by averaging the channels and standardize the sampling rate to 16 kHz by calling soundfile.write(filename, signal, sr=16000); however, using this soundfile method also changes the audio's speed and pitch, accordingly causing the neural net analyzing the input signal to throw a false-positive prediction (i.e. guess the incorrect speaker).
So, I was wondering:
How can I resample audiofiles in Python without changing either the speed or the pitch? (I am open to using an existing audio package or writing the code for a process from scratch.)


texts: Incorporating delayed data in Kalman filter

texts:
my guide has told me to get familiarized with state estimates and kalman filter ....the problem is that:

1) I am totally new to this topic and finding it really difficult to understand due to lack of materials. so, can someone give some suggestions on how to proceed.

2) I am also suppose to incorporate delayed data into kalman filter equations. help is needed on this aspect also

all these have to be implemented on MATLAB..


texts: Spectrum of OFDM with raised cosine window

texts: I'm having trouble implementing OFDM with a raised cosine (RC) window in Matlab. I know how to generate an OFDM signal and how to show its spectrum, I just don't know how to generate the window extensions. Each OFDM symbol is extended by $TW$ samples at both ends to smooth the transitions between successive symbols, this is done mainly to improve the out of band spectrum and reduce the interference to adjacent channels. I'm hoping someone here knows how to do this.


texts:
I'm trying to figure out if there is a direct relationship between these concepts. Strictly from the definitions, they appear to be different concepts in general. The more I think about it, however, the more I think they are very similar.

Let $X,Y$ be WSS random vectors. The covariance, $C_{XY}$, is given by $$C_{XY}=E\left[(X-\mu_x)(Y-\mu_y)^H\right]$$ where $H$ stands for the Hermitian of the vector.

Let $Z$ be a WSS random vector. The autocorrelation function, $R_{XX}$, is given by $$R_{ZZ}(\tau)=E\left[\left(Z(n)-\mu_z\right)\left(Z(n+\tau)-\mu_z\right)^H\right]$$

Edit Note There is a correction to this definition as applied to signal-processing, see Matt's Answer below.

The covariance does not involve a concept of time, it assumes each element of the random vector is a different realization of some random generator. The autocorrelation assumes a random vector is the time evolution of some initial random generator. Yet in the end, they are both the same mathematical entity, a sequence of numbers. If you let $X=Y=Z$, then it appears $$C_{XY}=R_{ZZ}$$ Is there something more subtle that I am missing?


texts: Controllable realisation of $\frac{s^4+1}{4s^4+2s^3+2s+1}$ is both controllable and observable?

texts:
I am trying to find the controllable realization of the following transfer function:

$$H(s)=\frac{s^4+1}{4s^4+2s^3+2s+1}$$

I approach this by first using polynomial division to assure that $H(s)$ is strictly proper. This yields:

$$H(s)=1/4+\frac{-1/8\cdot s^3-1/8\cdot s+3/16}{s^4+1/2\cdot s^3+1/2\cdot s+1/4}$$

From this I can extract the controllable canonical form where the matrices A, B, C and D are:

$$A=\begin{bmatrix}0 & 1 & 0 & 0\\ 0 & 0 & 1& 0 \\ 0 & 0 & 0 & 1\\-1/4 & -1/2 & 0 & -1/2\end{bmatrix}$$

$$B=\begin{bmatrix}0\\0\\0\\1\end{bmatrix}$$
$$C=\begin{bmatrix}3/16 &-1/8 &0 &-1/8\end{bmatrix}$$
$$D=1/4$$

From this I am confused because when I construct the observability and controllability matrices I found that the system is both controllable and observable (both matrices have full rank). This seems like a contradiction. Can it be possible? What am I doing wrong?


texts: Are delta and double delta features needed when classifying with LSTM

texts:
I understand that the combination of MFCCs, deltas and double deltas is a good feature to be used with HMMs for keyword detection problems. HMMs are limited by Markov Property and this limitation is overcome by using deltas and double-deltas.

But in the case of LSTMs, they can model long term dependencies very easily. So, doesn't that make the delta and double delta features redundant while using LSTM as the model?


texts:
note: my question is not answered here: Selective image compression? - I couldn't find it, I looked for "selective" and "adaptive" compression, maybe, I put the search query incorrectly...
Anyhow, say, I have a portrait. I want to keep the face as clear as possible and compress the rest tightly. I'd like to have a tool, that allows me to select blocks for higher quality and other blocks for lower.
As far as I know that JPEG format allows me to keep only one quantization table, but I can see how it can be done:

select a high-quality quantization table for this file and compress high-quality blocks with it as usual
for low-quality blocks, use the same table, but alter the incoming data in that way, so after the zigzag, it's gonna have longer "same number sequences", even at expense of severe distortion, so it'd be easier for Huffman to compress. The resulting block will be distorted, but who cares - the low-quality JPEGs are distorted anyway :)

Does this tool exist? I imagine it as a simple "Editor" where I kind of paint over the high quality blocks. Or even with a face recognition option.


texts: Intuition behind the Continuous Wavelet Transform?

texts:
I was thinking sometime back about how to explain the Continuous Wavelet Transform ELI5. So this is what I came across.

The correlation of two exact signals is 1. So if I have an input signal $f(x)$ made up of an array of frequencies, how can I find out what frequencies exist at what points? Well, slide a signal $m(y)$ where $-\infty > y > +\infty$ over $f(x)$, and at those points where the co-relation of these signals is 1, well, those frequencies are present, at those times. This if of course a Continuous Wavelet Transform. Am I correct?


texts:
If $y(t) = x(t)*h(t)$, then what is the expression for $y(t+a)$?

Is it $x(t+a)*h(t+a)$ or $x(t+a)*h(t)$?


texts: Need intuition on the frequency response of a signal

texts:
I'm currently taking a course on signals and systems, and even though we are much ahead of frequency response, I still feel like I am missing an intuitive grasp of what the frequency response of a signal is. Specifically, when I look at the various CTFT pairs, it's difficult for me to intuitively understand why the pairs make sense.

If someone could provide an intuitive explanation of what frequency response is, that would be much appreciated!

Thanks


texts: How Do Particle Filters Get Velocity When Tracking with Pos Measurements

texts:
I am new to particle filtering.
I can see when particle filters are used with Ensemble Kalman's, the velocity of the states are taken care of by the Kalman.

When tracking using particle filters only with position-only measurements, how do you get the velocity for propagating the particle by the transition function ?  In Kalman filters, the filters smooth through the difference in position measurements.  I don't see that in particle filters.  Wondering if you provide velocity as a pseudomeasurement by differencing successive measurements ?

Thanks for any help


texts: Advice on designing a digital filter that doesn't have phase-sensitive edge artifacts?

texts:
I'm pretty well versed in statistics, but not really digital signal filtering. I have a data scenario where I expected to be able to pretty easily filter out some noise (human pulse) that's at a known frequency band, but I'm having a lot of trouble using the standard tools in the scipy.signal library and think I must be misunderstanding how to design digital filters. I have a notebook here that walks through my explorations thus far, but the gist is that the standard scipy filters seem to cause large distortions at the start and end of my signal, with the precise behaviour dependent on the phase of the noise signal I'm trying to subtract. Just in case the above binder link goes down, I'll include some of the key points below as well:
First generating some synthetic data that's similar to my real data:
#generate time vector
samples_per_sec = 10.0
total_time = 40.0
time = np.linspace(0, total_time, int(total_time*samples_per_sec))

#generate the pulse signal
pulse_hz = 1.0
pulse_phase = np.radians(0)
pulse = np.sin(time*(2*np.pi)*pulse_hz - pulse_phase)

#generate the BOLD signal (just something that goes up then down)
dist = stats.beta(2, 2)
bold = dist.pdf((time-10)/20) / 10.0 # division by 10 to make bold a small signal

#combine
pulse_plus_bold = pulse+bold
plt.plot(time, pulse_plus_bold);

Try a 1st order butterworth:
#1st order butterworth filter in ba mode
ba1 = signal.butter(
    output = 'ba'
    , N = 1 #needs to be low if using output='ba', else use output='sos' and sosfiltfilt
    , Wn = [0.5,1.5]
    , btype = 'bandstop'
    , fs = samples_per_sec
)
filtered_ba1_nopad = signal.filtfilt(
    b = ba1[0]
    , a = ba1[1]
    , x = pulse_plus_bold
    , padtype = None
)
plt.plot(time, filtered_ba1_nopad, 'b');
plt.plot(time, bold, 'r--');
plt.legend(['Filtered', 'Expected'], loc=(1.04,.5));

First-order butterworth with even padding:
filtered_ba1_pad_even = signal.filtfilt(
    b = ba1[0]
    , a = ba1[1]
    , x = pulse_plus_bold
    , method = 'pad'
    , padtype = 'even'
)
plt.plot(time, filtered_ba1_pad_even, 'b');
plt.plot(time, bold, 'r--');
plt.legend(['Filtered', 'Expected'], loc=(1.04,.5));

First-order butterworth with odd padding:
filtered_ba1_pad_odd = signal.filtfilt(
    b = ba1[0]
    , a = ba1[1]
    , x = pulse_plus_bold
    , method = 'pad'
    , padtype = 'odd'
)
plt.plot(time, filtered_ba1_pad_odd, 'b');
plt.plot(time, bold, 'r--');
plt.legend(['Filtered', 'Expected'], loc=(1.04,.5));

This latter looks really good! But after playing around I discovered that whether odd or even (or either) padding works better seems to be contingent on the phase of the signal being filtered-out. As an example, while the above obtained excellent filtering with odd-padding, here's the same scenario but with a phase-shift added to the pulse signal that yields edge artifacts in both odd and even:
phase = np.radians(45)
pulse_shifted = np.sin(time*(2*np.pi)*pulse_hz - phase)
pulse_shifted_plus_bold = pulse_shifted+bold

filtered_shifted_ba1_pad_odd = signal.filtfilt(
    b = ba1[0]
    , a = ba1[1]
    , x = pulse_shifted_plus_bold
    , method = 'pad'
    , padtype = 'odd'
)
filtered_shifted_ba1_pad_even = signal.filtfilt(
    b = ba1[0]
    , a = ba1[1]
    , x = pulse_shifted_plus_bold
    , method = 'pad'
    , padtype = 'even'
)

fig, axes = plt.subplots(nrows=1, ncols=2, figsize=(5, 3))
axes[0].plot(time, filtered_shifted_ba1_pad_odd, 'b')
axes[0].plot(time, bold, 'r--')
axes[1].plot(time, filtered_shifted_ba1_pad_even, 'b')
axes[1].plot(time, bold, 'r--')
fig.tight_layout()
plt.title('Odd (left) and Even (right)')
plt.legend(['Filtered', 'Expected'], loc=(1.04,.5));

I've also tried the 'gust' padding method as well as higher order filters (using sos of course), and observe the same phase-dependent edge artifacts in everything I've tried. Any tips?


texts: Power Spectrum analysis arbitrary length signals

texts:
I have signals belonging to diseased and healthy samples recorded from multiple electrodes. These signals are taken monthly and are of arbitrary length (say 4-5 mins). I am planning to do a power spectrum analysis (comparison between healthy and diseased). Now to do this two methods come to mind.

Take the normalized power spectrum of the 4/5 min signal as it is and average it over the electrodes.
Divide the 4-5 min recordings to smaller (say 5 seconds) segments, obtain the normalized power spectrum of each segment, average it over all the segments, and finally average it over the electrodes.

which of the following methods would give a better analysis?


texts: Realtime fixed point IIR filter implementation in C

texts:
I would like to implement a fourth order fixed point low-pass IIR filter in C (with Q15 arithmetic), and I will prepare this filter by using two stages cascaded direct form-II bi-quad filters.

I have found countless C implementations and example coefficients on the digital signal processing books, but I saw non of them is not reliable during the verification (they create overflows, does not attenuate expected frequency components, etc.).

Which C implementation is suitable for this problem? And also, is there any sample coefficients to verify this implementation?


texts: object level sensor fusion for multiobject tracking

texts:
I want to fuse objects coming from several sensors, with different (sometimes overlapping!) fields of view. Having object lists, how can I determine whether some objects observed by different sensors are in fact the same object? Only then I can truly write an algorithm to predict future state of such an object.
In other words, I want to associate properly those lists.


texts:
In the case of frequency domain FIR filter design, the error function given by :

$$E(\omega)=H(e^{j\omega})-D(e^{j\omega}) \tag{1}$$

is a linear function with respect to the unknown filter coefficients $h[n]$. Hence, the Least Squares frequency domain FIR filter design problem is a linear LS problem which can be solved by computing the solution to a system of linear equations.  (from this: Algorithms for the Constrained Design of Digital Filters with Arbitrary Magnitude and Phase Responses ).

I have a three questions :

How the error respect the unknown filter coefficient ?
Does equation (1) is the same : $E(\omega)=D(e^{j\omega})-H(e^{j\omega})~$?
Does this case is available with negative domain of frequency ?

Thank you in advance.


texts: channel estimation based on time-domain pillots

texts:
I am confused if it's possible to estimate the channel based on the time-domain pilots. I mean I have such signal $x$ with length $N$ after taking its $iFFT$ we get $X = ifft(x)$. I have perfect knowledge on pilots signal in time domain, I mean I know what is $X_{1:4:N}$ (Again, it's in time domain after taking the ifft). The signal $y = h*X$ is the received signal representing the convolution between signal $X$ and channel $h$. Taking the $FFt$ to signal $y$ resulting $Y = fft(y) = fft(X)*fft(h)$.
My issue, if it's possible to estimate the channel in this case based on the pilots known in time-domain which are $X_{1:4:N}$ ?


texts: Most efficient way to find single dominant frequency (without amplitude) in analog signal

texts:
I want to construct a reference locked sine oscillator. The multibit sine wave is calculated using DDS. The multibit reference signal is typically not sinusoidal, can have offset and substantial noise, but is expected to contain one dominant frequency.
If this dominant frequency is nearly known, a standard PLL approach will work to keep track of the dominant frequency in the reference signal.
However, I now suppose this cannot work to acquire initial reference lock if the dominant frequency is far away from the oscillator frequency. In this case, the PLL gets stuck on a locally dominant frequency.
What is the common approach to resolve this ? Calculating an DFT seems like overkill, since it produces a lot of unnecessary information. A recursive 4 sample Zoom FFT looks a bit more efficient. But maybe there is a way that directly modifies the PLL filter to capture further off frequencies ?
Please let me know if I missed crucial info.


texts: Is it possible to lose half the samples, and yet see the full spectrogram as the original signal?

texts:
Consider an speech audio signal sampled at 16,000 samples per second. Plot its spctrogram.

If we delete every other sample from input signal, we get y[n] = x[2n] for all n.

It seems that if we plot the spectrogram of y[n], we would only see frequencies upto 4kHz on the Y axis (all frequencies above 4k would be zero). So this scheme of resampling is not useful.

Is it possible to do some operation on x[n], and get a signal (y[n]) with only 8000 samples per second, and yet see the complete frequency range 0Hz - 8kHz?

Of course, this will not be as accurate as the original spectrogram, but still I'm interested whether the information in original "4kHz - 8 kHz" frequency range is still somehow partially preserved after some resampling operation.

If yes, what's the mathematical formula for this new resampling scheme?


texts: Simulating the impulse response of a multirate digital filter

texts:
I have designed a CIC filter in Verilog and I would like to test its impulse response, but I am not sure where to start from.

My input sampling frequency is 51200Hz, the filter is a third order decimating CIC with downsampling ratio = 256, so the output sampling frequency is 200Hz. The differential delay was set to one.

The input word is one bit wide, while the output will be 16 bits. I have already calculated all the internal registers dimensions and I am satisfied with that, my current Verilog design does not use true registers but integer numbers so that is not a problem anyway.

How am I supposed to compute its impulse response?

First of all there's the problem that the sequence '1000...' is not an impulse, because 1 corresponds to +1 while 0 corresponds to -1. I have solved that doing two simulations, one with '10101010...' and the other with '11010101010...' as input sequences. The impulse response is then half of the sum of the two responses. So far so good.

Since I want the frequency magnitude response referred with the output sampling frequency I figured that my input impulse should be 256 high frequency samples wide, is that correct? I have done such a simulation and computed the specter in Matlab, the result is qualitatively satisfying but I have a lot of noise, especially in the low frequency part of the specter. I have also tried some windowing without much luck. I simulated my sistem for about half a second, that's 25000 samples.

I must note that my simulation output gives out samples at an higher non constant rate, I've tried resampling my signal with no luck.

Given my limited experience with digital signal processing I am out of ideas. Is there something fundamentally wrong in my approach? Is it ok but there's something I should poke to get better results?


texts: Impulse Response from Frequency Response at Specific Values

texts:
I'm at a loss trying to answer the following question:

The frequency response $H(j\omega)$ of a length 4 FIR filter with real impulse response has the following specific values: $H(j\cdot0) = 2$, $H(j\cdot \pi/2 ) = 7 − 3j$, and $H(j\cdot\pi) = 0$. Determine the impulse response function $h(n)$.

I can't think of anything to do but apply the inverse DTFT but how would that work at specific values?  Is there another method I'm forgetting?


texts:
I am watching the following video on software defined radio and at the beginning the narrator points out some "whistlers" on the spectrum display and says maybe they are caused by an "annason". He goes on to say that he knows "commercial annasons scan at a slower rate than the whistlers". What is an "annason". I don't know the spelling because it is verbal.

http://www.youtube.com/watch?v=ZuRcaxpbYCw


texts: Determining LTI system response to a scale change

texts:
We know that for an LTI system, if $y(t)$ is the output for $x(t)$ then the response for $x(t-2)$ will be $y(t-2)$ and so on.

But my question is what will be the system response for the input $x(-2t)$ ?Is it possible to determine the output without knowing $h(t)$?


texts: Detecting Individual Photos on a Scanned Page

texts:
I'm working with a collection of old photographs. They were scanned on brown paper in various configurations. Some scans have a single photo, others have three or four. Some of the photos are mounted on white cards, others are not:

I developed an algorithm to find the individual photographs on each scan, which is described here. The gist is to:

Find the median color (independently for each RGB channel, 0-255)
Blur the image.
Binarize according to whether each pixel's RGB values have an RMSE of <20 from the median.

This leaves a mostly-black image with a few large white rectangles on it, like so:

To find the rectangle coordinates, I use the following procedure:

Pick a random white pixel, (x, y) (statistically, this is likely to be in a photo)
Call this a 1×1 rectangle.
Extend the rectangle out in all directions, so long as you keep adding new white pixels.
If this rectangle is larger than 100×100, record it as a photo. (The originals are much larger than the photos I've uploaded for this question.)
Color the rectangle black.
If <90% of the image is black, go back to step 1.

This has worked on most (90+%) of the scans that I've tested it on, but it is quite ad-hoc, particularly the RMSE 20 threshold in the first portion and the entire procedure to find the rectangle coordinates.

Is there a more principled way to find these photo rectangles? How would someone with experience in image processing solve this problem?


texts: Outlined text extraction from image using OpenCV

texts:
I have some video frames I'd like to extract some text from (for making softsubs from hardsubbed video for learning). The text in question is mostly in Chinese script (some numbers and Latin letters) of a known font (looks like SimHei), is white (ish) and has a black (ish) border, and occurs left-aligned at a constant location. What I'd like to achieve is a "tidy" black-on-white image of the text.

Example input, something like this, where the background is uncontrolled, and can also be as white as the text.

What I'd like to achieve is something like this that can be fed to OCR:

I am using Python and OpenCV. A naive first attempt that just thresholded the image is not sufficient, as it (predictably) produces artifacts in areas of white background (eg under the first and second characters in this example).

Edge detection is also challenging, as you get a decent "inner edge" for the white-black edge, but you might or might not get an outer edge for the black-background boundary (if the background is dark), or you might only get a partial or unclosed outline. Some backgrounds are very noisy, so there can be a lot of spurious edges too (this is a bit contrived, as no filtering is done, and the Canny aperture is too big, but the double edges are visible):

I have tried to filter the image with a Laplace Pyramid filter (based on this example), but it's hard to find a filter that homes on the white text without often blowing noise in the background into pure white too. E.g. on the right here is a feature that looks quite "text-y" after thresholding.

Filtering "small" contours is also challenging, as there are valid small strokes in Chinese, as well as punctuation like full stops and commas.

What is the right (or a good) way to robustly filter for text like this? Is there a "standard" technique that can latch onto this kind of outline? I'm hoping to stick to image processing and basic heuristics, rather than more advanced discrimination like machine learning.

Here are some more frames, not all of which have text, showing that there are some features in the image that are not very well suited to one-size-fits-all processing:


texts: Help in identifying low speed image transmission protocol over RF

texts:
In the seventies I worked for Muirhead on press fax machines that used to transmit pictures over radio and landline as I recall two FM systems were used a carrier 800 Hz modulated +- 150 Hz and 1900Hz +- 400 Hz.

I have recently found software to get my old ICOM PCR1000 communication receiver going again on windows 10 and am picking up a strong signal on 162.800 kHz that appears to be the former system .

Is there any software available that would demodulate it and can anyone identify it?


texts:
I was supposed to find state space representation and its matrices of this system:

and I have no idea, how to do this. We were told not to transfer the system to time domain, but I can only do state space representation from time domain schemas.

When I tried to solve this, I got matrices
$$A =  \left( \begin{array}{ccc@{\ }r}
    -a & k  \\
    -b & -p \\
    \end{array} \right)$$

$$B =  \left( \begin{array}{ccc@{\ }r}
    0  \\
    b \\
    \end{array} \right)$$

$$C =  \left( \begin{array}{ccc@{\ }r}
    1 & 0  \\
    \end{array} \right)$$

$$D =  \left( \begin{array}{ccc@{\ }r}
    0
    \end{array} \right)$$

Is that right? If not, how sould I solve it?


texts: Need suggestions on the class of blind adaptive filters that can be used in my situation

texts:
I have 2 satellite transponders closely situated, transmitting the same signal. At the receiver I receive this composite signal. I have to equalize it in such a way that the demodulator sees only one of the two signals from the composite signal. So, I modelled this situation as a channel with input $x(n)$ given to a channel whose output response is given by,

$$
y(n)=x(n)+s*x(n-D)
$$
where
$$
\text{0}\leq\text{s}\leq\text{1}\\
D=delay
$$

Since I don't have a reference signal at the receiver, I am performing blind-equalization using a traversal structure. I know that ideally I need an IIR structure for perfect equalization. Since, the modulation schemes used are QPSK and BPSK I am using CMA (constant modulus algorithm) based zero-memory predictor for generating the reference signal to generate the error signal from the filter output. I am using LMS algorithm for updating the filter taps with mu=0.0001. The reason for choosing CMA is that it can also work on signals with frequency offsets. We have frequency offsets due to Doppler shifts in this case. I have also gone through non-linear equalization techniques like MMSE+Viterbi algorithm.

Can you comment on the strategy I followed and suggest any other ways to investigate this situation?

Thanks, JK


texts: Estimate standard deviation of random-walk using Kalman filter

texts:
I'm new to Kalman filters so this might be a stupid question.

I created a Kalman filter that takes in time series observations and estimates the mean of that time series. This is simply modeling a random walk.

However, I also want to be able to estimate the standard deviation of my observations, similar to how I'm using it to estimate the mean of a time series. I know I have to provide the filter with a constant observation covariance matrix, but I don't know if there's a way I can get an estimate of the observation's variance (so I can compute the standard deviation).

Is there a way I can extract this information from my Kalman filter? Is there a better way to estimate the standard deviation of a time series using a Kalman filter?


texts: Dealing with spectral leakage between two frequency bins

texts:
I'm looking for two signals embedded in very noisy data. I know they are close to periodic and integral with the run, but are rather close (30s and 21s during a 210s measurement), and our sampling rate is low (1.25s). We have multiple observations to work with per sample.

I am wondering how I might deal with the problem of spectral leakage: it is evident in the FFT of our samples. Since our two signals of interest are so close together (10 and 7 cycles per measurement), it may well be that spectral power is leaking from the stronger of the two signals into the weaker one.

Will zero-padding with a window (rectangular or hamming) allow us to define a boundary between the two signal? Would another approach would be to concatenate these observations, driving the periodicities further apart (20 and 14)?

Thanks for your help, joseph


texts: Does a matched filter really improve SNR?

texts:
Does the matched filter actually improve SNR or does it maximize it (making sure that it is not less than what it should be) ? improving SNR would not make sense to me as suppose a receiver has a certain NF that defines an SNR for a signal at a certain power level and a certain BW, improving SNR would mean reducing NF, and that wouldn't make sense, would it?

Assuming a pulse shaped  BPSK signal with a symbol or bit rate =1/BW (a roll off almost equal to zero), the SNR at the matched filter output =Eb/No, multiplying the denominator and the numerator by BW we get: signal power/ noise power and noise power would of course be a function of NF, so in that case where is the improvement? or do you want to say that already assuming that signal BW=1/rate because of pulse shaping  is the condition that did the job?


texts: How to plot the periodic digital spectrum?

texts:
In a previous answer, Dan Boschen wrote (emphasis mine):

  First let me explain the "unfolded" digital spectrum: If you allow the
  frequency axis of the sampled signal to extend to $\pm \infty$,
  instead of limiting to the unique digital frequency range of $\pm
> F_s/2$ (where $F_s$ is the sampling rate), you will see replicas of
  the original spectrum that is centered about 0 (DC) to also be
  similarly centered around every multiple of $F_s$. This is why we only
  need to show the spectrum from $\pm F_s/2$ (or even $0$ to $F_s/2$ for
  real signals) since this replicates everywhere else.  However, I find
  this visualization helps immensely in understanding many concepts in
  multi-rate signal processing as well as bridging analog and digital
  systems.

Indeed this was an(other) eye-opener to me.  Unfortunately, all the GUI tools I have at hand at this time only plot digital spectrum in the $0$, $F_s/2$ range--and I always thought it was the full spectrum. But as mentioned by Matt in a comment below "the spectrum is periodic".

Do you know how I can plot several periods of the unfolded digital spectrum using Matlab/Octave or Python Scipy?


texts: Viterbi Decoder - How does inverting the input bits affect the result?

texts:
Does converting zeros into ones and ones into zeros in the input stream affect the decoding result? Empirically I have seen that it does not affect, decoding $[0 1 0 1 \ldots]$ and $[1 0 1 0 \ldots]$ produce the same output stream. But I am not sure if it is true or not, and I am looking for a theoretical proof.

Why I am doing this is because the convolutionally encoded stream (rate $\frac{1}{2}$ and constraint length 7) is received without the phase information, thus a conversion is needed. I am trying to determine in which step I should convert the data.

I would appreciate if you could share any knowledge.


texts:
There are many tutorials and guides explaining how to create a "robotic" voice by using a vocoder or a mix of filters that change pitch, tempo and maybe add a slight echoed delay. However, is it possible to do that opposite? How would you take a "robotic" sounding voice and make it sound more natural? I know certain effects, like adding emphasis, is still a research problem, but is it easier to remove the "tinny" sound found in a lot of synthetic voices?

I'm specifically interested in a code solution (preferably Python), because I'd like to wrap it around a text-to-speech synthesizer (like Festival or Flite) to work in real-time. Unfortunately, I'm not sure where to begin since Googling "how to make a robot voice sound more human" just returns tutorials on doing the exact opposite.

Here's an example voice of the Flite engine using an HTS voice. Especially near the end, the voice almost breaks up into a "buzz". Can that be removed, or would that actually require adding audio data?


texts: Understanding Farneback Displacement Estimation

texts:
I am having some trouble in my attempt to understand some of the operations in the Farneback optical flow algorithm, and i would really appriciate if somebody could help me a bit along the way (and i hope i am able to express myself properly).

The article i am currently reading is the "MOTION DETECTION IN THE WITAS PROJECT", which is availiable for free on ResearchGate.

I have interpret the approximation part of the algorithm as following [seen in equation (1) to (3)]: A local signal model for each image pixel is found by approximating a quadratic polynomial, based on the pixel neighborhood. The approximated coefficients are found in A, b and c - while x = (x,y) is a running variable? The result is that the local signal model is a bivariate quadratic curve?
From the part 3.1 First Attempt: I am having trouble understanding the term A(x,y) = [A1(x,y) + A2(x,y)]/2. Is the (x,y) index related to the pixel coordinate where the expansion coefficients belong? I would have expected that A2 was belonging to an local signal model that was identical, but displaced, with respect to the local signal model which has the A1 expansion coefficient. I read equation (10) as: "Find the expansion coefficient A1 to pixel (1,1) in image 1, add it with expansion coefficient A2 to pixel (1,1) in image 2 - and divide by 2"?
The use of indexing in equation (10) to (13) is also making me insecure if we are talking about pixel coordinates. The same variables is used in equation (1), but i assume that this is running variables that is used to make the polynomial?

Kind regards
VegardB


texts:
I asked a question over on stack overflow.

I'm having a slight problem however.  As suggested by Paul R I am mirroring my lower $n/2$ bins into the upper $n/2$ bins.

I have a few questions however.

I'm assuming $n$ is $2^{fftOrder}$?  Thus for an order 10 IFFT I would be mirroring the bottom 512 frequency bins in to the top 512?  This would also produce me 1024 real samples in the end?
When mirroring does this mean that bin 0 would go to bin $n - 1$, bin 1 to bin $n - 2$ and so on?
I appear to be getting some form of reflection at a quarter of my sampling frequency?  This means that the top half of my frequency range is actually appearing over the bottom half.  Has anyone any ideas why?
Does anyone have any idea why I am getting a striping effect where I get 512 samples of one magnitude and the next 512 of a different? (This "could" be where my mirroring is coming from)

I think thats it for now.  Any help would be hugely helpful!!

Edit: Giving you an image of the reflection will be near enough impossible as its very hard to see!  Basically I'm sampling at 22 kHz and getting nothing but "noise" above 11 kHz.  What "ought" (though obviously I'm doing something wrong) to be above 11 kHz seems to get reflected down from 11 kHz to 0.  Its very odd.

As for the image of the stripes they can be seen here

Each stripe, I believe, is 512 samples wide.


texts: Why do we deal with the eigenvectors of the autocorrelation instead of the data itself?

texts: How intuitively to understand why eigenvectors of the autocorrelation matrix are used, but eigenvectors of the matrix constructed from temporal samples have no sense and aren't used? For example, in detection of a harmonious signal in additive noise.


texts: Smallest FFT buffer size given zero-padding

texts:
I am currently working on a project that involves processing an audio signal by dividing it into chunks of size B. The buffer is then zero padded to have a size of 44100 points, after which FFT is applied so that the peak frequency of interest is detected. The reason why I'm zero-padding is to have a 1-Hz FFT resolution.

I would appreciate your input on two questions, please:

Given this process, what's the smallest FFT buffer B (before zero-padding) that I could have?
Is there a relationship between the size of the buffer B (before zero-padding) and the accuracy of detecting the peak?


texts: What is the best way to represent audio visually? (x-post from UX)

texts:
Original Question: https://ux.stackexchange.com/q/23040/16006

I've only taken some basic signal analysis courses, so I might be missing some things.

Purely theoretical question:

What methods exist for representing audio?

What methods could be made for representing audio, more specifically musical audio?

So far, I'm aware of:

Viewing the waveform (Soundcloud does this), mostly useless except for seeing "loudness"
Spectral analysis (Example), good for seeing frequency and "loudness"

Essentially I'm wondering if there is a way one could "see" the notes, beats, and so on of a song, visually.

Right off the top of my head I can think of displaying 3 differently colored waves over time representing treble, mid, bass in a soundcloud-like container with the section playing (or moused-over) being magnified, with the surrounding waveforms being compressed into the corners (like a wide-angle lens effect).

EDIT: I don't know where this could be used, this was just born out of my frustration with current audio visualizing technology.

I imagine having a 3d graph of a spectral analysis over time (Ninja Edit: apparently known as spectrogram) would be the "best" solution since you see everything but it might not be the most elegant and it might not be portable to places like soundcloud.

Even current spectrum analysis is hard to decipher (Too low level for images):

FL Studio wave editor

I'm essentially wondering what might work for casual users, and for people wondering ahead of time how the song will play out.


texts:
I am trying to find the analytic expression of the autocorrelation function for a signal $X(t)$ which is defined as follows.

$X(t = 0) = 1$
At random times jumps to $X(t) = 0$ happen

The jump probability in each infinitesimal time-step is $\Gamma dt$

After the jump the signal stays at $0$ for time $\tau$
Then the signal jumps back to $1$

Do you know how or even if it is possible to calculate the autocorrelation function of such a signal?

The signal should describe the following scenario:

Imagine you have a house with a window. In front of the window there is a railway where trains can pass. Each train takes a fixed time $\tau$ to pass the window and trains arrive at random times. Assume that I am pointing a laser across the railway trough the window. If I can see the laser $X(t) = 1$ else the laser is hidden by the train and $X(t) = 0$. I want to calculate the autocorrelation function of such a signal.


texts: What is the maximum value that can result from a 2D DCT?

texts: Assuming that I have an 8x8 matrix of 8 bit unsigned values and carry out a 2D DCT on them, what is the biggest value that can result from it? This will help be decide how many bits to use. I am aware that the output coefficients are signed.


texts: Why do we use the top left corner as the origin in image processing?

texts:
Why do we do this in image processing?:

Instead of this?:


texts:
I am new to DSP, and I am self-studying using mostly Proakis.  I have a question.  There are some examples in the text where you will be given the impulse response of an LTI system, and then asked to solve something/prove something, so forth.  My confusion involves the following: How do I know that there exists an LTI system with the given impulse response?  For instance, if a problem is posed like one of the examples in Chapter 2, "given a relaxed LTI system with impulse response:

$$h[n] = a^n u[n]$$

where $-1 < a < 1$," (and $u[n]$ is the discrete-time unit step function) how do I know that this impulse response actually comes from an LTI system?  Sorry if this question is simple.  I'm probably not seeing something.


texts: What is $F(0)$ is "dc" component in the context of image processing?

texts:
It has always been said that $F(0)$ is the "DC component" in fourier transform. However, I don't get what it means to say that $F(0)$ is "DC" in the context of image processing.

The zero in this case just meant zero frequency, and hence no changes isn't it? Then in the context of image processing, how should I imagine the picture to be like at $F(0)$? What exactly is that "DC" component?


texts:
Can anyone tell what are the significance of sinusoidal signals in the field of science and engineering?
sorry for being noob,


texts: Carrier Frequency Offset, Rotating Constellation and Correlator

texts:
I have been further reading up on carrier recovery methods and something is not clear to me:

It's written that a carrier frequency offset results in a rotating constellation diagram but if you are sampling at the output of a correlator such as RRC it's not clear to my why this is the case.

For an all digital receiver, the ADC samples will be rotated prior to going into the correlator but it appears the correlation process in conjunction with the frequency offset will do more than rotate the constellation diagram.

Am I wrong?


texts: How compute frequency of signal from zero crossing?

texts:
I need to compute frequency of a signal from zero crossing.It's possible to compute to frequency from zero crossing of a signal.
Plz anybody help me about this with matlab .


texts: My preamble bits not enough for locking the timing recovery for a gaussian channel

texts: I have chosen the preamble to be 48 bits (16 bits for carrier recovery+16  bits for timing recovery+ 16 bits for AGC of 30dB + 16 bits  for phase ambiguity) As channel is gaussian and there is no much frequency offset i was thinking number of bits would be ok? but i am seeing sometimes they is timing error? I choose the preamble length based on some sample application? Is there any criteria to choose the preamble properly? Does it depend on snr, data rate ...


texts: How is Weighted Thresholded Histogram Equalization different from Gamma Correction Image enhancement

texts:
In case of Weighted Thresholded Histogram Equalization we use:-

calculate, the Weighted Probablity Density Function for Image using,

$$P_{wt}(k) = \left( \frac{P(k)-P_l}{P_u-P_l} \right)^r P_u$$

Where $P_u$ is the highest probability of a intensity in a Image.
      $P_l$ is the lowest probability of a intensity in a Image.
      $P(k)$ is the Probability Density Function for the Image,i.e. the number of pixels having the intensity $k$ in a image.

Then perform Histogram Equalization on the image using,
calculating Cumulative Distribution Function

$$C_{wt}(k) = \sum_{m=0}^k P_{wt}(m)$$
$$Im(i,j) = W_{out} C_{wt}\left(F(i,j)\right)$$

For $r<1$ the Power Law Transformation function will give a higher weight to the low probabilities in the PDF than the high probabilities.

How is this procedure conceptually different from the Gamma Correction technique, explain if similar how much similarity is there or if something is different, Explain where does it deviate from Gamma Correction method for Single Image Enhancement.

Does this Procedure Passes for Being Called as Gamma Correction in some Aspect OR Do some Changes are Required.


texts: Transformation of random variables vs shift of functions

texts:
I am a beginner to random variables and I am understanding the concept of the transformations of a random variable. Consider a random variable $X$ to be Gaussian distributed with $a_x = 1.6$ and $\sigma_x = 0.4$. The random variable now undergoes a transformation $Y=X-1.6$. We know that the relationship between $Y$ and $X$ is given by: \begin{align} f_Y(y) = f_X(x)\left\vert \frac{dx}{xy} \right\vert \end{align}.$$ Y=X - 1.6 \implies X = Y+1.6 \\ \therefore \left\vert\frac{dx}{dy} \right\vert = 1 $$ $$ \textit{Thus,} \ \ f_Y(y) = f_X\left( Y+1.6 \right) \\ \implies f_Y(y) = \frac{1}{\sqrt{2\pi\sigma_x^2}}exp\left(-\frac{(Y-(a_x - 1.6))^2}{2\sigma_x^2}\right)$$
with $a_y = a_x - 1.6 = 0.0$ and $\sigma_x = \sigma_y = 0.4$
Graphically, it looks like this:

However,another concept that is bugging me is the transformation of independent variables in signals and systems, like the shift operation. Using this concept, $f(t-1.6)$ would be a delayed version of the function $f(t)$ as follows:

I know this may look stupid, but can someone please help me clear out this confusion?
Thank you so much.


texts:
I'm afraid this might be a bit of an elementary question, but I'm afraid I'm a little new to this. I've got a system that measures a frequency spectrum to find resonant frequencies. It does this by applying an impulse, and then performs a linear sweep through a range of frequencies measuring the amplitude of the response.

As far as I can tell, this seems to produce data that contains both frequency- and time-domain information, because the frequency being measured changes over time. The results seem to agree with this: the initial impulse decays over "time", with individual excitations being visible at various frequencies. See here for an example (frequency on the horizontal axis, amplitude on the vertical):

I would like to remove from this data the "time" component, leaving just the resonant responses. I have tried mirroring the data, then deconvolving a "top hat" function, and FTing the result, but I am not convinced this corresponds to anything meaningful. Could anyone provide any insight?


texts: Periodogram of time series with multiple seasonal behaviors

texts:
I have a time series of sampled for every 5 minutes for  20 years of some geological signal. I would like to generate a periodogram in order to analyze what seasonal behavior affects the signal.  At the moment what I am doing is :
x_time <-  as.Date(data$date)
x <- data$signal
spec_ob <-spectrum(x,log="no")

But, I am not sure how to interpret it - how to translate the frequency into time?


texts: What does the frequency band mean when it comes to finding aliases?

texts:
The time signal which i'm trying to find the aliases for is:

$$x:{\mathbb R}\rightarrow {\mathbb R}\\\   x(t)=\cos(50t) +2\cos(70t).$$

If the sample period is $T_s = \frac{\pi}{60}$ then according to Nyquist -Shannon sampling theorem (which btw my professor failed to prove) there is/are a signal(s) which after sampling will be equal to the sampled version of the above signal, if we sample those with the same sample frequency in the frequency band $[-55, 55]$.

I don't understand the meaning of the last sentence , what does a frequency band means here?


texts: Question on N point DTFT - Fourier transform

texts: I have been trying to use the logic that both X and Y should have same Z transform, but according to the definition, Y is not anti causal.


texts: Learning about inverse-z-transform and how to apply it to a rational transfer function

texts:
I have been studying IIR filters and know that a rational transfer function:

$$
H(z) = \frac {b_0 + b_1 z^{-1} + ... + b_N z^{-N}}{1 + a_1 z^{-1} + ... + a_N z^{-N}}
$$

has a finite difference equation:

$$
y[n] = b_0 x[n] + b_1 x[n - 1] + ... + b_n x[n - N] - a_1 y[n - 1] - ... - a_N y[n - N]
$$

What I am confused about is how the transformation from transfer function to difference equation is performed.

I have read about the z-transform and the inverse z-transform and understand that the inverse z-transform is the key, but none of the internet sources I have read provide a joined up walk though of how to take a transfer function and derive a finite difference equation from first principles.

Could anyone recommend a good source, or explain the end-to-end approach?


texts: $l_2/l_2$ guarantee on sparse Fourier transform

texts:
I am starting my studies now on signal processing, and really didn't find nothing on "$l_2/l_2$ guarantee" of a certain function, in my case:

$$||\hat{x} - \hat{x}'||_2 \leq C\text{ min }_{\text{k-sparse}\; y} ||\hat{x}-y||_2 $$

My reference is "Simple and Practical Algorithm for Sparse Fourier Transform" by Hassanieh, Indyk, Katabi, Price.

What does it means to say that the function is $l_2/l_2$ guarantee or $l_{\infty}/l_2$ guarantee? A reference would be of great help!


texts: Using Matched Filter To Predict the Existence of An Event

texts:
I have a stream of signal, and I'm looking for the presence of a certain event (the signal), also I have a "model"(which is a an approximation of the original signal) for that signal, and I will adopt it as my matched filter. So I tried to choose the matched filter, without any mathematical calculation. When I was looking for the signal. I saw a pattern that appears repeatedly. And I expect that pattern is the signal.

Could I cross-correlate the matched filter every unit of time (for example, every 2 seconds) with the signal and see if the value of cross correlation approaches to 1, and based on that decide if that event is existing or not?
To make things more clearly, the following is an algorithm of my approach

while (Signal s is Streaming)
{
  S = epoch_the_signal(s)
  x = cross_correlation(S,M)
  if(x > Threshold)
  {
    print "The signal appears"}
  }
}

What if I choose the matched filter as what is given in the literature (taking the matched filter as to increase the SNR. So I take what I expect to be the signal, and I used the formula, which is shown below to build the matched filter). does that will increase the noise that my model is including it in addition to the signal?

I think the hardest work is how to get the signal, not how to find the matched filter. Especially if it's biomedical signal.


texts: What factors go into choosing DCT type 1 over type 2 or type 3 etc?

texts:
I'm a newcomer to the DCT, DFT etc. I understand that they're intrinsically related, I understand that the DCT tends to "compress" the information in a signal towards the first few bins, leaving the rest relatively close to zero. I'm trying to learn more.

DCT has different "types". Based on reading wikipedia, the types mainly differ in adding 0.5 to either the input index, the output index, or both, when computing the matrix coefficients. Type 1 does neither, type 4 does both, and 2/3 do one or the other.

It's not clear why types 2, 3, or 4 would ever valuable. What benefit does shifting the input or output signal by half give? What are some examples of applications that are well-suited for DCT type 2,3 or 4, but are not well suited for DCT type 1? If I have an array of floats that I want to compute a DCT on, what factors should go into an educated decision on which type to use?


texts: Sox, mixing mono inputs into mono output (efficiently)

texts:
I want to mix two mono files, signal.wav and noise.wav, into a single mono file, signal_noise_mono.wav.

Currently, I know how to mix the two input files into a stereo file and then remix it to mono, but I would like to mix down to mono directly, and avoid the intermediate file.

# Merge signal (mono, L) and noise (mono, R) into a stereo file
sox -M signal.wav noise.wav signal_noise_stereo.wav

# Remix channels 1 & 2 from the stereo file into a single mono file
sox signal_noise_stereo.wav signal_noise_mono.wav remix 1,2

Any tips? Have I missed an obvious sox switch?


texts: Increasing the number of points in the frequency spectrum

texts:
I have an image with few pixels in length and height. For this image I calculated the two dimensional Fourier transformation. What I got for the frequency spectrum in one direction was a very frequency spectrum with very few points (no continuous first derivation).
To increase the number of points of the frequency spectrum, I used a window function, in my case a Hanning-filter/rectangular filter with zeros outside of the picture so that the filtered picture has much more pixels in length (horizontal) and height (vertical). This resulted in a frequency spectrum with more points so that the frequnecy spectrum in e. g. the horizontal direction looked more continuous but there were in contrast to the unfiltered image higher peaks for low frequencies. What I want to do now is to find a possibility to reduce that.
My approach was the convolution theorem (but I have no idea how to use it in two dimensions) which says, that $F(f) * F(g)$ = const $F(gf)$. I have $f$ (original image) and $g$ (multiplication by rectangular window: some $1$ in the centre, $0$ outside it) and in that way the fourier spectrum that I get is $F(gf)$. To get $F(f)$ I have to deconvolve $F(f)$ and $F(g)$.
But the problems are at first:

Holds the convolution theorem for this?
Will the matrix $F(f)$ that I will finally get, the same that I got by Fourier transformation without the window function of the rectangular but with more points in the frequency spectrum? In other words, will it reduce effectively the influence of the filter in the frequency spectrum?
Is there an effective way to calculate the deconvolution with e.g. matlab?

If there are problems, is there an alternative way to increase the number of points in the frequency spectrum without changing it at all? If not, how can I fit the points in the frequency spectrum in the best way?

I would be very grateful for any helpful hints.


texts:
Shannon formula for channel capacity states that
$$C=\log\left(1+\frac{S}{N}\right)$$
If this formula applied for baseband transmission only? Is it applied with passband transmission?
Are there any changes in the formula with different types of modulation, for example, OFDM??