texts:
I have some data which looks roughly periodic - is there a nice way to measure this?

This is an example I'm working on and I'd like a metric that I will be able to just threshold to give a decision of yes or no. I was thinking maybe looking into the Fourier domain or looking at correlation. Many thanks.

[NB - I've cross-posted - I've also asked on the stats stack exchange but I think it may be more appropriate here]


texts: Brightness equalization between different images

texts:
I am dealing with a proprietary whole slide image format from 3DHistech, namely MRXS. This image is produced by scanning a glass slide biopsy. The scanner takes pictures at certain positions which eventually make up one big image (in the range of hundreds of thousands pixels per side).

Subsequently, the software produces downscaled versions of the original image, effectively generating a pyramid, in order to make viewing the image faster.

The camera pictures, as well as the downscaled versions, are saved as small rectangular JPEG images, usually around 300x300 pixels.

I have written a parser for the image and I am able to render these digital slides appropriately. However, I came across some slides that have different brightness (?) among tiles. It seems that the vendor's software does compensate for this, while my software obviously doesn't.

I have opened some of the JPEG streams in Photoshop (among other tools), and I was able to manually fix the brightness difference and make the image look smooth. My question therefore, is what kind of algorithm could I incorporate to do this automatically as I render these images?

I am attaching a sample original tile produced by the scanner software and an edited version I did in Photoshop.

ORIGINAL

EDITED


texts: What is the best input for de-noising autoencoder for sound data?

texts:
I am currently trying to build an autoencoder to de-noise audio data.
However I have not found any good articles explaining about the input to the autoencoder, i.e. feature vector.
As in speech recognition/text up projects, MFCC is known to perform good as a input data/feature vector to neural network.
I would like to know what kind of data is need for denoise autoencoder for audio/sound data.

Thank you so much for your kind help in advance.


texts:
I was listening to this lecture

https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-451-principles-of-digital-communication-ii-spring-2005/video-lectures/lecture-1-introduction-sampling-theorem

and the prof computed $\log_2(37dB)$ in no time. I tried to follow his logic but couldn't get it. Can someone please explain how can one do such a computation in head. He used $\log_{10}(2)=0.3$ as a building block for his computation


texts: Changing limit of integral make time-variant to time-Invariant system

texts:
$S_1:x(t)\longrightarrow y(t) =  \int_{-\infty}^{3t}{x(\tau)\,d\tau}$

$x(t-t_0)\longrightarrow y_1(t) =  \int_{-\infty}^{3t}{x(\tau-t_0)\,d\tau}$

$=  \int_{-\infty}^{3t-t_0}{x(z)dz} \neq y(t-t_0) $    (Time Variant)

My teacher showed my the Above relation, shows that the system is Time Variant but if i change its upper limit to $3t-3t_0$ i.e $\int_{-\infty}^{3t-3t_0}{x(z)dz}$ then the system becomes Time-Invariant, my teacher told me this and now i am confused can someone tells me why upper limit $3t-3t_0$ this makes it time-Invariant


texts: Any estimation algorithms that allow a user to indicate that certain Solutions are impossible?

texts:
Variations of the Kalman filter and other algorithms are used for navigation and target tracking. Often times certain solutions might as well be deemed impossible based on known topography in the area. Without accounting for the topography, the algorithms I know of might say that a submarine is most likely under the sea floor, or that an aircraft has tunneled into a mountain. Preferably, an algorithm would give the most likely solution after treating certain solutions as impossible.

Are there any estimation algorithms that do this sort of thing?
If there are such algorithms, what are they?


texts: I'm confuse how to use pdf to predict next state in particle filter

texts: How can I make predict state/equation for next state if I have state space $[C_x,C_y,H,W]$ where $C_x,C_y$ is position of centroid object and $H,W$ is height and width of object contour?


texts: Can velocity be calculated in first stage FFT?

texts:
I understand that, For an FMCW radar, the velocity of a target is proportional to the phase changes at same time instants across the chirps.
I have a MxN data cube with N chirps(columns) & M samples across each chirp(rows).
So, why not first perform FFT across the chirps-to get the velocity and then perform a second FFT inside a chirp- to get the range?
In short, does it make sense to estimate velocity from first stage FFT across the chirps?


texts: A question about ICA and non-gaussianity

texts:
I'm new in the ICA processing and I'm trying to understand the non-gaussian requirement. I read that the problem is that, if the composed data is $\mathbf{x}=\mathbf{As}$ with $\mathbf{A}$ (unknown) mixing matrix and $\mathbf{s}$ (unknown) original signals, then in ICA framework the components of $\mathbf{s}$ can not be considered gaussian because no "pattern" can be found in  $\mathbf{x}$ to recover  a unique $\mathbf{A}$ (since any rotation is good). So my questions are:

(maybe a naive or stupid question, but I need to do to clarify my ideas): it seems that the problem is not that there is no solution, but that there are too many possible solutions. Why this should be a problem? If we see the problem as to estimate an $\mathbf{A}$ s.t. $\mathbf{x}=\mathbf{As}$, we simply can tell that there are many solutions and return just one of them.. Where is my error?
The central Limit Theorem states that the sum of many independent signals goes toward the gaussian distribution, so ICA searches for the best non-gaussian $\mathbf{s}$. But, if the sum of many signals is gaussian, again we have that  no "pattern" can be found in $\mathbf{x}$ to recover  a unique $\mathbf{A}$ (again, any rotation is good), so we have the gaussian problem again. Where I wrong?

I apologize for the possibly stupid questions, but I think there is something that is not clear to me.


texts:
I am reading the paper Interleaver Design for Serial Concatenated
Convolutional Codes by Yu et al., and it states the concept of message-round probability as $F(l_1)F(l_2)$ where $F(l)$ refers to the message-propagation function, which is a function decreasing with $l$ that gives the probability that a message propagates over more than $l$ symbols on an encoding branch; and $l_1$ is form the outer encoder while $l_2$ is from the inner encoder of a serially concatenated code. This way the message-round probability gives the probability that a message does a cycle of length $l_1+l_2$.

Such information is useful in order to design efficient interleavers to construct Turbo codes with lower error floors. The paper I cited above referes to two other papers in order to get a more concrete definition of $F(l)$ and ways to calculate such parameter, but they are not useful as one of the references is not available (it is a PhD disertation) and the other one gives no information about it (it is an older paper by the author). It would be very helpful is someone could give reference to some paper that deals with the issue or give some insight on it.


texts: Fequency Domain Oversampling - decimating when going back to time domain

texts:
I'm currently trying to simulate Frequency Domain Equalization, and the effect that over sampling in the frequency domain has on the affect of the equalization. If I understand things correctly this is the process that's supposed to happen using a single Carrier when transmitting

Modulate and transmit the symbols to create $x(n)$, each symbol being $N$ samples.
add noise, $z(n)$, and channel effects, $h(n)$, for the receiver, $ y(n) = h(n)\star x(n) + z(n)$
Zero pad, where $ZP$ is the number of added zeros, in the time domain to over sample in the frequency domain. $FFT(y(n),N+ZP)$. Note that increasing the order of the FFT should be the same as zero padding in the time domain
Do Equalization in the frequency domain
Go back to the time domain
Demodulate the symbols

The part I'm not sure about is step 5, where we go back to the time domain. In order for my number of samples per symbol to be correct, I need N samples, but I have $N+ZP$ samples if I take the same size $IFFT$. Doing the Zero padding and taking the $FFT$ should be interpolation... but i'm not sure how to do the decimation so that I have the correct number of samples. Does anyone have any idea about this? Thanks!


texts: once again,confusion between phase and group delay

texts:
Despite,reading up on this I'm unable to find crystal clear clarity on the differences b/w phase and grpdelay functions and interpretation of grpdelay's output. I have designed a low pass butterworth filter having a cut off frequency of 0.04Hz. There is a delay in my filtered output compared to my original signal. I wish to know this delay. I used the grpdelay function in matlab (grpdelay(b,a,N/2) ). And this is the output i got..
 I read that grpdelay is supposed to give the phase responses as a function of frequencies. In my image, the cursor points to the cut-off freq. How exactly do I know the delay in my filtered output through this? Is it the corresponding value on the Y-axis?

Plotting the phasedelay(b,a), gave this as the output..Here,the phasedelay value at cut-off is different.

My question is, to figure out how much the filter has delayed the signal,which function do I use? And how do I interpret the output exactly, of that function?

Here is my original signal in blue and the filtered signal which has the delay in red .


texts:
I am trying to resample an audio signal in my application. It will be between 48kHz and 96kHz audio (both upsampling and downsampling).

Looking at the Wikipedia page for resampling I see there are two approaches:

Decimation and upsampling
Polynomial interpolation e.g. Lagrange

My questions are:

The upsampling Wikipedia page states

  Smooth out the discontinuities with a lowpass filter, which replaces the zeros.

How does inserting L-1 zeroes between the original sample and then passing it through a low pass filter magically replace the zeroes to become interpolated samples?
If I decide to use polynomial interpolation (Lagrange) do I need to use a low pass filter when downsampling to remove the high frequency signals that are above the Nyquist frequency? What about during upsampling? Why or why not?
All the implementations of resampling I see on the internet are "IIR" filters. Are there any "FIR" resampling filters? If so, why is one seemingly more popular than the other?
My application works by resampling 'chunks' of audio randomly instead of a continuous stream (which is why I want to use a FIR resampling filter as there is no continuity). Is this a good idea or should I change my application to use a IIR resampling filter on a continuous stream of audio?

Thanks all


texts: Which is the most suitable programming language for image processing in scientific researches?

texts:
We are currently working on a platform (web application for a graduation final project we used mean stack) that able researchers to test default methods recognition (methods of Enhancement, Extraction, and matching ), add his own methods too (a script), compose a set of methods ( build a process of recognition) and visualize the outputs of each step. We want to know what a programming language is used the most for testing image processing in scientific articles.for the moment we are using Matlab for its simplicity.

Regards.


texts: Does Kalman Consensus Filter have any public implementations?

texts:
I am trying to solve a problem using the KCF described here: https://ieeexplore.ieee.org/document/5399678
Does there exist an implementation of this (preferably in python) which is available openly? I also read the paper that described the simulations conducted with their algorithm but there isn't a link to an implementation anywhere.
I am also unsure of whether this is the correct stackexchange site to post this question to, but I thought that those who worked in signal processing would have the most experience relating to implementations of filters like KCF.
If no implementation exists, I would also appreciate any advice on how to implement it on my own. I am only looking for an existing implementation as that would save some time. I would otherwise try to implement KCIF as described in the linked paper on my own.


texts: What is the best to confirm that the output of a matched filter for a linear FM chirp is correct?

texts: I have written a matched filter in matlab to compress a linear FM chirp signal and would like to confirm that the results of my range compression. My question is what is the best way to do this? I know that when looking at the plot of the output of the matched filter you should see something like the image below, but was wondering if there is a more scientific way to confirm that the output of the matched filter is correct.


texts: Is the incoming sample in a standard DPCM already quantized?

texts:
I began learning about DPCM and i've got one issue I am not sure about:

Is the incoming sample m[k] (see image for reference) already quantizied or not? I think it is but with an (assumed) very fine quanitization. So the Quantiser block is doing a requantization with a more coarse quantization, right?


texts: Help in proper notations and mathematical formulation

texts:
For a given series, $S = \{-1,0,-2,1,etc\}$. The number of elements in $S$ is $N = 100$. Each $s_i$ belongs to a alphabet from a finite alphabet set $\mathcal{A} =  (a_1=0, a_2=1, a_3=2, a_4=3, a_5=-1, a_6=-2, a_7=-3, a_8=-4)$. The cardinality of $\mathcal{A}$ is $m = 8$. Each $a_i$ is associated with a probability $p_i$ and $\sum_{i=1}^m = 1$.

Part 1: I need help in the correct notations used to mathematically express the above example. This is what I have tried:

Let, $S =\{s_1,....,s_N\}$ be a random sequence / series represented as a succession of $N$ symbols from a finite alphabet set $\mathcal{A} = \{a_1, \ldots, a_m\}$, $|\mathcal{A}|= m$ where $a_i$ are real or complex numbers and  $s_n \in \mathcal{A}$, $n=1,2,\ldots,N$.

Is the above formulation and notation correct? What is the proper way to express this for a general case and not just for $m=8$

UPDATE : Part 1 has been answered.

Part 2: For the given series which is representing the data (information), I need to estimate the probability of occurrence of each symbol using MLE formulation. I think it should be like this but unsure. LEt $c_i$ be the letter counts since the data sequence $S$ appears to follow multinomial distribution. Multinomial distribution is based on counts.

The likelihood is
\begin{eqnarray*}
l(p_1,\ldots,p_{m};s_1,\ldots,s_{N}) &:=& {P}(c_1=a_1,\ldots, c_{m}=a_{m}; p_1,\ldots,p_{m})
\end{eqnarray*}

How to find $\hat{p}_i$ using MLE?


texts: Change the melody of human speech using FFT and polynomial interpolation

texts:
I'm trying to do the following:

Extract the melody of me asking a question (word "Hey?" recorded to
wav) so I get a melody pattern that I can apply to any other
recorded/synthesized speech (basically how F0 changes in time).
Use polynomial interpolation (Lagrange?) so I get a function that describes the melody (approximately of course).
Apply the function to another recorded voice sample. (eg. word "Hey." so it's transformed to a question "Hey?", or transform the end of a sentence to sound like a question [eg. "Is it ok." => "Is it ok?"]). Voila, that's it.

What I have done? Where am I?
Firstly, I have dived into the math that stands behind the fft and signal processing (basics). I want to do it programatically so I decided to use python.
I performed the fft on the entire "Hey?" voice sample and got data in frequency domain (please don't mind y-axis units, I haven't normalized them)

So far so good. Then I decided to divide my signal into chunks so I get more clear frequency information - peaks and so on - this is a blind shot, me trying to grasp the idea of manipulating the frequency and analyzing the audio data. It gets me nowhere however, not in a direction I want, at least.

Now, if I took those peaks, got an interpolated function from them, and applied the function on another voice sample (a part of a voice sample, that is also ffted of course) and performed inversed fft I wouldn't get what I wanted, right?
I would only change the magnitude so it wouldn't affect the melody itself (I think so).
Then I used spec and pyin methods from librosa to extract the real F0-in-time - the melody of asking question "Hey?". And as we would expect, we can clearly see an increase in frequency value:

And a non-question statement looks like this - let's say it's moreless constant.

The same applies to a longer speech sample:

Now, I assume that I have blocks to build my algorithm/process but I still don't know how to assemble them beacause there are some blanks in my understanding of what's going on under the hood.
I consider that I need to find a way to map the F0-in-time curve from the spectrogram to the "pure" FFT data, get an interpolated function from it and then apply the function on another voice sample (I mean curve fitting)
**Is there any elegant (inelegant would be ok too) way to do this? I need to be pointed in a right direction because I can feel I'm close but I'm basically stuck.
I need to increase/manipulate frequencies at certain point in time, I know it does mean to move data from one bin to another but I need to know how to work with the STFT data.
**
The code that works behind the above charts is taken just from the librosa docs and other stackoverflow questions, it's just a draft/POC so please don't comment on style, if you could :)
fft in chunks:
import numpy as np
import matplotlib.pyplot as plt
from scipy.io import wavfile
import os

file = os.path.join("dir", "hej_n_nat.wav")
fs, signal = wavfile.read(file)

CHUNK = 1024

afft = np.abs(np.fft.fft(signal[0:CHUNK]))
freqs = np.linspace(0, fs, CHUNK)[0:int(fs / 2)]
spectrogram_chunk = freqs / np.amax(freqs * 1.0)

# Plot spectral analysis
plt.plot(freqs[0:250], afft[0:250])
plt.show()

spectrogram:
import librosa.display
import numpy as np
import matplotlib.pyplot as plt
import os

file = os.path.join("/path/to/dir", "hej_n_nat.wav")
y, sr = librosa.load(file, sr=44100)
f0, voiced_flag, voiced_probs = librosa.pyin(y, fmin=librosa.note_to_hz('C2'), fmax=librosa.note_to_hz('C7'))

times = librosa.times_like(f0)

D = librosa.amplitude_to_db(np.abs(librosa.stft(y)), ref=np.max)

fig, ax = plt.subplots()

img = librosa.display.specshow(D, x_axis='time', y_axis='log', ax=ax)

ax.set(title='pYIN fundamental frequency estimation')

fig.colorbar(img, ax=ax, format="%+2.f dB")

ax.plot(times, f0, label='f0', color='cyan', linewidth=2)

ax.legend(loc='upper right')
plt.show()

Hints, questions and comments much appreciated.


texts: frequency characterritic of activ high pass filter

texts:
How can i see  the characteristic(frequency response) of  an active high pass filter?I attached  the circuit and the value of resitence .Can i see it on the computer without an osciloscope ?How can i calculate it on the paper?
Thank you very much!


texts: Does the autocorrelation function completely describe a stochastic process?

texts:
Is a stochastic process completely described by its autocorrelation function?

If not, which additional properties would be needed?


texts: Beyond "mid-side": decompose an audio stereo recording (coincident microphones) into Mid + 45° + 90°

texts:
Context: I have done in the past stereo recordings in XY position (coincident microphones):

from a source far from at least 20 meters (example: piano in a big reverberant building).
Since the microphones are coincident, there are IID (interaural intensity differences), but, sadly, few ITD (interaural timing differences). Thus the recording is less lively, much less "outside your head" (when listening with headphones), that it could have been with a spaced pair of microphones. That's the final problem that I'm trying to solve, since I can't redo the recordings: respatialize the sound into something closer to a spaced-pair recording. (I have other recordings with a spaced pair non-coicident mics, and I confirm it would have been better). See also Algorithms to re-spatialize a stereo recording audio signal?.
(Any coding idea to achieve this general goal is welcome).

The option I'm now considering to achieve this goal in this question is to:

decompose the signal L[n], R[n] (left, right) into several layers
apply different ITD (Interaural Timing Differences) on each layer
mix the layers to get a new output signal

Example with Mid-Side:
Mid[n] = (L[n] + R[n]) / 2
Side[n] = (L[n] - R[n]) / 2

Out_L[n] = Mid[n] + Side[n + K1]    # K1 is a time-shifting parameter
Out_R[n] = Mid[n] - Side[n + K2]    # K2 is a time-shifting parameter

I tried this, but it does not really help to achieve the goal mentioned above.
Question: Is there a decomposition of a stereo signal that goes beyond than Mid (0°) + Side (90°) ?
Something like:
Layer1[n] =  Mid (0° to 30°)
Layer2[n] =  Diagonal (30° to 60°)
Layer3[n] =  Side (60° to 90°)

Note: The "Coincident Microphones" part of this answer of Algorithms to re-spatialize a stereo recording audio signal?
 could be useful, but I don't see exactly how to use this concretely in an applied algorithm.


texts: Image Pixel Wise Transformations - Recommended Order

texts: I'm new in image processing. Right now I know how to correct white balance and how to correct image contrast. But if I need to make this two tranformations. In which order should I do this?


texts: Kalman filter for harmonic oscillator. State variable and Covariance matrix

texts:
I've coded a simple damped harmonic oscillator, controlled with a pid. Works fine.
I want to use this model to test a kalman filter. So i added a gaussian noise to the position and want to feed the noisy position to a kalman filter but im a little lost regarding state variable and how to choose them and also the different matrix.
Here how far i got. Starting with the equation representing my system is:
$m \ddot x = -k*x -damp*\dot x + F$
I set the state variable as: $ \left( \begin{array}
  &x \\
  \dot x \\
   \ddot x \end{array}\right)$
the state model matrice as :$A= \left[ \begin{array}
  &1&dt& \frac{dt^2}{2} \\
  0&1&dt \\
   -\frac{k}{m}&-\frac{damp}{m}&1 \end{array}\right]$
the input model matrice as :$B= \left[ \begin{array}
  &0 \\
  0 \\
   1 \end{array}\right]$ and the input as: $u= \frac{F}{m}$
which gives the state estimate: $$x_{k+1} = A \cdot x_k + B\cdot u$$ and the covariance estimate:
$$ P_{k+1} = A\cdot P_k \cdot A^T + Q$$
where $P_0 =\left[ \begin{array}
  &100&0&0 \\
  0&100&0 \\
   0&0&100 \end{array}\right] $ ie we dont know where we are (as P=0 mean we are sure of our initial state from the wikipedia example)
I've set the observation $H=\left[ \begin{array}  &1&0&0\end{array}\right]$ bc we only look at the position and $Z =  \left( \begin{array}
  &x_n \\
  0  \\
   0  \end{array}\right)$ where $x_n$ is the position with the added noise.
the correction step being:
$K = P \cdot H^T \cdot \left( H \cdot P \cdot H^T +R\right)^{-1}$
$X_{k+1} = x_{k+1 estimate} + K\cdot (Z-H \cdot x_{k+1 estimate} ) $
$P_{k+1} = (I - K \cdot H)\cdot P_{k+1 estimate}$
So my two question are:

So far, are my differents matrices correct ? Also, any tip on how to choose the different state variable is welcome. Some model just position and velocity, some other position, velocity and acceleration some with the jerk and so on and i'm a little confuse.
I missed the covariance matrices Q and R. Right now they are set a $\sigma \cdot I$ with sigma a small value but i feel it's not right.

Thanks for your help !
EDIT:
I eventually find what seem to be the error.
The state model matrice should be: $A= \left[ \begin{array}
  &1&dt& \frac{dt^2}{2} \\
  0&1&dt \\
   -\frac{k}{m}&-\frac{damp}{m}& 0 \end{array}\right]$
The last term should be a $0$. If set at $1$ like before, it means that i'm adding the previous acceleration on top of the rest of the formula.
It's not the usual upper triangular matrix but it works none the less.
There still some pb as the filter position tend to be closer to the command than the real position so the pid stop acting which lead to a drift which is then violently compensated.
Also integrating the acceleration as a measurement lead, after a good beginning, to an oscillation explosion (it start to oscillate with bigger and bigger amaplitude). Decreasing the level of noise on the acceleration resolve the problem (still have some spike here and there) but if dont think it's the good solution.


texts: How to perform dot annotation for crowd counting in a image file using Matlab?

texts: I have some crowd images having more than 300 people in each image. I want to label each person(i.e. head) with dot annotation such that coordinate of each dot(x,y) is saved in a .mat file. I hope there is something in Matlab for this task.


texts:
I am working on identifying the constellation used by an OFDM based protocol.

After extracting the Symbol and Cyclic Prefix from the recorded signal, interested to identify the used constellation/modulation scheme(QAM4/16/…).

Applying a high resolution FFT(size=$2^{19}$), reveals the ~64 bins(Red picks) of the first symbol payload(without the CP).

However, examining the samples on a complex axis, yields(right)

Wondered what may be the  cause for such a structure.

Here
is my MATLAB data Structure of a several burst (I+Q), and can be loaded using:

strct=load('E:\....\fhss_1.mat');
FHSS_1=strct.fhss_1;

The beginning of the first symbol for fhss_1.mat is located at: 14653, the size is 3650(samples).


texts:
when manipulating a live stream of audio data in the frequency domain, I've heard you need to do fft / ifft in small chunks, say 256 samples at a time.

I've also heard you need to somehow employ a window function but I'm not sure the details on that. Is that to prevent artifacts from popping up due to the circular nature of fft?

Is there anything else I should know that I haven't mentioned above if planning to do this? I also eventually want to figure out how to make windows work with convolution reverb, but assume the answer to that is big enough for its own question.

Thanks for any info!!


texts: Design of a low pass filter with Red Pitaya's FPGA

texts:
I'm trying to design a low pass filter in Verilog for use on a Red Pitaya's FPGA (Xilinx® Zynq®-7010).
All I'm trying to get the low pass filter to do is to obtain the DC component in the signal.
The only part of the signal I require is the DC component.
Can someone put me through on how to go about the design as I am new with Red Pitaya?


texts: What is the difference between the PSD and the Power Spectrum?

texts:
Can any one explain the difference in the amplitude between the two and what does each one represents?

For example, when using the pwelch algorithm in MATLAB how do the two different options ('psd','power') affect the units of the output?

(I know the default is 'psd' and I can use 'power' to show something closer to the rms calculation, as stated here)


texts:
I came across the symbol $\mathfrak{R}$ in the Kalman introduction: Kalman Filter Intro

$$
x\in \mathfrak{R}^m
$$
It was used in this context:

$$
    x_{k} = Ax_{k–1} + Bu_{k – 1} + w_{k – 1}
$$
What does $\mathfrak{R}$ stand for?


texts: How CDMA receiver extract it's corresponding data from the receiving modulated & superposition-ed signal?

texts:
I have difficulty understanding CDMA.

I have read all those PN/walsh code things, and understand orthogonality very well.

But none of the resources I found demonstrate how a receiver end extract data from modulated & superposition-ed signal.

Most of them just stop at the digital encoding & decoding part and skip the modulation part.

But in real implementation signals of different walsh code are modulated then superposition-ed.

I cannot figure out how it is done.

======================================================

P.S.
I am confused that does the sender add the signals before or after modulation?

If before, take BPSK as an example, there is a chance there would be >2 different values in the added result vector, which can no longer be encoded in BPSK.

If after, then the signals are simply super-positioned, the receiver would often see both 0&1, with different amplitudes, at the same time, i.e. Acos(wt)+Bcos(wt+pi), which seems a bit hard to decode.


texts: Is it possible to plot the transfer functions of a State Variable Filter in Matlab, having only recurrence relations?

texts:
I need to implement a State Variable Filter, like the one I've programmed in C++ (see code below) inside Matlab. I'm only having the recurrence relations for y and s at the moment.

This is the State Variable Filter, taken from the book listed below as a source. 1 The recurrence equations are:
yHP = (1. / (1. + 2. * mR * mG + mG * mG)) * (input - (2. * mR + mG)* mZ1 - mZ2);
yBP = mG * yHP + mZ1;
yLP = mG * yBP + mZ2;
mZ1 = mG * yHP + yBP;
mZ2 = mG * yBP + yLP;

// with

mR = 1. / (2. * mResonance);
mG = tan(M_PI * mCutoff / mSampleRate);
mSampleRate = 44100;

Inside my Code I've written in c++ there's only mResonance and mCutoff to be dealt with. Input would be a impulse, because to get the transfer function of a filter you'd need the impulse response. I would have liked to plot a functional group inside Matlab but I just don't know how, would be really glad if someone could help me out here.
My idea was to copy the code above inside matlab and then simply plot ztrans(yLP), ztrans(yBP) and ztrans(yHP) with different cutoff & resonance parameters in one single graph resulting in a functional group. However this didn't work out, since Matlab gave me the repot that some values would be unknown after every line of code... It seems it can't work with unknown parameters.
I've been thinking this gotta be so easy, doesn't it? How can I plot the transfer functions of this filter, my brain is melting...
1 Figure 4.20 from Designing Software Synthesizer Plug-Ins in C++: For RackAFX, VST3, and Audio Units by Will Prikle (Found it on google, so i figured it would be no problem to show here)
(I also asked this question on Stackoverflow)


texts: How to practically correct for group delay imposed by a digital filter (Python)

texts:
I'm using Python to filter a signal using a Butterworth filter (scipy.signal.butter) and subsequently passing this through a forward-backward filter with cascaded second order sections (scipy.signal.sosfiltfilt). Obviously, this introduces a group delay which I don't like.
I was told to use just the scipy.signal.filtfilt as it has a zero phase shift, though it is less numerically stable than the sosfiltfilt method.
I understand there are ways to calculate the group delay, for example scipy.signal.group_delay. This gives me an array of the phase shift for each frequency in my sample domain.
So this brings me to my general question - how is knowing the group delay useful? How can I practically  use the group delay at each frequency to correct for the phase shift in the filtered signal? Is there a method for this, or is it as tedious as delaying each frequency component separately and then summing them up to get a zero phase shifted signal?
Cheers


texts: what is difference between Alias vs. down sampling?

texts: could someone help me explain downsampling in the context of Nyquist–Shannon sampling theorem and tell the difference between Aliasing and downsampling.Also is downsampling and undersampling the same ?Thanks in advance :)


texts:
I'm trying to understand how the encoding of a I and P Frame works.
The I frame is just encoded like a JPEG image.
I'v read that for the P-Frame we need to calculate some motion vectors, apply it to the reference image and calculate the difference between the target and the reference image.
Why do we need such motion vectors? Why can't we just take the difference of the I Frame and the B Frame and encrypt it?
Thanks


texts: What is the best feature selection method when working with audio and a binary output?

texts: I am working on a problem as I am trying to determine which is the best feature to use when working with audio.  I have a piece of audio and I am trying to determine which is the best feature to use when detecting a clap.  I am extracting multiple features such as spectral centroid, spectral flux etc and and I want to compare them to my labelled data. My output is binary which means that either there is a clap or there isn't.  They are represented buy either a 0 or a 1.  My feature data is continuous. I have made a diagram to show better what I am trying to explain. I need a mathematical proof that Feature A ranks better than Feature B.


texts: How to Estimate the Noise of an Image / Estimation of the Noise in an Image?

texts:
I want to know how to estimate the noise of an image?
Also is this represent the camera's noise?
Does anyone know how to estimate the noise of an image or camera?
Update:
Especially, I want to know about the A, B, C from as following.
How Can I plot these A, B,C curve?
Also I want to know what is C. What does C mean?


texts: I was reading a research paper on companding schemes for non uniform quantisation. In paper one of the motivations for non-uniform quantisation is that distortion at larger amplitude values is less audible than distortion in lower amplitude values but I can find why this happens?


texts: Inverse Problem / Deconvolution with Pink Noise

texts:
Hi I dived somewhat into deconvolution of systems which can be described as:

$s(t) = o(t) * h(t) + n(t)$

where $s$ is my measured 1D time resolved signal, $o$ is the original signal $h$ is the kernel or PSF pf my system, which is convolved with the original signal (with $*$ beeing the convolution operator), $n$ as sample-function for $1/f^\alpha$ noise ($\alpha > 0$).

For all I know there are several methods to deconvolve for an estimate of o. When choosing the correct method, the consideration of the noise is important. E.g. I should use the wiener deconvolution for systems with white noise, lucy-richardson for possion noise.

Which method should I use for pink noise (given the fact that there are several other (read: deeper mathematical) aspect which should be taken into account)?

On a side note: any recomendations for Papers/Books on this topic (Deconvolution of systems as described)? Thanks in advance!

Edit:
For the system I know an estimate of the kernel function $h$ and I can make blank meassurements to estimate the nature of the nois sample function (it ssemst to be white noise for small freqencies and pink noise for higher freqencies).


texts: What are the fundamental differences between speech and music in frequency domain?

texts:
What are the fundamental differences between speech and music in the frequency domain?
I can think mainly of features in the time domain that can differentiate speech from music signals, e.g. short silences [Wolfe2002Speech].
Maybe fundamental frequency could be used for distinguishing speech from music? If yes then what would be typical ranges of $F_0$ for speech and music?


texts: Compute SQNR (Signal to Quantization Noise Ratio)

texts:
I'm studying the quantization of an audio signal and in particular the SQNR (Signal to Quantization Noise Ratio).

The book on which the study says that:

where:

N is the number of bits in the digital representation
V indicates that the signal voltage varies between -V and +V.

I don't understand how these calculations were carried out.
Is SQNR not simply the "digital" version of the RMS?
I know the RMS is calculated as power signal divided by power error, am I wrong?


texts: How can I filter a noise with pattern type in audio?

texts:
I have a set of audio files rescued from a source of phonograph record like a gramophone. Very old family stuff records from my elders back in year 1946. A relative has digitalized these with a turntable and gave the records to me in lossless WAV Format. The audios are just conversations of my relatives in cotidiane situations. So it is just vocals materials but mixed with a heavy quantity of noise. Noise is mostly concentrated in the mid-high frequencies, like 1Khz-10Khz.

So the records are VERY noisy. SNR is like 0dB or worst. My mission is to filter out the noise.

One advantage is that noise exhibits a cyclical pattern. I tried some classic vinyl restoration stuff like decracking o declicking with Sound Forge, DART 24 Pro. Results were unsuccessful. The best result I had is the "Noise reduction" effect in Audacity, which did output relatively good. But this last one just filters the frequencies where the noise is with narrow FFT. So the vocals content loses the high-mid frequencies. Leaving only mid or mid-bass content. The noise got down but voices are unintelligible.

So I think perhaps I could turn to a Artificial Intelligence solution?. but I have no clue from where can I start. I have some understading of theory of AI, the Perceptron, neural networks, Backpropagation, but I never applied them to audio. Perhaps a Convolution Neural network could be a solution, but how could I train it?. If helps, I have programming skills in C# and knowledge about digital linear filters like IIR and FIR. But equalization based solutions *are not, what I need *.

Below I offer an example track for your consideration.

Audio track for example

What can I do for filter this kind of cyclical pattern noise?


texts: How to calculate energy of an OFDM signal?

texts: What is the difference between power and energy of OFDM signal. How to calculate energy of an OFDM signal, if we consider OFDM symbol size is 64, and QPSK is used as modulation scheme?


texts: Alternating sign after Discrete Fourier transform

texts:
Let me start by saying that this question is motivated by data analysis that I am doing. Its part of a much larger set of signal processing operations, but in order to keep the question contained I'll talk only about what (to my best knowledge) is relevant.

The scenario is as follows: we start from some discrete dataset $u$ of size $N$ in the time domain, $u ={u_1,u_2,\dots,u_N}$. From observation one finds that this dataset has some special properties: every odd value is purely real, and every even value is purely imaginary. If I subsequently compute the discrete Fourier transform of this dataset given by $v ={v_1,v_2,\dots,v_N}$ where
\begin{equation}
v_s=\frac{1}{\sqrt{N}}\sum_{r=1}^{N}u_r\exp{\left[2\pi i (r-1)(s-1)/n\right]}
\end{equation}

I find that I obtain a curious result: the outcome $v$ is almost purely real, and the even and odd values alternate in sign: $\mathrm{sgn}{(v_s)}=-\mathrm{sgn}{(v_{s+1})}$. With this first part I mean that the real data is $\mathcal{O}(10^{-4})$ and the imaginary part is $\mathcal{O}(10^{-12})$; I'd say is purely from numerical errors.

However, it is this second aspect that is not obvious to me; why do the real values alternate in sign? For those who appreciate some visual aspects, the real part of the Fourier transform ($\mathrm{Re}(v)$) looks like this
. Note that the first quarter is a mirror image of the second, and the third of the fourth; this is a different point that is not entirely relevant.

Note that an answer could also definitely be that, given the above, there is no explanation. I am not posting the entire dataset as its rather large and makes the question messy, but perhaps I am missing a crucial ingredient. In that case I will edit it to make it more complete.


texts: Is fundamental frequency information present in speech-shaped white noise?

texts:
I am using a so-called speech-shaped stationary white noise, which means so much as a white noise that has been filtered to match the long-term spectrum of a female speaker. The way it was generated has been explained in Luts et al., (2014):

To generate the stationary speech-weighted noise the long-term average speech spectrum (LTASS) of the 500 sentences was determined. For each sentence, silence parts were removed (frames of 20 ms with RMS < 0.001) and the spectrum was calculated with a 4096-points fast Fourier transform using a rectangular window and without overlap. These spectra were then averaged, applying a weight according to the length of each sentence. For this LTASS, a 2048-taps finite impulse response filter was generated and applied on an 11 seconds long white noise.

The original speech used has a fundamental frequency of about 220 Hz, as determined in 'Praat', which makes total sense. 'Praat'analyzes speech by first determining the formants (if I'm right), then it runs an FFT on these window, then looks for the 1st harmonic and call that the F0. However, when I run the speech-shaped stationary noise through Praat, it also recognizes an F0 of about 240 Hz, close to the original speech signal. However,there are no formants in this noise, so I am at a loss here. I thought speech-shaped stationary noise cannot contain harmonic, despite the fact its overall frequency spectrum matches that of speech?
Can speech-shaped stationary white noise contain an F0, or harmonics at all for that matter?


texts:
I have a filter response in the $z$-domain.
$$H_0(z) = 2 + 6z^{−1} + z^{−2} + 5z^{−3} + z^{−5}$$
How do I implement this filter on MATLAB?
I can do this if I have the coefficients but I do not know how to get them.


texts: Removing high pitch noise embedded in audio spectrum

texts:
I have an audio clip. Here is the clip in wave format

https://www.dropbox.com/s/542jgpfk7bfkt01/sample.wav?dl=0

I chose the following area of time domain signal

The spectrum of this signal shows maximum content at 2371 Hz which is inside voice band.

I applied notch on this frequency but i can still hear this noise.

Can any body tell how to remove it completely so that it is not hearable?
same is what i want with noise in beginning of clip.

It will be bonus for me if someone can tell why this high pitch noise occur in audio?
I will be interested in knowing DSP techniques which I can apply in MATLAB rather than sound processing software.


texts: Upsample / Downsample a Signal from 1920.93Hz to 1920Hz

texts:
I've just learned that the A/D converter I am using is not sampling at my desired sampling rate.  I request 20 seconds of data at 1920Hz and I receive 38400 points of data that were actually sampled at 1920.93Hz.

So for example, if I sample a 30Hz sine wave and chop the signal up into 300 sections, the phase of the sine wave in section 1 differs from the sine wave in section 300.  If my sampling rate was 1920Hz, as expected, the phase of each section would line up perfectly.

Now, to correct for this, is there any way of processing the signal such that it appears as if it was sampled at the correct sampling rate through interpolation or other means?


texts: Does every 8 by 8 DCT matrix have a valid (in range) IDCT?

texts: For a given quantization level of JPEG compression, are all possible DCT matrices have valid IDCTs. By valid, I mean matrices whose elements are in the range [0,255] ?


texts: what is the best way of sampling an exponential decay?

texts:
Some signal is decribed by a formula

$$S(t)=S_0 e^{-tC}\text.$$

I have given $t_\text{min},t_\text{max}$ and number of points. What is the optimal way of sampling such a signal? How to choose the proper values of $t$?


texts: Why doesn't JPEG use 1D DCT for image compression?

texts: I know that JPEG uses 2D dct and splits the images in 8x8 blocks. Why doesn't it simply split the image in one-dimensional vectors in $\mathbb{R}^{64}$? Wouldn't it simplify the math? My guess is that this way doesn't take advantage of pixel correlation. Is this right or is there any other reason?


texts: Making images taken under daylight conditions appear as if they were taken at night using image processing elementary techniques

texts:
I know that these days' style-transfer GANs should be able to style-transfer day images into night images. I however prefer to do it using a set of elementary image processing manipulations, so I can control their random parameter ranges.

I have a small dataset of images taken at night, which are very hard to train on with transfer-learning from an ImageNet pre-trained network. This is kind of making sense, as ImageNet images are usually taken in daylight conditions.

I therefore want to try to create a "night version" of ImageNet, by applying elementary image-processing manipulations on it (e.g., adding noise, shrinking the color histogram and reducing its mean, etc.). That way, I hope I will be able to train a network that will be useful for transfer-learning on night images.

Are there known algorithms/methods for doing that daylight->night conversion using image processing?


texts: Sampling and reconstruction of signal in Matlab

texts:
I'm trying to write a program in Matlab that samples (using Nyquist theorem) and recovers signal. I got stucked on recovery part...recovery signal doesn't match with the original one (see photo).

And I have to make graph that shows every sinc separately (before the sum) like on photo. Also I have to use formula from photo.

This is my code:

clear; clc;
subplot(3,1,1);
f = 30e3;
fs = 2 * f;
Ts = 1/fs;
t1 = 0:1e-7:5/f;
x1 = cos(2 * pi * f * t1);
plot(t1,x1);
hold on;
t2 = 0:Ts:5/f;
x2 = cos(2 * pi * f * t2);
stem(t2,x2);
xlabel('Time');
ylabel('Amplitude');
xr = zeros(length(t1));
for i=1:length(t1)
    for j=1:length(x2)
        xr(i)= xr(i) + x2(j)*sinc(2*fs*t1(i)-j);
    end
end
plot(t1,xr);
xlabel('Time');
ylabel('Amplitude');
legend('x(t)','x(nT)','x_r(t)');

What I need to change and add?
Thanks in advance!


texts: What is the total impulse response in a system with feedback interconnection?

texts:
Let's assume that we have a system with a typical feedback interconnection where the output is given by the following equation:

$$y(t) = \left(x(t) - z(t)\right) \star h_{1}(t) \tag{1} $$

where:
$$z(t) = y(t) \star h_{2}(t) \tag{2}$$

So, is $h_{1}(t)$ the system's total impulse response or the convolution between $h_{1}(t)$ and $h_{2}(t)$ after replacing $z(t)$ in the equation $(1)$ while using the associative property?


texts: I have exposure to MATLAB and have some basic exposure to signal processing and plotting in MATLAB... but I am more comfortable with C/C++ than MATLAB because I have been working in Image processing with OpenCV... I was just curious: Is there any DSP library or platform (as OpenCV is for image processing) for doing signal processing in C/C++?


texts: Finding the wiggles pattern in the original dataset. (Wiggles appear after performing division by another dataset)

texts: I have multiple measurements regarding scientific observations. The problem is that there is a subtle noise pattern caused by the instrument - the wiggles. These wiggles are invisible when looking at the scientific data itself (plotting x vs y), but become clear when I divide one measurement by another taken at a later time (when the wiggle pattern between them changed/shifted). My goal is to correct the "wiggles" for each individual measurement. So far I've tried dividing the measurement by a shifted copy (no success, the data has too many features it seems) and to divide by a smooth function of the data (a kind of polynomial normalization, but no wiggles were found after).


texts: I'm a newbie at DSP. I am starting a hobbyist project where I plan to monitor 100's of wildlife radio collar frequencies (at my job) and record how many "beeps" per minute are received. My software budget is zero. I have been starting to learn GNU radio and I find most of the tutorials are from 2012 and the many of the blocks are no longer here or soon to be deprecated (WX GUI). Also notice it is not a common tag on Stackexchange. Is GNU Radio a good choice for me?


texts: How Come RIP Guarantees Unique Restoration of the Sparse Solution by $ {L}_{1} $ Minimization?

texts:
We have a sensing matrix $\Phi$, satisfying the restricted isometry property (RIP), and a sparse signal $x$. We want to recover $\hat x$ from the measurement $y=\Phi x$ by using $l_1$-minimization.

I am wondering about, how the RIP can guarantee the uniqueness of the recovered sparse vector solution $\hat x$.

On slide 4, at 01:15 minute, Mark Davenport says in his presentation about compressed sensing:

  The RIP is what we need to ensure, that this hyperplane is oriented in a way, that guarantees us, that there is actually only one sparse vector in this hyperplane. So we are going to be guaranteed to get the right answer.

But why is that? I do not see that the RIP can guarantee this.

For example, consider this picture below. It's a slide from the linked presentation. The blue hyperplane also intersects at least one other axis. How can we be sure, that this other sparse vector isn't the actual solution, i.e. was our formler signal $x$?


texts: How to do the Fourier Transform of bounded function?

texts:
I was trying to solve a Fourier transform of a function using the properties of Fourier transforms. The function is given as:

$\frac{At}{2}$ for $-2<t<2$ and $0$ for all other $t$. Doing the integral from the definition of of a Fourier transform gives the result: -$Ai\left(\frac{\sin(2\omega)-2\omega\cos(2\omega)}{\omega^2}\right)$. While when I try to do it with derivative property of Fourier transforms I get a different answer as $\frac{2A\sin(2\omega)}{2i\omega^2}$.

The idea is that I express the above bounded function as the product of the function with a rectangular pulse that has a period of 4. Like this: $\frac{At}{2}p(t)$. Then I take the derivative of this as just $\frac{A}{2}p(t)$ and then take the Fourier Transform of $\frac{A}{2}p(t)$. For the Fourier transform of the main function I simply divide by $iw$.

The two results are completely different from each other. What's wrong with taking my approach?

P.S I am sorry for not being able to write the formulas in a very mathematical manner.


texts: Why does a narrower window in a Fourier transform or STFT give poor frequency resolution?

texts:
In theory of FT(Fourier transform) and STFT(Short Time Fourier Transform) it is said that
"A wide window gives better frequency resolution but poor time resolution. A narrower window gives good time resolution but poor frequency resolution"

Can somebody explain why a narrower window gives poor frequency resolution?


texts:
I am new to signal processing, and I am a bit confused by the use of coherence in academic literature. In several articles in neuroscience, coherence between signals (eg. EEG signals) is determined at a very high temporal resolution. See for an example this figure, from Bosman et al, 2012:

That article refers to the 'Communcation through coherence' theory from Fries, who describes coherence as:

"the pattern of phase-locking among oscillations in the
communicating neuronal groups."

Bosman further states, it its experimental procedures:

" Spectral power, coherence, and GC influences were estimated by applying
a fast Fourier transform (FFT) after multitapering (Mitra and Pesaran, 1999)
with seven tapers. Given epoch lengths of 0.5 s, this resulted in a spectral
smoothing of ±7 Hz. The resulting spectra are shown from 8 Hz to 140 Hz.
We performed a separate analysis of the lower frequencies (4 Hz to 28 Hz),
in which the same 0.5 s data epochs were Hanning tapered."

So if I understand it correctly, coherence is determined by looking at the stability of the phase difference between two signals over several tapers. But how can one then obtain values for the coherence at such high temporal resolutions? For each value, you would require several tapers; if I understand the description by Bosman correctly, this would result in a single value for coherence for each epoch of 0.5 seconds?

References:

Bosman, C. A., Schoffelen, J. M., Brunet, N., Oostenveld, R., Bastos, A. M., Womelsdorf, T., ... & Fries, P. (2012). Attentional stimulus selection through selective synchronization between monkey visual areas. Neuron, 75(5), 875-888.

Fries, P. (2005). A mechanism for cognitive dynamics: neuronal communication through neuronal coherence. Trends in cognitive sciences, 9(10), 474-480.


texts: Are there any general heuristics for Kalman filter noise parameters

texts: Are there any generally applicable heuristics for Kalman filter noise parameters? I am working with a non-linear unscented filter and getting an initial guess for the noise covariances $Q_k$ and $R_k$ is proving difficult as wikipedia cautions. Specifically I am wondering if the condition number of the innovation covariance $S_k$ should be below some value? Alternatively in a well running filter, should each element in the optimal Kalman gain $K_k$ be in some range? Is there some other rule of thumb that would help quickly guide me towards a "sane" filter so I can use other optimization techniques to fine tune the parameters? Thank you.


texts: What is the preferred way to regularly space data?

texts:
I have some data that was collected at irregular intervals, and I want to estimate the values on a regularly spaced time grid, so that I can take FFTs etc. I've not had to do this much before, and I'm wondering if there is an "industry standard" or best algorithm to use? I'm currently using the Matlab function pchip, but that's only because that's the first function I found.

Does it matter how my data is distributed, or is there a one size fits all function?


texts: What does the exponential term in the Fourier transform mean?

texts:
We know that Fourier transform $F(\omega)$ of function $f(t)$ is summation from $-\infty$ to $+\infty$ product of $f(t)$ and $e^{-j \omega t}$:

$$ F(\omega) = \int\limits_{-\infty}^{+\infty} f(t) \ e^{-j \omega t} \ dt  $$

Here, what does the exponential term mean?


texts: Periodicity of discrete time signal: $ x\left [ n \right ] = \cos (\frac{\pi n^{2}}{8}) $

texts:
I need to find the periodicity of the following signal:

$$ x\left [ n \right ] = \cos \left(\frac{\pi n^{2}}{8}\right) $$

Now I understand that the basic procedure to determine the periodicity is to find a $ N $ such that $$ x\left [ n \right ] = x\left [ n + N\right ] $$

I applied the procedure to the aforementioned signal and got the following results:
$$
\begin{aligned}
x\left[ n\right] &= \cos \left(\frac{\pi n^{2}}{8}\right) \\
x\left[ n + N\right] &= \cos \left(\frac{\pi (n + N)^{2}}{8}\right)\\
&= \cos \left(\frac{\pi (n^{2} + 2nN + N^{2})}{8}\right)\\
&= \Re \left \{\exp \left(i \frac{\pi (n^{2} + 2nN + N^{2})}{8}\right)  \right \}\\
&= \Re \left \{\exp \left(i \frac{\pi n^{2}}{8}\right)\exp \left(i \frac{\pi 2nN}{8}\right)\exp \left(i \frac{\pi N^{2}}{8}\right)  \right \}
\end{aligned}
$$
Now for the signal to conform to $ x\left [ n \right ] = x\left [ n + N\right ]$:
$$
\Re \left \{\exp \left(i \frac{\pi 2nN}{8}\right)\exp \left(i \frac{\pi N^{2}}{8}\right)  \right \} = 1
$$
$ \exp(i\omega) = 1 $ only when $ \omega = 2\pi k $ where $k$ is an integer. Hence:
$$
\frac{\pi 2nN}{8} = \frac{\pi N^{2}}{8} = 2\pi k
$$
Now logically I can see that if $ N = 8 $ the first term would be reduced to a multiple of $ 2\pi $ for all $ n $ and hence the fundamental period would be $ N = 8 $ but how would I go about proving this mathematically, that the minimum period is indeed 8? like what set of operations would I perform on:
$$
\frac{\pi 2nN}{8} = \frac{\pi N^{2}}{8} = 2\pi k
$$
to obtain $ N = 8 $?


texts: Image Processing Prior to Feature Detection

texts:
I have implemented a feature detector based on Harris corners. It works fine most times, but there are cases where it performs poorly. I need to make it work on many different images without configuring it individually.

The problem is with the detector threshold value. If set too low, the detector fires too many times resulting in huge number of features. If set too high, there are too less features.

I have partially resolved this by ANMS (Adaptive Non-Maximal Suppression) to reduce number of features before assigning a descriptor vectors to them.

However, images like this one are the problem:

They have low contrast and I cannot "afford" setting threshold too low for all images. It would cause detector to work on these images, but other images would contain hundreths of thousands of features, which will be slow to filter with ANMS and this will harm overall performance.

I was thinking of adjusting the image before feature detection. Maybe histogram equalization would do the job. This may be a valid operation since global change of contrast have no effect on feature descriptors (they are invariant to change in brightness and contrast).

Maybe working with adaptive threshold or some heuristic would work better.

Any other suggestions?


texts:
I've had the basics of signal in university but little real-life practice. I've got an acceleration sensor with a digital output signal (signed 16 bit value). This signal is a little noisy. The standard deviation is about 20 (referenced to the full 2¹⁶-1 scale of the sensor).

On the hardware I have, there are two of these sensors present. Is it somehow possible to merge the signals of both sensors, in order to reduce the noise?

The reason I'm asking this is because the noise of the two sensors should be uncorrelated (at least in theory) whereas the acceleration signal is correlated. Is there a way to reduce the noise?


texts:
I have an formula for this "Maximum Quantization Error" but i dont know what it is based in. Its just thrown in my study material without further explanation.

It is defined as:

$$Q = \dfrac {\Delta x}{2^{N+1}}$$

where $N$ is the number of bits used for quantization in a analog to digital conversion, and $\Delta x$ is, in portuguese "Faixa de Excursão do Sinal", I don't know what would be the correct translation, but I bet on something like "Signal Excursion Band". I know, its a strange name.

Can someone help me with this? What is this $\Delta x$?
Sorry for my bad english, it isnt my native language.


texts:
In visual bag of words model, I have been able to construct the visual codebook through kmeans clustering of SIFT descriptors. How to calculate the feature vector for an image then?

P/S:

For each image, we can find interesting SIFT points, and for each points we have a SIFT descriptor (which is usually a 128 length vector).

im1 ==> SIFT feature f1 (10 by 128) (here 10 is an abitrary number)
im2 ==> SIFT feature f2 (20 by 128)
...

If we combine all SIFT features, f=[f1; f2; ..] and perform kmeans clustering we will get the codebook c=[c1; c2; .. c10] which is bow codebooks.

From the codebook how can we find the feature vectore, represent image im1?


texts: Continuous-time frequency response question

texts:
Suppose the CTFT of continuous-time input $x_c(t)$ to an LTI system is $X_c(j\Omega)$ and that of its continuous-time output $y_c(t)$ is $Y_c(j\Omega)$. We have,
$$X_c(j\Omega) = 0,\phantom{1}\text{for } |\Omega| \ge \frac{\pi}{T_1}$$.

The LTI system samples the signal (C/D operation at sampling rate $1/T_1$) and passes it through the discrete-time system with response $H(e^{j\omega})$. The result of this DT system is then passed through an ideal D/C system (operating at rate $\frac{1}{T_2} = \frac{1}{2T_1}$) to yield $Y_c(j\Omega)$.

I want to find out the overall frequency response of the system. I can write

$$Y_c(j\Omega) = \begin{cases}\frac{T_2}{T_1} H(e^{j\Omega T_2})X_c\left(j\Omega \frac{T_2}{T_1}\right),\phantom{1}\text{for } |\Omega| < \frac{\pi}{T_2}\\0,\phantom{1}\text{for } |\Omega| \ge \frac{\pi}{T_2}\end{cases}$$

Since I get $X_c\left(j\Omega \frac{T_2}{T_1}\right)$ in the above expression and not $X_c\left(j\Omega \right)$, I am not sure how to find the overall frequency response. Is it possible to express $X_c\left(j\Omega \frac{T_2}{T_1}\right)$ in terms of $X_c\left(j\Omega \right)$ using some continuous-time filter?


texts: Advantage of using DFT and IDFT hardware for modulation

texts: I am doing a course in communications and while discussing multicaruer modulation to break down a signal into smaller bandwidths (for BW to be less than coherence bandwidth), there was mention of transforming the signal to frequeny domain before transmission. Logically, that doesn't seem to be useful to me as the hardware doesn't help us. The transmitted signals would get convoluted/multiplied as per the impulse response of the channel either ways and I can't seem to understand why a frequency domain transformation would help us. Is it something to do with reading the data for ourselves? Or does it improve SNR and SINR(Signal to noise ratio)?


texts: how to visualize image segmentation using matlab

texts:
After clustering in image, I want to visualize the result. To do so, I first reshape an RGB image to 3*size.

The result of BSMC is the set of indices after clustering. So I change the value at the pixel. But the result is not what I wanted.

How to show correctly segmentation result?

X = imread('image3.jpg');
%X = imresize(X, 0.2);
[height width depth] = size(X);
X = reshape(X, [depth height*width]);
X = double(X);
ppp = BSMC(X);
ppp = ppp.partition;

ppp = BSMC(X, 'initial_partition', ppp);
ppp = ppp.partition;

for (i = 1:size(ppp, 2) )
    color = zeros(3, 1);
    color(1) = randi([0,255]);
    color(2) = randi([0,255]);
    color(3) = randi([0,255]);

    for (j = 1:size(ppp(i).indices, 2) )
        X(:, ppp(i).indices(j) ) = color;
    end
end

X = reshape(X, [height width depth]);
X = uint8(X);
figure;
imshow(X);


texts: Any Good Image Blind Deconvolution Algorithm for Removing Camera Shake

texts:
I am working in digital image restoration field, i have images that are degraded by camera shake.. can anyone please suggest me any better non blind deconvolution algorithm.

my images are similar to This Blurry Photo from Camera Shake...

I have already checked some of the Blind Deconvolution algorithms such as Dilip Krishnan and others, but these algorithms are not producing DESIRED result on my highly blurred images.


texts:
Currently I am developing a pedestrian counter project (using OpenCV+QT on Linux). My idea about the approach is:

Capture Frames
Do Background Subtraction
clear noises (erode, dilate)
find blobs (cvBlobslib) - foreground objects
For each blob, set ROI and search for pedestrians (LBP with detectMultiScale) in these blobs (for better performance)
For each found pedestrian do a nested upper body search(Not sure) (better reliability)
If same pedestrian is found on continuing frames (3-4 frames maybe) - add that area to camshift and track - mark as pedestrian
Exclude camshift tracked areas from blob detection for next frames
If a pedestrian crosses a line increment number

I want to check if I am on the right track. Do you have any suggestions on how to improve my approach? If somebody worked on something similar, I would appreciate any useful tips, resources (and criticisms) on this problem.


texts:
I use the following code to calculate the fft of 1024 samples of a 200 Hz windowed sinusoid (code taken from aurio touch apple example app):

//take fft
vDSP_ctoz((DSPComplex *)input.data(), 2, &inputComplex, 1, mFftSize);
vDSP_fft_zrop(fftSetup, &inputComplex, 1, &output.complex, 1, log2n, FFT_FORWARD);

//scale
float scale = 0.5 / mSize;
vDSP_vsmul(output.complex.realp, 1, &scale, output.complex.realp, 1, mFftSize);
vDSP_vsmul(output.complex.imagp, 1, &scale, output.complex.imagp, 1, mFftSize);
output.complex.imagp[0] = 0.0;

//Convert the fft data to dB
//memset(output.mMagnitude, 0, sizeof(float) * mFftSize);
vDSP_zvmags(&output.complex, 1, output.mMagnitude, 1, mFftSize);

//In order to avoid taking log10 of zero, an adjusting factor is added in to make the minimum value equal -128dB
//memset(output.mDecibel, 0, sizeof(float) * mFftSize);
vDSP_vsadd(output.mMagnitude, 1, &kAdjust0DB, output.mDecibel, 1, mFftSize);
Float32 one = 1;
vDSP_vdbcon(output.mDecibel, 1, &one, output.mDecibel, 1, mFftSize, 0);

Taking the inverse fft results in the initial windowed waveform as expected. What's bothering me are the values in output.mMagnitude, I would expect it to be close to 1 at the 200 Hz bin, yet it's barely above 0. What am I missing here?

My windowed sine (1024 samples range -1 to 1 at 200 Hz)

Magnitude spectrum (512 bins from 0 to 1, all there is is this tiny bump at the 200Hz bin)

DB spectrum (-128 to 0, this seems appropriate)


texts: How to create a sine wave that transitions through frequencies and returns to phase

texts:
For an auditory psychological experiment, I need to create a sine wave, such that at a given point the frequency of the wave will rise smoothly, and descend back to base frequency. I need it to return in phase with a second sine wave which is a continuous sine wave of the base frequency:

ie: one ear will get a continuous 300 Hz sine wave,
    the other will get a 300 Hz sine wave, that rises to 305 for a short while, and descends back to 300 Hz in phase with the second ear.

I generated the frequency modulation with a complex phasor recursion, as suggested here: https://dsp.stackexchange.com/a/1087/18658

ie, each point in the sine wave is given by

z(n+1) = z(n) * exp(j* 2pi* frequency).

The parameter I can play with is the length of modulation. Any ideas about how to find the nearest length that gives me the in-phase return?


texts:
I have been trying to implement the Cramér-Rao lower bound from the paper - A reference-free time difference of arrival source localization using a passive sensor array (eq. 6 and eq. 7).

$$
\eqalignno{ &{\rm cov}(\hat{d}_{m,n},\hat{d}_{m,n}) \,\,=\,\, {3c^2\over \pi^{2}N\kappa^{2}}{\rho_{m}\rho_{n}\over {\rm SNR}}\left(2+{\rho_{m}\rho_{n}\over{\rm SNR}}\right)&\hbox{(6)}\cr &{\rm cov}(\hat{d}_{i,j},\hat{d}_{k,\ell})\,\,=\,\, {3c^2 \over \pi^{2}N\kappa^{2}}{\rho_{i}\rho_{j}\rho_{k}\rho_{l}\over {\rm SNR}^{2}}\phi_{i,j,k,l}&\hbox{(7)}}
$$

As can be seen the bound is dependent on length of the signal.

Whats the ideal value one must take for the length of the signal?

The bound was derived assuming that $N$(length) tends to infinity (reference 8).

So are we supposed to take huge value for $N$ like $10^{21}$?


texts: Determining Frequency and Period of a wave

texts:
I'm gathering temperature data from a refrigerator.  The data looks like a wave.  I would like to determine the period and frequency of the wave (so that I can measure if modifications to the refrigerator have any effect).

I'm using R, and I think I need to use an FFT on the data, but I'm not sure where to go from there.  I'm very new to R and signal analysis, so any help would be greatly appreciated!

Here is the wave I'm producing:

Here is my R code so far:

require(graphics)
library(DBI)
library(RSQLite)

drv <- dbDriver("SQLite")
conn <- dbConnect(drv, dbname = "s.sqlite3")

query <- function(con, query) {
  rs <- dbSendQuery(con, query)
  data <- fetch(rs, n = -1)
  dbClearResult(rs)
  data
}

box <- query(conn, "
SELECT id,
       humidity / 10.0 as humidity,
       temp / 10.0 as temp,
       ambient_temp / 10.0 as ambient_temp,
       ambient_humidity / 10.0 as ambient_humidity,
       created_at
FROM measurements ORDER BY id DESC LIMIT 3600
")

box$x <- as.POSIXct(box$created_at, tz = "UTC")

box$x_n <- box$temp - mean(box$temp)
png(filename = "normalized.png", height = 750, width = 1000, bg = "white")
plot(box$x, box$x_n, type="l")

# Pad the de-meaned signal so the length is 10 * 3600
N_fft  <- 3600 * 10
padded <- c(box$x_n, seq(0, 0, length= (N_fft - length(box$x_n))))
X_f    <- fft(padded)
PSD    <- 10 * log10(abs(X_f) ** 2)

png(filename = "PSD.png", height = 750, width = 1000, bg = "white")
plot(PSD, type="line")

zoom <- PSD[1:300]

png(filename = "zoom.png", height = 750, width = 1000, bg = "white")
plot(zoom, type="l")

# Find the index with the highest point on the left half
index <- which(PSD == max(PSD[1:length(PSD) / 2]))

# Mark it in green on the zoomed in graph
abline(v = index, col="green")

f_s     <- 0.5 # sample rate in Hz
wave_hz <- index * (f_s / N_fft)
print(1 / (wave_hz * 60))

I've posted the R code along with the SQLite database here.

Here is a plot of the normalized graph (with the mean removed):

So far, so good.  Here is the spectral density plot:

Then we zoom in on the left side of the plot and mark the highest index (which is 70) with a green line:

Finally we calculate the frequency of the wave.  This wave is very slow, so we convert it to minutes per cycle, and print out that value which is 17.14286.

Here is my data in tab delimited format if anyone else wants to try.

Thanks for the help!  This problem was hard (for me) but I had a great time!


texts:
Given a million data points in say 100d,
is there a way to generate an optimal filter bank of say 20 filters
from an SVD of the data ?
Call the 100d space $F$ (as in Frequency), with coordinates $[f_1, f_2 ... f_{100}]$.
There are many bases $V_i$ of $F$,
that split the 1M $\times$ 100 data array
$ A \approx \sum_{i=1}^{100} d_i U_i  \otimes V_i $
where the $d_i$ are scalars $d_1 \ge d_2\ ...\ \ge 0$,
the $U_i$ are 1M long, and the $V_i$ 100 long.
I have two goals:

the $d_i$ should be rapidly decreasing, so that 20 terms approximate $A$ reasonably well
for a filter bank, I want a local basis,
with each $V_i$ zero outside some interval $[f_a, f_b]$

How can I optimize  both together ?
The problem is that SVD has no notion of locality in $F$.
And one can optimize a filter bank with a given local basis,
such as overlapping triangles in MFCC, but I see no connection to SVD.

Edit 12 Jan: SVD and filter banks / local overlapping bases / dictionaries seem to me quite different:
$\qquad$ SVD: orthogonal, fast and easy, very dependent on data and noise
$\qquad$ local: many possibilities / objectives, robust.
Nonetheless it would be nice if one could use SVD/PCA to
improve a given filter bank / local basis.


texts: Plot the magnitude of coefficients against frequencies of DCT transform

texts:
When we perform DCT transform using matlab:

 number_of_sample_data = 100;
 f=0.1; %frequency
 fs=1; %sampling rate
 phi_0=0
 t=0:1/fs:((number_of_sample_data-1)*1/fs); %generate 100 samples
 x=sin(2*pi*f*t+phi_0);
dct_transform=dct(x); %perform discrete cosine transform
figure(1), stem(dct_transform);

this piece of code will plot the magnitude of coefficients against frequencies or something else?


texts: Analyzing audio by looking at its time-frequency points in real- imaginary plane

texts:
I am performing Short-time Fourier transform on an audio signal (I dont know how to attach the audio file here). The sound was recorded in anechoic chamber and the source is supposed to come from left. Lets say the result of STFT has 'N' number of time frames and 'nfft' FFT coefficients. My goal is to look at the plurality of time-frequency points in a certain frequency band over a plurality of time frames, graphically represented in real and imaginary parts in the complex plane. This is the code:

[x, fs] = audioread('booth.wav');   % load a .wav file x1 = x(:,1);
                                    %left ear

                          % bandpass filter to work on good frequencies only:
fc=[300 500]; %because my signal's frequency is in this range
[b,a] =butter(4,fc/(fs/2),'bandpass'); % Butterworth filter of order 4

x1 = filter(b,a,x1);

                                      %perform STFT:
x=x1(:);  %make sure it's column
xlen=length(x); %length of signal
wlen=2^nextpow2(0.04*fs);  %window length
hop=(3/4)*wlen;       %hop size
numFrames=1 + fix((xlen - wlen)/hop); %number of frames
nfft=2^nextpow2(wlen);

if mod(nfft,2)==0        %even
  N=nfft/2+1;
elseif mod(nfft,2)==1    %odd
  N=(nfft+1)/2;
end

window=hamming(wlen,'periodic'); %hamming window
Sl = zeros(numFrames,N); %preallocate stft for left ear
indx=0;

for i=1:numFrames
  xw=x(indx+1:indx+wlen).*window;   %multiplying signal to window
  X=(fft(xw,nfft))./wlen;  %fourier transform
  Sl(i,:)=X(1:N);    %keep half of it
  indx=indx+hop;   %hop and go to next time frame
end

f=(0:N-1)*fs/nfft;  %frequency vector
                    %correcting DC and Nyquist
if rem(nfft, 2)
  Sl(2:end, :) = Sl(2:end, :).*2;
else
  Sl(2:end-1, :) = Sl(2:end-1, :).*2;
end

                                %Now plotting the points:
figure(1);
hold on;
grid on;
for j=150:447   %I just want to look at these frequency indices
  plot(real(Sl(:,j)),imag(Sl(:,j)),'Ob');
  title(['F=', num2str(f(j)), ' hz'])
  xlabel('real'); ylabel('imaginary');
  axis([-1 1 -1 1]);
  plot(-1:1,[0,0,0],'k', 'LineWidth', 1);
  plot([0,0,0],-1:1,'k','LineWidth',1)
  pause;
end

If I look at the points at a frequency that I know my fft should have value at it, the points all fall on zero in the complex plane (if not on zero,very close to it). Why?
I tried doing RMS normalization, but the points now are not in the [-1 1] range in complex plane and they are all over the place! I am not sure if I can do something like peak normalization and Rms normalization together?


texts: Examples of Causal and Complex Wavelets?

texts:
I'm looking for wavelets that are both:

causal (a wavelet coefficient $W(j,k)$, where $j$ is scale and $k$ is translation, does not use data from $t > k$ to be estimated).
complex (such as the Morlet wavelet, to analyze phase differences between two time-series).

Do any exist?


texts: How to interpret output of matched filter with complex input?

texts:
I have implemented a matched filter based on the Fourier Transform approach. In the real numbers domain that means that I use as the coefficients of my filter (B) the inverted time-samples of the signal that I'm trying to find and I compute:

real_output = IFFT(FFT(A).*FFT(B))

Where, if we assume the moment of exact match, A is an input signal of real value samples and B is the signal made from inverted time-samples of A (or I can also conjugate the spectrum of B and I get the required time inversion because the signal is real). In order to avoid aliasing I perform both FFT with length(A)+length(B)-1 samples.
The output of this filter is always real and its maximum, points at the moment in which a match has occurred.

Now assume that instead of a real valued A we have a complex valued A. My questions are:

Is it possible to apply a matched filter for complex domain signals?
Would I have to invert the complex valued A to get the coefficients of my filter or should I do something else like conjugating them?
How do I interpret the output of the filter, should I say a match happens if the absolute value of the output is maximum or just when the real part is maximized?
In some experiments I have noticed that at the moment of a match the output of the filter is real if spectrum(B) is the complex conjugate of spectrum(A), is this correct?


texts:
The main reason why we use the Direct conversion receiver with zero IF is that we don't have to deal with the problem of images. For achieving zero IF we need to ensure that the receiver Local Oscillator (LO) is working at the same frequency as the carrier. But I was wondering if there is an offset between the carrier and the receiver oscillator (due to reference mismatch or Doppler shift etc.) do we still have the image problem?
For instance, if the offset is equal to the channel spacing $f_{off} = f_{ch}$, then both the $f_c \pm f_{ch}$ fall at $f_{off}$ after  downconversion mixer. Basically, the offset acting as an IF.
If so, do we still need image reject filters for direct conversion architecture and what then is the benefit of direct conversion architecture.

What I mean is explained in the figure below. We have a carrier frequency $f_c$ but due to some offset we send our data at $f_c+\Delta f_c$. Some other user is sending his data at $f_c - \Delta f_c$ (the image sideband). But after demodulation both the desired and undesired signal components fall back at $\Delta f$


texts: What will the impulse response of a matched filter look like if the input is complex?

texts:
If $h(t)$ is the impulse response of a filter matched to a signal $s(t)$, I read that $h(t) = ks(t_o - t)$.

But what if the signal is complex? I went through the derivation of the matched filter and saw that just like how the inner product of two vectors is maximum if the vectors are "parallel". I think $H(\omega)$ has to be proportional to $S^*(\omega)e^{-\omega t_0}$ for the SNR to be maximized. This is a generalization of the Cauchy–Schwarz inequality that I don't fully understand.

So from this we can say, $H(\omega) = S^*(\omega)e^{-\omega t_0}$

To get RHS,

frequency shifting,
$$s(t-t_o) \iff e^{-j\omega t_0}S(\omega)$$

taking conjugate on both sides,
$$s^*(t-t_o) \iff e^{j\omega t_0}S^*(-\omega)$$

scaling with $-1$,
$$s^*(t_o-t) \iff e^{-j\omega t_0}S^*(\omega)$$

So can I conclude $h(t) = s^*(t_o-t)$??

To apply this general formula to a specific example, consider this question from the 2013 exam of ISRO,

From what I learned, can I say that the answer is option D?

The impulse response for the given complex signal $s(t)$ is complex conjugate time reversal of $s(t)$, i.e. the real part of $s(t)$ simply gets time reversed (flips across y axis) so A B or D, while the imaginary part is flipped across both the y and x axis. C or D.

$$h(t) = s^*(t_o-t)$$

$$h(t) = (x(t_o-t)+iy(t_o-t))^*$$

$$h(t) = x(t_o-t)-iy(t_o-t)$$

So my question is, what is the impulse response of a matched filter if the input is complex and why? Like please point out any mistakes in my logic, I especially would love to gain some intuition on why $H(\omega)= kS^*(\omega)e^{-\omega t_0}$


texts: How to draw a smooth spectrum from a discrete array of measurements at selected frequencies?

texts:
I have a AS7265x triad spectroscopy sensor from SparkFun (link) which gives me measurements at 18 individual light wavelengths between 410nm and 940nm. The datasheet says that the FWHM of each sensor is 20nm.

How can I draw a smooth spectrum given these 18 numbers?

My approach so far is to use interpolation by radial basis functions. I tried gaussian functions with FWHM=20nm but this is what I get for an artificial signal with a constant spectrum of all ones:

I experimented with other radial basis functions and found that a multiquadric function gives me the best result. It produces a flat interpolation when each measurement is equal to one. However, it looks strange at frequencies below the lowest measured frequency and above the highest one:

I fix this by requiring the lines at both ends to decrease to zero as gaussians with FWHM=20nm and amplitudes equal to the values measured at 410nm and 940nm.

Also, sometimes this interpolation shows negative values, for example, when only a single measurement is one, and all other are zeros:

I fix it by simply putting the values of the spectrum to zero where it is negative.

I tested it with a few LEDs, and I am getting spectra from them that look realistic. However, I have a feeling that my approach has too many quick fixes. My code and LED spectra are here.

Is what I am doing an acceptable way to draw a spectrum from a limited number of sensors that don't densely cover the whole range of frequencies? If not, how to do it correctly?


texts: About Fourier transform of periodic signal

texts:
In Fourier transform for periodic signal, I checked different books and I found a different explanation in each book. Let's take the explanation in Signals and Systems by Rajeshwari & Rao:

  The resulting Fourier transform for a periodic signal consist of a train of impulses in frequency, with areas of impulses proportional to the Fourier series coefficients.

  To suggest the general result, let us consider $x(t)$ with Fourier transform $X(\omega)$ which is a single impulse of area $2\pi$ at $\omega=\omega_0$, that is,  $$X(\omega)=2\pi\delta(\omega-\omega_0)$$
  To determine $x(t)$ for which this is Fourier transform we can apply  the inverse Fourier transform to obtain
  $$ x(t) = \frac{1}{2\pi} \int_{-\infty}^{+\infty} 2\pi \delta(\omega-\omega_0)e^{j\omega t}d\omega$$

The things I want to ask is:

If we have Fourier series of a periodic signal which will be one impulse, then the Fourier transform of that impulse will be the same single impulse? That's what it is explained above?
Why we used shifted impulse? Why we can't take $\delta(\omega)$


texts:
According to my question about separability of Gabor filters in this link, I want now to convolve my image with this separable filter by using the normalized cross correlation operation. Assume my Gabor filter is G, my image is I. My Gabor is separated into Low-Pass gaussian filter f(x) and Band-Pass gaussian filter g(y). Therefore the image is convolved with the Gabor using the following equation:

I(x,y)*G(x,y) = (I(x,y)*f(x))*g(y).

But I want to achieve this separable convolution using the normalized cross-correlation operation described below:

Where ^G is the zero mean, unit normal version of the filter and H(x,y) represents a filter with all ones and the same size of the Gabor filter.

1) I didn't understand what is ^G. What should be its value? what it differs from G ?

2) How the normalized cross-correlation is computed for the separable Gabor? I don't know if I use correctly the formula: I(x,y)*f(x)*g(y) / I^2(x,y)*H(x,y) . I don't think that it's true. because I didn't understand what should be the value of zero mean, unit normal version of the Gabor.


texts:
I am using this class to filter EKG data.

My sampling rate is 167/s and the length of data is 1670 (10 seconds), when I apply the filter I get the correct results but looks like the number of samples i get back is bigger (I guess because of zero padding to become power of 2).

How can I get back only the samples I filtered? I tried to copy first 1670 samples from the filtered array but looks like it contains zeros as well.

Thanks


texts: Is there a recommended amount of attenuation for rectifying edge artefacts?

texts:
I just noticed that Spotify fades in/out the music when you play/pause - is this to avoid clicking?
This attenuation is noticeable; is there a minimum amount of attenuation required to fix clicking (while not introducing a noticeable fade). Also, is there a type of attenuation that's best, linear, parabolic, etc?
On youtube, there's no noticeable attenuation, yet there's no clicking; could this be very small attenuation?


texts: Wireless Body Area Networks with Minimum Energy Consumption

texts:
For adaptive compressive sensing(cs),the sensing matrix is related to the input signal.
For example, in rakeness-based(cs), the sensing matrix is obtained by solving an optimization problem which maximizes the correlation between the input signal and the sensing matrix,meanwhile minimizing the coherence between the columns of the sensing matrix.
I know that the operations at the sensing node should be minimized, to minimize the energy consumption.

Where is this optimization problem performed ? At the sensing node ?? If so, how can this rakeness- based approach implemented in a wireless body area network without consuming much energy??


texts: How is Linear Canonical Transform a generalization of Fractional Fourier Transform?

texts:
I have studied that Fourier transform changes the domain of a signal from time to frequency, and in that way it is a 90 degree shift. When it comes to Fractional Fourier Transform a generalization of Fourier Transform, the resulting transform can lie anywhere between time and frequency domain depending on parameter 'alpha'.

My question is how in the same way Linear Canonical Transform is a generalization of Fractional Fourier Transform.Its physical interpretation in terms of signal processing.
Can any body help?


texts: The Proper Way to Do Sinc Downsampling (DFT Downsampling) for Uniformly Sampled Discrete Signals with Finite Number of Samples

texts: Given a signal $ \left\{ x [ 0 ], x [ 1 ], ..., x [ N - 1 ] \right\} $ what would be the correct way to downsample it in the frequency domain (Sinc interpolation)?


texts: Wiener Filter Additive Noise Uncorrelated

texts:
I have been trying to understand for a while now why a non-causal Wiener filter that has a frequency response of the type

H(jω)=S_yx(ω)/S_xx(ω)

where y(n) = x(n) + n(n), x(n) the input signal, n(n) the noise and both uncorrelated,

can be simplified to

H(jw) = S_xx(jw) / ( S_xx (jw) + S_nn (jw) )

I understand the denominator but why is it that when x and n are uncorrelated

S_yx(jw) = S_xx(jw)

i.e. I don't understand Step 3 in this question but I don't have enough reputation to ask for a clarification/add a comment :(


texts: Does dividing the magnitude spectrum of white noise by sqrt(2) give an RMS magnitude spectrum?

texts:
I understand that the RMS Amplitude of a sinusoidal signal is around 0.707 ($\frac1{\sqrt2}$) times the Peak Value, but this is not true for noise.

However, an FFT of a noise signal indicates magnitude in bins at equally spaced frequencies, which means the magnitude represented in each bin, is the magnitude of a periodic signal (sinusoid).

So, I assume that multiplying the magnitude of an FFT by 0.707, should give me RMS magnitude spectrum on the Y-axis, instead of the peak value. Am I correct in assuming this, or am I missing something?


texts: What is the difference between a simple gaussian filter and gaussian filter multiplied by its sum of it elements?

texts:
1 2 1                         1 2 1
2 4 2 (A)            (1/16) * 2 4 2  (B)
1 2 1                         1 2 1

Both matrices are the same except that the matrix B is multiplied by the sum of its elements.
When convolved with an image, they give nearly the same blurred image.

What is the exact difference between them and when they should be used ?


texts: FFT of any sinusoidal signal -- how many point fft to take?

texts:
suppose I have to measure the DFT of an 60 hz sinusoidal signal and calculate upto 20 harmonics of this.  Value of the 20th harmonic will be 20*60 = 1200 HZ. Then my sampling frequency should be >= 20*60*2 >= 2400 hz

Now how many point FFT i have to calculate to estimate
information about harmonics ?
Is number of points in FFT(N) equal to the sampling frequency ?
How number of points in FFT(N) related to the sampling frequency
?
Is there any advantage with output off FFT if we sample at
higher rate ?

Is bellow three estimates are correct ?

1> If suppose my sampling frequency is fs =  20*60*2 = 2400 then, What i know is that the frequency range [0,fs] is represented by 2400 point.
   I.e each point represent 2400hz/2400 = 1 HZ information. Then output of FFT will be, really only need to look at the first N/2+1 samples

   X[0] is the constant term
   X[1] is 1 hz
   X[2] is 2 hz
   X[1201] is the 1200 HZ

2> If suppose my sampling frequency is fs =  20*60*2 = 2400 then, What i know is that the frequency range [0,fs] is represented by 2400 point. can  i take 4800 sample points ?
   I.e each point represent 2400hz/4800 = 0.5 HZ information. Then output of FFT will be, really only need to look at the first N/2+1 samples

   X[0] is the constant term
   X[1] is 0.5 hz
   X[2] is 1 hz
   X[2400] is the 1199.5 HZ
   X[2401] is the 1200 HZ

Is there any advantage here to take more number of samples to calculate the FFT ? One thing i note is that spectrum is more dense with each point having 0.5 HZ of information, will my calculation of FFT will be more accurate in this case ?

3> If suppose my sampling frequency is fs =  20*60*4 = 4800  =  then, What i know is that the frequency range [0,fs] is represented by 4800 point.
   I.e each point represent 4800hz/2400 = 1 HZ information. Then output of FFT will be, really only need to look at the first N/2+1 samples

X[0] is the constant term
   X[1] is 1 hz
   X[2] is 2 hz
   X[2401] is the 2400 HZ

Now in this case FFT is generating information upto 2400 hz but i need upto 1200 hz. Is there any advantage with output off FFT if we sample at higher rate ?

Please suggest on this.


texts: Very stiff state space matrices after linearizing my Simscape model

texts:
I want to simulate and build a furuta pendulum from scratch as a project. Currently I´m having some difficulties with the simulation of my model in Simscape and I can´t figure out what´s wrong with it.
Here is a Link to a Git repository where I´ve uploaded my current model in case you wanna have a closer look: https://github.com/Joo234/Furuta_pendulum
My first goal is to set up a state feedback controller. As you can see from my model, the state feedback control (without an observer) basically works fine. However, I actually can´t really explain or understand why it works, because the A matrix is actually very stiff and therefore the rank of the controllability matrix is only 1. According to my books full controllability is necessary for state feedback control to work. So why is it, that the pendulum is still balanced out despite of the low rank of my controllability matrix?
In general I´m very confused that one of the Eigenvalues in the A matrix is 5 decimals smaller than all other Eigenvalues. I feel like there´s something wrong with my model or the way I linearized it but I can´t figure out what it is.
I´d highly appretiate any help on that!

A =

   1.0e+05 *

   -0.0000   -0.0015    0.0000   -0.0000
         0         0    0.0000         0
    0.0000    0.0046   -0.0001    0.0000
    0.0001         0         0   -3.2500

>> Rank_ctrb

Rank_ctrb =

     1


texts: Modelling of quantization noise with logarithmic steps

texts:
I have to modell the quantization noise of ADC.
I only know that the maximum relative error is 1 dB.
Since this is logarithmic, I find it hard to formulate an appropriate model for the quantization error and noise.

Any help would be greatly appreciated!

Edit:
Thanks for the input so far.
As I recognize that this question is not properly formulated, I try it again:

I get measured data from a device that is the amplitude in dBm of a received signal. I know that the uncertainty is 1 dB.
This being logarithmic, I guess I can't simply split it up and say that the error is uniformly distributed within a +- 0.5 dB interval?

My aim is to get a distribution that describes probable measurement results for this device if I read for example -80 dBm.

I hope this clarifies the question


texts:
During beamforming, the Tx first sends NDP Announcement (which is a broadcast frame) thereby reaching all Rx in its area. And then it follows by sending NDP.

Is the 2nd frame (NDP) is also a broadcast frame?
What happens if Tx wants to implement beamform with a specific Rx.


texts: the relationship between bandwidth and the datarate

texts:
One Question of my note is like this.

Consider a communication channel with a bandwidth of 2400Hz. If QPSK technique is
used, what is the possible transmission rate? (Assume that rectangular
pulses are used in the baseband signals, and that 90% energy preservation is
required.)

For a baseband system, a bipolar signal of bandwidth B can support a rate of B
with 90% energy preservation (since bandwidth =1/τ in this case).
For a bandpass system, a BPSK signal of bandwidth of B can support a rate of B/2.
This is because, after modulation, the bandwidth is 2/τ.
For QPSK, rate can be doubled using the same bandwidth. Therefore the
supported rate is 2400bps.

Why the BPSK signal of bandwidth 2/τ can support a datarate of B/2? and what is the relationship between the bandwidth and the datarate? and why in the QPSK, the rate can be doubled using the same bandwidth?


texts: Finding causal impulse response given the imaginary part of the frequency response

texts: I understand that I would need to calculate inverse Discrete Time Fourier Transform (iDTFT) to find $h(n)$. Since $h(n)$ is real, iDTFT of the imaginary part of $H(e^{j\omega})$ gives the odd part of h(n) and  iDTFT of the real part of $H(e^{j\omega})$ part would give the even part of $h(n)$ (Correct me if I am wrong here). But, how do I find the even part of $h(n)$ when I only have imaginary part of frequency response and find all the possible $h(n)$?


texts: Approach to Determine Short-Term Delay Between Two Signals


texts: What would happen if we changed the input with the output in the Wiener filter computations? When we are designing a filter we use the input and the desired response vectors to find the Wiener filter. But what would happen if we changed the input with the desired response (output)? Filter is not reciprocal so I can imagine what would happen.


texts:
According to my knowledge a filter with low cut off frequency is called slow and with hgih cut off frequency is called fast filter.
I am trying to understand more about these two. I know what happens to signal when it goes through these 2 filters(separately). But I wanted to understand more about these filters. I simulated a 1st order PT1 filter for both very low fc and very high fc.
Below are the bode diagram for slow and fast filter respectively.
slow:

fast:

I'd be greatful if any of you would give me what's actually going on and the difference between these two.


texts: good open source api to register hand writing (with math-formulas)

texts:
I'm just wondering what the current state of open-source APIs is for handwriting recognition.
Especially in converting math-formulas to LaTex code.
I've heard of 'myScript' but they are not open-source. And tesseract is open-source but
it doesn't seem to work well with hand-writing.
Thanks in advance : )


texts: Cross Correlation shows peak at the same location every time

texts:
I have a signal which is taken from an accelerometer and I'm trying to match patterns between different windows of the signal by cross correlation. To do this I take different windows of the signal, sliding it on the signal and taking cross correlation and I'm hopping to find similarity between different windows by finding the peaks of my cross correlation.
However what I see is that no matter what window of the signal I use, I get peaks on some specific points on my signal! I usually don't even get peaks on the point where the window itself was taken from.
My first observation was that the peak points were located on noisy parts of the signal were the signal had a high magnitude nearby (which was an outlier compared to the rest of the signal.) So I did a preprocessing and removed the outliers. But I still get the same result on some other points on the signal. I also use the following formula for cross correlation:

$$r=\frac{\sum_i[x(i)-\mu_x]\times[y(i-d)-\mu_y]}{\sqrt{\sum_i(x(i)-\mu_x)^2}\times\sqrt{\sum_i(y(i-d)-\mu_x)^2}}$$

So the signals have a mean on 0 and cross correlation is normalized by their standard deviation.
So the questions I have are what am I doing wrong and how can I fix this? maybe additional preprocessing or an alteration in my formula?
How can I know if cross correlation is a suitable similarity measure for my task or not?
What other alternative methods do you suggest?

Additional Information:
I used this python implementation of cross correlation in my code.
I also post an image of my signal and points which have high correlation with nearly every window.

In this image the red curve is my signal. The two windows which show strong correlation to other windows dosn't look to have any special characteristics (high magnitude, etc).


texts:
I have written the following code to calculate the amplitude spectrum of a test signal.
clear;close all;
%% Define parameters and test signal

N  = 64;                           %number of samples
L  = 2*pi;                         %interval length in physical space
dx = L/N;                          %step in space
x  = linspace(0,L-dx,N);           %generation of x grid
k  = 2.0*pi/L;                     %wavenumber
y  = sin(k*x) + 2.0*sin(3.0*k*x);  %test signal

figure(1)
plot(x,y);
title("Test signal")
xlabel("distance")
ylabel("amplitude")
grid on

%% Define frequency space parameters

Fs = 1/dx;                          %sampling frequency
df = Fs/N;                          %step in frequency axis
freqs  = linspace(-Fs/2,Fs/2-df,N); %frequency axis generation
mask   = freqs > 0;                 %select positive frequencies if needed
nwaves = freqs*L;                   %number of waves that fit inside L

%% Execute FFT and calculate amplitude spectrum

fft_vals = fft(y);
fft_theo = abs(fft_vals/N);
fft_theo = fftshift(fft_theo);

figure(2)
plot(freqs,fft_theo);
xlim([-3,3]);
title("Amplitude spectrum")
xlabel("frequency [L]^{-1}")
ylabel("amplitude")
grid on

figure(3)
plot(nwaves,fft_theo);
xlim([-10,10]);
title("Amplitude spectrum")
xlabel("number of waves")
ylabel("amplitude")
grid on

When the interval length is set to L=2*pi I get correct results. For example, the frequency that corresponds to k=1 is 1/2/pi = 0.1592 [L]^{-1} according to the equation k=2*pi/lamda. If however I change the length to say L=5 then the frequency is 0.2[L]^{-1}. I am  confused about it.
And another question, the step in frequency axis is defined here as  df = Fs/N = 1/L, where Fs is the sampling frequency and it differs from k=2*pi/L. I have seen the latter expression being used in other codes. Which one is correct?


texts:
I'm very new to digital signal processing, so please let me know if my question doesn't  make sense.

I calculated the amplitudes (using the formula : $10 \log_{10}(i^2 + q^2)$) for some IQ data that I recorded using GNU radio.  I compare the highest calculated amplitude to the highest amplitude shown when processing the IQ data with a GNURadio fft sink (using peak hold).  The numbers are significantly different in some cases.

In one case, the highest amplitude signal I found was +2.98 db.  When I process the same data with a GNURadio FFT sink, it shows the highest amplitude as about -0.5 db.

In a second case, the python calculations find an amplitude of -23 db, while GNURadio finds a highest amplitude of about -64 db.

Should I expect the highest FFT amplitude to be similar to the highest amplitude found by calculating it for each IQ sample?  I was assuming that the IQ data amplitude and the FFT amplitude would be similar, and I'm not sure if I'm doing something wrong in the IQ amplitude calculation.

Thanks in advance.


texts: Image from Inverse FFT operation is sparse

texts:
I'm trying to train a deep nerual network that takes in input, an signal in the frequency domain, and attempts to learn a mapping to another signal in the frequency domain.

Basically, the input to the network is a 2d matrix with separate real and imaginary components with shape (256, 256, 2). Taking the IFFT of this input, produces the right image.

The input image in(after IFFT operation on the signal) looks like this:

When the IFFT operation is applied on the network output however, the output image looks like this.

My question is this: What could be causing the output to appear this way? I looked at image scaling issues that could potentially lead to this, the image shown is adjusted with log scaling. The fact that there are two "lines" (vertical and horizontal) leads me to think that it might have to do with the IFFT "erasing" a lot of the information. My apologies for the wording of the title, couldn't figure out how to describe this issue.