texts: How to filter data to remove noise in MATLAB?

texts:
I have 2 arrays of 800000 input and output data samples. The system is a kind of oven that works from 0 to 10 volts. The sample time is 0.001s.

I have to identify the model of this system, but first of all, given that the data are clearly dirty, I would like to filter the noise.

How can I do it with the System Identification Toolbox of MATLAB?
Moreover, how can I estimate the cutoff frequency to remove the noise?

EDIT:

As suggested, here below are the sampled data plot. As you can see the voltage inputs looks good, but the temperature outputs are affect of noise. I would like to remove it, in order have the output more "smooth".


texts: Proof regarding the periodicity of a continuous-time sinusoid after sampling

texts:
Question
A continuous-time sinusoid $x_a(t)$ with fundamental period $T_p = \frac{1}{F_0}$ is sampled at a rate $F_s = \frac 1 T$ to produce a discrete-time sinusoid $x(n) = x_a(nT)$.

Show that $x(n)$ is periodic if $\frac{T}{T_p} = \frac K N$ (that is, $\frac{T}{T_p}$ is a rational number)
If $x(n)$ is periodic, what is the fundamental period $T_p$ in seconds?

I feel there is some ambiguity in the question itself. I assume $N$ here refers to the period of the sampled discrete-time signal.

I know how to prove that a discrete-time signal is periodic only if its relative frequency is a rational number. But the concept of periodicity in both continuous-time as well as sampled signal confused me.

So here is what I have tried:

Consider a continuous time sinusoid, $$x_a(t) = \cos(2 \pi Ft) \tag{1}$$ For this signal to be continous with a fundamental period $T_p$, it must follow that $$F=\frac{k_1}{T_p} \tag{2}$$ for some $k_1$ which is an integer.

Now that this signal is sampled with samppling rate $F_s$, the resulting discrete-time signal will be:
$$x(n) = \cos(2\pi f n)\tag{3}$$ where, $$f = \frac{F}{F_s} \tag{4}$$ This sampled signal will be periodic with period $N$ iff
$$f = \frac{k_2}{N} \tag{5}$$ for some $k_2$ which is also an integer.

Using equations (2), (4) and (5), it follows
$$\frac{T}{T_p} = \frac{k_2}{k_1 N} \tag{6}$$ If I redefine $\frac{k_2}{k_1}$ to be $K$, then equation (6) becomes
$$\frac{T}{T_p} = \frac{K}{N} \tag{7}$$ which proves the first part.

Now that the fundamental period $T_p$ has been asked, solving for $T_p$ in equation (6) gives
$$T_p = \frac{k_1 T N}{k_2} \tag{8}$$

Since both discrete time period and continuous time periods are in the same place, this has made me confused whether my approach to the solution is correct or not. Could you please verify that the approach is correct? Or if anything is wrong, could you point that out to me? Thanks.


texts: Find Amplitude of each period of time series

texts:
I would like to determine the of each period amplitude of a time series (e.g. the amplitude of each day). The time series has a constant period of 1 day and varies only in amplitude. I have tried splitting the time series into individual periods then solving for the amplitude by re-arranging the equation:

$$y = A \cdot sin ( \frac{2 \pi}{\tau} \cdot t)$$

to:

$$A = \frac{y}{sin ( \frac{2 \pi}{\tau} \cdot t)}$$

where $A$ is amplitude, $\tau$. is the period and $t$ is time.

This works reasonably however there are issues with locating the beginning of each period.

Is there some more robust method I can use for this problem?


texts:
For any discrete input signal between +1 and -1, what is the theoretical maximum DFT?

If the input is a cosine of $N$ samples with amplitude $A$, the peak spectral magnitude is $A*N/2$. But what about any arbitrary waveform?

A square wave with the same amplitude as the cosine is composed of various sines, the fundamental frequency of which has a greater magnitude than the square wave. Therefore the Fourier transform of a square wave with amplitude also between $1$ and $-1$ is greater than the cosine with amplitude between $+1$ and $-1$.

But generalizing this to any waveform, ie a triangle wave, sawtooth wave, and also non geometrically "nice" waves, all with amplitudes between $+1$ and $-1$, what is the theoretical maximum?

I want to know because I need to represent the output of a DFT with 16 signed bits. However if the magnitude of the DFT is greater than $2^{15}$ I would need to scale. I therefore need to determine if this will ever happen (for any input waveform) and how much the scaling factor should be.

Thank you very much,


texts:
I have implemented a simple V.23-like FSK modem in C here.

The peculiarity of the chosen modulation is such that 0's and 1's are sent as tones of two different frequencies (2100 Hz and 1300 Hz respectively) and the duration of each symbol is 1/1200th of a second, which is between one and two full periods of the symbol tone frequency.

The band-pass filter that I used in the receiver is from about 875 Hz to about 2350 Hz. This range was determined empirically.

The question is, how do you calculate this frequency range for a signal like that from the tone frequencies and symbol duration?

EDIT: A similarity with amplitude modulation has been suggested, where the modulated signal falls into the band from Fcarrier - Message Bandwidth to Fcarrier + Message Bandwidth Hz.

If I try to apply this logic directly to my case, then I should expect the bandwidth of my FSK signal to be the union of:

F1 - bit rate to F1 + bit rate
F0 - bit rate to F0 + bit rate

Or, if I plug in the numbers, the union of:

1300-1200=100 to 1300+1200=2500
2100-1200=900 to 2100+1200=3300

Or, simply, from 100 to 3300 Hz.

If I look at the spectrum of my FSK signal, however, it looks like it's roughly contained in the band from 2100-1200=900 to 1300+1200=2500 Hz instead of from 1300-1200=100 to 2100+1200=3300 Hz. Can this empirical result be explained and proven?

EDIT2: Here's the spectrum as I'm seeing it in Audacity:


texts: Is this calculation of inverse z-transform proper

texts:
I wonder whether my calculation of inverse z transform are correct. My IIR system is described as follows in Z-domain  $H(z) = \frac{z^{-2}}{1-0.5z^{-2}}$

After using partial fraction decomposition I obtained $H(z)$ in Z-domain as follows $H(z)=\frac{\frac{1}{2}}{1-\sqrt{\frac{1}{2}}z^{-1}} + \frac{\frac{1}{2}}{1+\sqrt{\frac{1}{2}}z^{-1}}$.

After applying inverse Z transform I obtained such form: $h[n]=\frac{1}{2}(\sqrt{\frac{1}{2}}^{n}-\sqrt{\frac{1}{2}}^{n})u[n]$. What confused me is that this is 0 as the insides of parentheses cancel out. Maybe this is some dumb mistake I am making (it is quite late)


texts: Minimum Output Samples needed to crack a "Gold Code" Generator (Dual LFSR)

texts:
Please preface your answer with spoiler notation by typing the following two characters first ">!"

Below is an implementation of a "Gold Code" Generator formed by adding (in $GF(2)$) the outputs from two linear feedback shift registers (LFSRs). This generates a pseudo-random sequence and is similar to the C/A Code Generator used in GPS.

An LFSR operates by shifting the contents of its shift register right on each cycle and computing the new input on the left side through the $GF(2)$ addition of certain outputs based on its "generator polynomial".

Each LFSR generator, given that is uses a generator polynomial that supports a maximum length sequence (meaning the polynomial is "primitive") produces a pseudo-random sequence which does not repeat for $2^{10}-1 = 1023$ samples, or "chips".  The combined output therefore also does not repeat for 1023 chips.  The feedback taps in each LFSR are set by the specific generator polynomial used (as shown).

Assume a black box with a a similar Gold Code generator, using two 10th order LFSRs but with unknown and primitive generators, and we only have access to the output code in high SNR conditions. What is the minimum number of chips that we would need to observe in order to determine what the generator polynomials are (in other words, to determine what the feedback taps are)?


texts: Please explain, mathematically, how can a bank of modulators be replaced with the IFFT in an OFDM system?


texts: Convolution effects width of the signal?

texts:
Let's say there are two signal with different frequency:
\begin{align}
X_1(\omega) &= 0\quad\text{for}\quad \lvert \omega\rvert > 1000\pi\\
X_2(\omega) &= 0\quad\text{for}\quad\lvert \omega\rvert > 2000 \pi\\
\text{And}\quad y(t) &= x_1(t) \star x_2(t)
\end{align}

I understand that convolution in time domain means multiplication in frequency domain, but it does not affect the length of the signal. But in this case, what is the maximum frequency of $Y(\omega)$?
If I were to find maximum sampling interval $T_s$ then which maximum frequency do I have to use?


texts:
I have the positions of a computer mouse, sampled at a high frequency, with a good amount of noise. When the user stops moving the mouse, instead of going to zero the velocity reported by the mouse is non-zero and the cursor drifts.

I want to estimate the drift velocity. The attached image is a plot of the x and y velocity components. The user has is not moving the curs between datapoints ~600 and ~660.

Are there standard techniques for identifying a constant subinterval of a signal?

Here are some things I have tried:

Using a high pass filter to estimate the standard deviation of the noise. Then I used that as a comparison of nearest neighbor velocity differences. This does not catch slowly increasing intervals. (Black intervals in second figure)
Looked at instantaneous min/max over the current interval and filtered out those intervals where (max-min) is too high. (Red intervals in second figure).

As you can see from the second image, I can select out some reasonable intervals of interest, but I still end up with spurious ones. I could come up with more filters, but I'm now just introducing more ad hoc parameters.
What is a more principled way to do this?


texts: BPSK signal that has not been pulse shaped by any filter

texts: Can one consider that a BPSK signal that has not gone through any pulse shaping filter to be equivalent to a signal that has gone through a rectangular filter of which the pass BW is equal to the symbol ( bit in that case) rate?


texts: A C/C++ library for FIR filter design with "Don't Care region"

texts:
I need to get coefficients for my FIR filter.
I know my pass band lets say between 350 - 400 Hz
And my stop band(s) lets say 200 - 250 and 500 - 500 Hz,
The other regions in the spectrum I simply don't care. I want the Filter to be relaxed in this regions so be more effective in pass and stop bands.

I am looking for a library with a  simple interface that I will just give passband and stop bands and number of taps. Than I will get my coefficients.

What I found is aquila example, but I couldn't see how can I define relaxed regions.

Can you please advise me a C/C++ library with relaxed, pass, stop bands and easy to use even for a computer scientist?


texts:
I try to detect and count circles in image (for example smarties)

I use HSL color space. But I am not able to distiguish colors od the same color if they are in touch. I try to erode and dilate picture. But result is the same, I have only some blobs(connected components) od the same color. Do you have some general algorithm for this problem?

(I try to do that with EMGUCV library)

Thanks in advance.


texts:
I'm trying to learn audio programming, but am struggling with the basics of audio.

Audio programming is new to me (I'm a C/C++ developer with over 30 years of experience), but I don't have any background in sound/audio or DSP.

I'm learning ad-hoc, through various websites. Things I need to know are sampling, envelope, sweeps, length counters, pulse waves, triangle waves, delta modulation, PCM, etc.

Is there some kind of definitive book that I should start with, given my background? I don't really need to understand advanced sound processing, just something thats beginner and somewhat easy to digest.


texts: How to change speed of audio samples without changing pitch?

texts:
This question may be more appropriate on music stack exchange but since sound is a branch of physics and this is more of a technical question relating to sound waves than a musical question I asked it here.

How can you change the speed of audio samples without changing pitch?   I have heard songs that are sped up without changing the pitch of the song.   I also know that simply compressing an audio sample changes the frequency and thus the pitch of the sound waves that are perceived by our brains.   So how is this done without changing pitch?


texts:
With OCR one of the first stages in a processing pipeline is to accurately identify what is print and what is paper, generally achieved by some form of binarization.

In the good old days most scans were captured as grayscale images. For clean images with a high level of contrast, i.e. already largely black and white, Otsu's method worked quite well.

However once things like yellowing of paper, brown water stains, notes in blue biro, and other artefacts that appear as dark grey or black in a greyscale image, along with faded print are added into the mix we find ourselves in trouble.

These days almost all scanners and smart phones capture colour images and I would like to take advantage of the essentially 3D nature of RGB colour vs 2D grayscale images to improve the accuracy of the process.

To that end can you please help me with links to methods/algorithms that help to identify the centres of clusters of colour in a 3D RGB space.


texts: Relation between curve fitting and filtering

texts:
Before I ask the question: I am from mechanical background and would appreciate a detailed answer.

Generally, for automobiles, I am trying to understand the following:

Given, say $1\;\mathrm{sec}$ of measurement data, which may contain a wide range of frequencies, we fit an $n^{\mathrm{th}}$ order polynomial curve through it. Doing this filters out certain frequencies which would have been present otherwise. It acts, as I can imagine,  like a low pass filter.

Question:

Let us say that we have a linear system with input $u$. Let $f$ be the input frequency. This linear system would produce an output, $y$, of same frequency, $f$. We fit an $n^{\mathrm{th}}$ order polynomial through these measurements. This curve-fitting acts as a low pass filter. What would be the characteristics of this low pass filter?

Context to my question and discussion:

How I see it is: The measurement data is $1\;\mathrm{s}$. Fitting a parabola through it can be approximated as a half of a sinusoidal curve. Similarly, a $3^{\mathrm{rd}}$ order curve would be a complete sinusoidal curve, and so on. So, for $2^{\mathrm{nd}}$ order polynomial, the cut-off frequency $f_c$ would be $0.5 \;\mathrm{Hz}$. Similarly, $1 \;\mathrm{Hz}$ for $3^{\mathrm{rd}}$ order polynomial and so on. Does this make any sense? Could somebody suggest me some book where this aspect is dealt with?


texts: How to separate mixed signals, 3 identical gears meshing together

texts:
I have 3 identical gears that are meshing together, on each shaft that is holding these gears I have an accelerometer recording vibration data.
Once I move to the frequency domain via MATLAB's fft I am unable to see any specific frequency that would describe the meshing frequency of my gears, it looks all the same.

Are there any methods I should be looking at to tackle such a challenge of identifying the gear meshing frequency and probably identify which gear is inducing what frequencies?

Also would it make any sense to run the motor while disconnecting the gears and record the vibration induced by the motor, and analyze that to filter out the motor's influence?


texts: The plot of instantaneous power of the Dirac function

texts:
I am very confused. I have tried researching this question for the last two weeks and I cannot get a conclusive answer.
I was wondering how would I go about plotting the instantaneous power in the time domain of the Dirac input signal.
The problem becomes as I try to calculate the power in time domain, $P(t) = \left\lvert\delta(t)\right\rvert^2$. I know how to calculate power by using Rayleigh's theorem to convert the the signal to frequency domain where delta(f) = 1. to get infinity over an infinite period which is undefined value for power, but I just want to plot power over time for the Dirac function.
delta isn't square-able since as x goes to 0 the delta function goes to infinity and you cannot square infinity, also something about the delta function being a distribution and not able to be square-able.
I was wondering if someone could point me in the right direction to be able to plot this function.
Thank you


texts: Determining channel frequency response from measured data via IFFT

texts:
I've been working on a small system that transmits a linear chirp over the 35Hz-20kHz frequency range in a room and simultaneously records the transmitted signal with echoes (from the floor, walls, etc.), using two microcontrollers.
Using the received data $y[n]$ and reconstructing the transmitted chirp $x[n]$ in the receiver, I obtain the channel frequency response by $H[k]=Y[k]/X[k]$, $X$ and $Y$ being the FFTs of $x$ and $y$ respectively. I then attempt to compute the channel impulse response by computing $h[n]={\tt IFFT}(H[k])$. I then try to use time-gating to get rid of the echoes.

The fact that I am not using external memory limits my computational ability to using float arrays of length N=2048 at most, so the signals I'm dealing with are in the single milliseconds regions (this of course limits my resolution, but that's a problem I have to come to terms with).

The problem that's bothering me is, when I look at the calculated impulse response I get something like this:

It seems that the main response is seemingly moved cyclicly a bit to the left, so that its beginning is at the end of the array and there is a large "spike" there (either that or the response has a big delay, which doesn't fit the physical system as the speaker and the microphone are just a few centimeters apart for the tests I'm performing).
What might be the reason for this?
I've read some posts around here which looked similar and there was talk about pre-ringing; could this be the case here?

I want to compute the FFT of the time-gated (and ideally, "fixed") impulse response to get some data out of it, and a part of it is obtaining the delay of the main response- can this be done in this case?

Insight would be greatly appreciated!

Avner

Edit: Attempting to bump this along with a follow-up question I had to Peter's response.
If I should attempt to ask this in a separate question instead- please let me know.

"Thank you very much! So far I've been transmitting a chirp that lasts 25ms, and the reception goes on for 32ms (so there's an underlying assumption that the channel is 7ms long due to short distances between speaker and mic). I've padded the chirp samples with zeroes to match the reception length (in samples) and using this scheme gave me the graph attached in the question.

I've read that using a sine-sweep and performing a deconvolution results in separating nonlinear harmonics to "behind" the channel response in time, so that might be what's moved cyclicly and runs over the channel. Do you think there is a solution to this problem, given the limitations? I'm pretty much filling up the 32kB memory on the microcontroller I'm using with two 2048-float arrays that constitute a general array I'm working on and take up 16kB (doing things in-place) and two more int-arrays that take up 12kB more, so there's not a lot of memory left to use."


texts: Spatial domain vs. Frequency domain filtering of an image. Which one is better?

texts:
The question might seem naive but I'm new to this and a little confused.
So, I recently came to know that gaussian smoothing can be applied to an image both in spatial domain and in frequency domain. But I am confused on how should the results be compared?
So, suppose I apply gaussian to an image A in spatial domain and get output GS(A), and similarly get GF(A) when applied in frequency domain. Which one of both these will be better? I know this is dependent on filter size and all but I am confused on how can the comparison be made.
Also, is there a standard practice where we use frequency domain filtering for certain tasks while spatial domain filtering for certain other tasks? If yes, can you please share your views and/or reading material for the same?
EDIT 1 (CLARIFICATION):
I know that "you can implement spatial filtering either by direct convolution or indirectly by multiplying the image's Fourier transform by the filter's Fourier transform, then taking the inverse Fourier transform to get the whole thing back into the spatial domain".
What I want to know is the difference in output of these two methods.
Also, which method should I opt for and why?
There might be speed differences obviously, but are there any quality changes?
When should I use which method? (if it depends on the use case)


texts:
I was trying to analyse the lossy compression of MP3 audio files through their Spectrograms and the results were something like this (where the upper is 80Kbps and lower is 128Kbps).

It is obvious that the compression works by deleting higher frequencies from the audio. This is visible from the Spectrogram itself so I wanted to know

How exactly does the compression take place behind the simple ffmpeg commands?
Are spectrograms the best way to analyse the change in bitrates of an audio file?
The STFT used, gives us the phase and the amplitude from which we take the magnitude and plot the spectrogram. So how different can I expect the phases of the higher and lower bitrates to be?
Is it possible to somehow recover the lost frequencies because ffmpeg based bitrate upscaling doesn't produce accurate results on the Spectrogram

I am from a CSE background so I will be grateful if someone can answer these questions or atleast refer me to some article or paper regarding the same.


texts:
I'm looking to create a program where I take an audio input stream, whether it be microphone or an audio file etc. Perform some arbitrary processing to it and then output this signal to a virtual microphone.

The part I'm struggling with is the outputting to a virtual microphone because i haven't found a way to create one in Python. I know there are third party applications to create virtual audio pipelines, but I would prefer to have it all in one program.

I am aware of Microsoft's Virtual Audio Device Technology, but I have absolutely no idea how to use it or where to start.

If someone is able to help me figure out how to create a virtual audio Device in Python, or how to use Microsoft's Virtual Audio Device Technology that would be fantastic.

Thank you


texts:
I have a question regarding the constant modulus algorithm (CMA), as you know it's one of the known algorithms used for blind equalization. The cost function of the CMA is build blindly, it means based on received signal only. The cost function of that algorithm is:

$J = \frac12\left[\left\lvert w^T*y(n)\right\rvert^2 - R_{cm}\right]^2$

where $R_{cm}$ is the constant of CMS algorithm which is usually equals 1. $w^T$ is the equalizer coefficients and $y(n)$ is the received signal.

My question, is that algorithm applicable for OFDM system?

If so,  and what's  the constant $R_{cm}$ will be?


texts: Phase demodulation vs frequency demodulation using a PLL

texts:
When demodulating a phase modulated signal using a PLL it is recommended to use a narrow loop BW, so that the VCO does not really follow the input phase modulated signal but outputs a reference frequency and the error signal represents the demodulated signal

On the other hand and for frequency demodulation it is recommended to use a wide loop BW , so the VCO tracks the input signal and in this case the error signal also represents the demodulated signal.

Why is that? what makes an FM signal different than a PM signal so that for one one uses a wide Loop BW for demodulation and for the other a narrow loop BW?


texts:
Signal processing is not my area of expertise so need help with implementing an OFDM system.

EDIT: The cabling and uncontrolled topology already exists and need a system that re-uses existing installation in large buildings

System is for wired communication on a shielded twisted pair. The topology is a combination of daisy-chaining, star-connections at the nodes which further go onto more daisy-chaining. Essentially as bad as power lines but largely interference free because of shielding and differential signalling.
Bandwidth is best kept as low as possible considering very long cable runs (half a kilometer) between nodes.
Need to be able to send up to 256kbps.

Have been reading up on OFDM from an implementation point of view. I now understand a a bit about the use IFFT/FFT to inject and extract data out of the orthogonal carriers. Need for guard intervals, frame synchronization with pilot symbols, channel estimation with pilot careers etc. Things are still coming together in my head but I have a very basic understanding of OFDM. I have some questions:

This being baseband is there a way of not having to use quadrature mixing to transmit the Real and Complex parts of the IFFT i.e. non-passband way of sending it?
I am trying to keep the demodulation part as simple as possible. Anyway I can get away with not using channel estimation i.e. non-coherent demodulation with DPSK or something similar?
Any pointers to fully implemented systems that I can dissect to learn more?
Considering the low data rate, I'll probably end up doing this on a low-end DSP.

EDIT: There is only one differential pair in the cable. The bus will have 12 to 15 nodes on it with any-to-any communication.


texts: z-Transform Methods: Definition vs. Integration Rule

texts:
The definition of the z-transform is defined as $z = e^{sT}$ where "s" is complex frequency for continuous-time systems and "T" is the sample period.  Why are rules such as the forward rectangular rule, or Tustin's method used instead of the definition?

Forward rectangular rule:  $s \leftarrow \frac{z-1}{T}$
Tustin's rule:  $s \leftarrow \frac{2}{T} \frac{z - 1}{z + 1}$

I am asking about the characteristics of the transform methods.  If I transform G(s) to G(z), then why use Tustin's rule or forward rectangular rule instead of the definition?  I would think the integration rules are just an approximation to the definition.  What are the characteristics of these maps and how do they compare with each other?


texts: Should we divide the power at 0Hz by two for Single-Sided Power Spectrum with FFT?

texts:
To make my question as clear as possible I will go through an example. I want to plot one sided power spectrum of a signal. As an example my signal is sum of "50Hz sine with and amplitude of 1V" and "DC offset voltage of 1V". I create this signal and plot FFT of it where I define the power as amplitude square divided by two.
Here is my code:
import numpy as np
import matplotlib.pyplot as plt
from scipy import signal
import scipy.fftpack

f = 50 #signal freq
D = 1 #duration
fs = 800 #sampling freq
T = 1/f #signal period
N = int((D/(1/fs))+1) #number of smaples

t = np.linspace(0, D, num=N, endpoint=True) #time vector
dc = 1
y = np.sin(2*np.pi*f*t) + dc

plt.plot(t, y,'-b')
plt.plot(t, y,'.r')
plt.title('~ Sinusoid ~')
plt.xlabel('time [s]')
plt.ylabel('Voltage [V]')
plt.grid()
plt.show()

#FFT
plt.figure()
y = y
T = t[2]-t[1]
sampling_rate = 1/T
N = len(y)
yf = scipy.fftpack.fft(y)
xf = np.linspace(0.0, 1.0/(2.0*T), N//2)
amplitude = 2.0/N * np.abs(yf[:N//2])
pow = amplitude*amplitude/2

plt.plot(xf, pow,'b')
plt.grid()
plt.xlabel('Frequency [Hz]')
plt.ylabel('Power [W]')

Now the rms power for the sine component can be calculated as (amplitude square)/2 which is 0.5W and this is what we see at the plot above.
And for the 1V DC component, I would say the rms power is (amplitude square) which is 1W. But the plot shows twice of it namely 2W.
My question is: Should I divide the power by two at 0Hz at FFT plot in my code or am I interpreting something wrong?


texts: For a 20 MHz channel, with 1200 usable subcarriers(18 MHz occupied), what should be the size of the FFT on the transmitter before IFFT is applied?

texts:
I am trying to simulate the SC-FDMA transmission and I read H Myung's paper and research on the topic but I am not sure exactly on what should be the size of FFT at the transmitter.

For a 20 MHz channel, with 1200 available subcarriers, what should be the size of the FFT block?

The research talks about IFFT at transmitter sized N = M·Q where Q is the number of users and M is the no. of subcarriers in each block of Q.

So do we perform a M pt. FFT on each Q block or on the entire 1200 symbols at the transmitter before IFFT?

Link to paper: https://ieeexplore.ieee.org/abstract/document/4099344


texts: Given a impulse responce can we derive a state space model?

texts: One can find may examples of how to find the impulse response given a state- space model (A,B,C,D). Is the inverse defined properly  i.e given a impulse model can we derive the discrete-time state space model? Is this construction one to one?


texts:
I have already working matlab based code for an application. i want to port on to OMAP L138 using matlab coder.  I have some queries related to this

Is it possible to do on a omap based custom board.?
Does  embedded coder support all the matlab function.
Is it the right way to build a communication system (i.e simulate and test in matlab then port it to dsp using matlab coder)

I think some experienced engineer advice is required here?


texts: What are two different continuous-time signals when sampled at $10\textrm{ Hz}$ would produce the sequence $x(n)=\cos(n\pi/8)$?

texts:
The answer is:

  $\cos(1250\pi t)$ and $\cos(21250\pi t)$

I’m not able to verify.

My understanding is that when you periodically increase $t$ by $1/10$ ($10$ here is the frequency, so $1/10$ is time period) from $0$ to the signal $\cos(1250\pi t)$, you should get $x(n)=\cos(n\pi /8)$.

However, $\cos(1250\pi (1/10))$ is not same as $\cos((1)\pi /8)$.

So I would like the verification and what's wrong with my reasoning? Any help is appreciated.


texts: importance of symmetric windows for STFT for practical applications

texts: I am wondering why is the linear phase property of filters with symmetric coefficients important for some practical applications of short time fourier transform, such as image processing? I have read that the linear phase property will ensure that there will be no phase distortion of the signal by the filter? Can anyone explain the reason?


texts: Block diagram transfer function of a line

texts:
What is the transfer function of a line, can i ignore it?

After simplification i got the diagram:

I don't know what to do with the empty feedback


texts: I'm writing up a manuscript and I use the term spectrogram quite a bit.  I've defined a spectrogram as the magnitude squared of the short time Fourier transform of my signal.  It's an estimator for a time-varying spectrum of a non-stationary process.  I'd like to cite a paper for the origin of the term but I'm not sure what to cite.  Could anyone give me some advice?


texts: Adaptive calculations of Wiener filter coefficients

texts:
Suppose,I have an input of length of lenght 100. data=[x0...x99];
I take a window of lenght 11 from x0 to x10.
windowed data=[x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10],
now, I compute 7 wiener coefficients which are
[w0 w1 w2 w3 w4 w5 w6];
next I will move by window one sample forward,
new windowed data= [x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11],

My question how can I use the previously calculated wiener coefficients to calculate the new wiener coefficients for the new windowed data? Also I want this to be done in the shortest possible time.


texts: The frequency-domain spectrum obtained using MATLAB's FFT function seems inaccurate

texts:
I am using MATLAB R2018b on a Windows 10 PC. In order to obtain the frequency domain information of a signal, I'm applying MATLAB's FFT function. The signal of interest is obtained from an experiment in which a Gaussian pulse is reflected by a  non-linear target. The reflected pulse is received on an antenna array. Thus, I expect the reflected signal's spectral component to show up on the frequency spectrum. However, the FFT produces what I can only describe as two impulses at the extremes of the frequency axis. I've attached the data being processed, and the results obtained. What exactly am I doing wrong? Are the results reasonable?

The input vector is a 100000x16 matrix (data from 16 different channels at 100000 samples each)

CODE:

% Code
Ns = 100000; %number of samples
f = linspace(0, 20e9, Ns); % frequency vector
frequency_spectrum = fft(time_domain_data);
plot(f, abs(frequency_spectrum)./max(abs(frequency_spectrum)));
title('Frequency Spectrum');
xlabel('Frequency (in Hz)');
ylabel('Normalized |Y(f)|');


texts: Need to calculate the VARIANCE of GLCM matrix of an image in MATLAB

texts: I have calculated by Matlab the four characteristics of texture derived from the GLCM or co-occurrence matrix (entropy, contrast, correlation, energy) but in what way can the VARIANCE be calculated having the GLCM. Is there some implemented code (matlab function) for that?


texts:
What is the minimum period P (in samples) of the signal $e^{j(\frac{M}{N} )*2πn}$ for the following values of M and N?

M=1,N=3
M=5,N=7
M=35,N=15

I have got the answer for the first pair of values, which is 3. But I could not get the other two correct. Please help.


texts:
I am relatively new to signal processing, and have always used MATLAB's designfilt option for my signal processing needs.  Recently, however, I have seen people just using MATLAB's butter function.  We all primarily just analyze EEG signals.  I am just curious as to what makes them do this, as I currently don't see a major difference between the two aforementioned functions.
Again, I am pretty new to signal processing.


texts: A is transmitting a signal to point B . But in this process A is creating an interference at point C. So if the distance between point A and point C decreases the interference will increase. My question is if the value of pathloss between point A and C changes from -10dbm to -30dbm , the interference will increase or it will decrease. (The value in watts will change from 0.0001 to 0.000001 respectively)


texts: Does Wavelet Packets (WPT) decompose signal on dyadic scales like DWT?

texts:
As far a I understand WPT is a generalization of DWT in a sense that you get a whole binary tree of possible orthogonal decompositions where DWT is only a one branch. And WPT also downsamples a signal at every level by the factor of 2.

Am I correct?

But at the same time there are statements that WPT gives better precision for high frequencies compared to DWT.

Why is it so? Is it because it contains possible orthogonal decompositions where we decompose details of the previous level?

It seems that two-scale equations for WPT imply dyadic scales ($\frac{t}{2}$ on the lhs)

$$2^{-\frac{1}{2}}W_{2m}(\frac{t}{2} - k) = \sum^{\infty}_{l=-\infty}h_{l-2k}W_m(t-k)$$
$$2^{-\frac{1}{2}}W_{2m+1}(\frac{t}{2} - k) = \sum^{\infty}_{l=-\infty}g_{l-2k}W_m(t-k)$$

So, is it correct to assume that WPT like DWT works on dyadic scales?


texts: Hilbert Transform in C provides possibly strange results

texts:
I am calculating some signals that depend on the Hilbert Transform and, after following various guides online and SO, my function looks like this:

void Hilbert_Transf(COMPLEX *cplx_data, const int LENGTH)
    {
    float Imag_Val = 0.0f;
    for(int i = 0; i < LENGTH; i++)
        {
        Imag_Val = cplx_data[i].y;
        cplx_data[i].y = (Imag_Val > 0 ? -PI / 2 : (Imag_Val < 0 ? PI / 2 : 0));
        }
    }

It is essentially testing if the imaginary value is positive, so it is replaced by -PI / 2, or by PI / 2 if it is negative, and by 0 if 0.
To test the function I used a sine wave, computed by:

const int LENGTH = 1024;
float input[LENGTH];
for(int i = 0; i < LENGTH; i++)
    input[i] = sin(i * 2 * PI * 0.01);

The FFT process  is throught Intel MKL, so in the function above I just considered COMPLEX *cplx_data to be a complex in the form MKL takes and the member .y being its imaginary part.
Then I write to files the input data (sine wave) and output from the HT, and plot them.

So you can see the input sine in blue and the HT of it in red, as well as the "serrated" peaks, troughs. I wasn't expecting this "stepped" behavior. Can you guys tell me what is wrong/missing and how it should be? If you need more information, just let me know.

========== EDIT ===========

Matt L., following your script, here is the result of a plot which looks more decent:

Blue is the input and red, the output. I will of course find a way to reproduce this in C, but I will ask a couple more questions on the comments so we can close it.


texts: How could I approach determining if this 2D system represented as a 2D summation formula is linear?

texts:
I have a given 2D system:
$$y(m,n) = \sum_{k_1=-\infty}^{m} \sum_{k_2=-\infty}^{n} x(k_1,k_2)$$
My usual approach to determining if a system is linear is to test if it is homogeneous and additive. First I would input an arbitrary point: (0,0), (1,1), (0,1), (1,0), calculate its output. Then I would scale the input and scale the output and see if the scaling amount matches. Next I would test the additive property in a similar manner. This is fine for a simple 2D system formula, for example: $y(m,n) = x(m,n) + 3$
With a 2D system represented as summation, I am not sure how to apply this test.
Searching the web, it seems this system looks like a 2D convolution:
$$y[i,j]= \sum_{m=-\infty}^{\infty} \sum_{n=-\infty}^{\infty} h[m,n]⋅x[i−m,j−n] $$
However, I am still stuck thinking of how to prove this system is linear. I would assume the process is fundamentally the same (prove it is homogeneous and additive or not). I am just not sure of the steps.


texts:
I'm trying to implement some code for watermarking on audio based on a scientific paper. I'm stuck in the part of the pseudo code where they calculate the fourth order cumulant of the approximation coefficients of DWT. I have no idea what a cumulant is even when I tried to understand the theory.

I found the following MATLAB code in this book

Cum4 = mean(P.^4) - 4*mean(P)*mean(P.^3) - 3*mean(P.^2)^2 +12*mean(P)^2*mean(P.^2)- 6*mean(P)^4;

Which outputs a single value, meaning the 4th cumulant. However the paper is expecting more than one value (at least that is what I understand).

This the part I don't get

For each AHC, calculate is fourth-order cumulant, denoted as Ci(k)

$C_{i(k)} = \left \{ c_{i(k)}(n) | n = 0,...,\frac{L_{f}}{2^{H-1}} \right \}$

Where AHC are the approximation coefficients of the DWT H level and Lf are the samples where the DWT was applied.

Is the calculation for the 4th cumulant correct? Am I missing something?

Hope someone can help me, thanks


texts: Weird ringing at signal start and end for default Matlab lowpass filter

texts:
**FIND UPDATES BELOW THE ORIGINAL QUESTION TEXT:
I am trying to lowpass filter electrophysiological data and I see ringing near sharp transients at signal start and end.
Ringing at start:

Ringing at sharp transients:

I am simply using Matlab's default lowpass filter:
fpass=1000;
f_sampling=20000;
fil_X=lowpass(X,fpass,f_sampling);

Two questions:

Why do I see the weird ringing effect at signal start and end?
What strategies can I use for reducing the ringing (both at start/end and at sharp transients) other than reducing the steepness of the filter in the frequency domain? Can some fancy windowing be of help? I tried forcing Matlab to use IIR filter with filtfilt and the ringing stays the same.

Thanks,
Anand
UPDATES:
Padding the signal at start and then removing the padded portion from the filtered trace gets rid of the ringing at start. Thanks!!
For the other problem, I tried an IIR filter without filtfilt. Ignore the unnecessary double filtering. I do it because lowpass automatically applies filtfilt.
[~,ft_obj]=lowpass(X,fpass,f_sampling,'impulseresponse','iir');
fil_X=filter(ft_obj,X);

Here is what I get:

As you can see, it gets rid of the pre-transient ringing, while introducing post-transient ringing. The post-transient ringing should not be a big issue. But, there is also a signal delay/distortion that becomes clear at the same time point across different conditions (red line). That can shift the absolute and relative timing of events in the signal.
Is there a way to compensate for that?


texts:
I got this problem wrong, but I'm not sure why. I know that the FT of a signal is fully determined within 1 unit cell of a reciprocal lattice and outside this range are replicas. Here's the problem:

Edit: I didn't add it originally because I thought it wouldn't display well, but here's a screenshot of the exact solution I was given:


texts: Non-coherent FSK and Orthogonality and square-law detectors

texts:
This is a basic figure that explains how Non-Coherent FSK actually works. The incoming signal
$ r (t)=\sqrt{2 P}{Cos}(2 \pi  t (\text{fc}+\text{fi})+\text{n(t)}$
where P denotes the signal power in Watts, $T$ denotes the symbol
time in seconds, $f$, $i$ $s$ the carrier frequency in Hz, Also, n(t) denotes the
AWGN with single-sided power spectral density $No. T.
Now this incoming signal matches to integrator output
$ Zck =\int _ 0^T r(t) \sqrt{2 P}{Cos}(2 \pi  t (\text{fc}+\text{fi})+\text{n(t)}$  equation- 1
Similarly, the quadrature integrator output $Zs,k$
$ Zsk =\int _ 0^T r(t) \sqrt{2 P}{Sin}(2 \pi  t (\text{fc}+\text{fi})+\text{n(t)}$ $  equation- 2
Eventually in $fc$ terms are canceled out by low -pass-filters and we are left with other terms.
I tried to solve it by putting r(t) into equation-1 and integrated it. The end result is this
Similarly to the quadrature integrator output $Zs,k$  the end result is

In the end, I added them and got $1T$ and Noise.
My question is what happens to other integrators where the miss-matching occurs, how we get 0 from it. As this is Non-coherent FSK and spacing is $1/T$ so should we put 1/T instead of fi-fi in equation-1 and 2 to get zero from these orthogonal functions?   like the same equations, 1 and 2 now become?


texts:
As i read, IQ sample doesn't need nyquist criteria. What is the mathematical representation of this result? Why IQ sample doesn't need nyquist frequency? I know that can be set to nyquist frequency but i want to know why not equal nyquist frequency at least.
Thanks for answers..


texts: How to perform a permutation analysis of PSD?

texts:
I am new to Python & MNE Python. I want to perform a permutation analysis between the PSD of two conditions (1 & 2), across all subjects. I've written the following code for data that I have yet to collect, is it too simplistic?

def psd(epochs, event_id1, event_id2, raw=raw, events=events, eeg_picks=eeg_picks, reject_criteria=reject_criteria):
    epochs.plot_psd(fmax=40, average=True, spatial_colors=True)
    #epochs.plot_psd_topomap(ch_type='eeg', normalize=True)

    epochs1 = mne.Epochs(raw, events, event_id1, picks=eeg_picks, baseline=None, reject=reject_criteria, preload=True)
    epochs2 = mne.Epochs(raw, events, event_id2, picks=eeg_picks, baseline=None, reject=reject_criteria, preload=True)

    plt.subplot(211)
    epochs1.plot_psd(fmax=40, average=True, spatial_colors=True)
    plt.title('Condition: ' + str(event_id1))

    plt.subplot(212)
    epochs2.plot_psd(fmax=40, average=True, spatial_colors=True)
    plt.title('Condition: ' + str(event_id2))

    #Epoch power
    epoch1psds, epoch1freqs = psd_multitaper(epochs1, fmax=40, n_jobs=1)
    epoch2psds, epoch2freqs = psd_multitaper(epochs2, fmax=40, n_jobs=1)
    [10. * np.log10(psds) for psds in [epoch2psds, epoch2psds]]
    return epoch1psds, epoch1freqs, epoch2psds, epoch2freqs

epochs1_power = []
epochs1_freqs = []
epochs2_power = []
epocsh2_freqs = []

for subj in epochs_all:
    epoch1_power, epoch1_freqs, epoch2_power, epochs2_freqs = psd(subj, 94, 73)
    epochs1_power.append(epoch1_power)
    epochs2_power.append(epoch2_power)
    epochs1_freqs.append(epoch1_freqs)
    epochs2_freqs.append(epoch2_freqs)

# Perform the permutation test
T_obs, clusters, cluster_p_values, H0 = \
                   mne.stats.permutation_cluster_test([epochs1_power, epochs2_power],
                                                      tail=0, n_permutations=1000,
                                                      n_jobs=8)

Thank you! I would appreciate any pointers as I hope to get better at analysing EEG data in python :)


texts: Why convolution is required, or what is the philosophy behind convolution?

texts:
I am working in digital image restoration field. I have read all things about convolution, that, for an LTI system, if we know its impulse response, then we can find its output by just using convolution between input and impulse response.

Can anyone tell me that what is the main mathematical philosophy behind it? Your experience with will tell more to me than just internet surfing about it.


texts: Calculate average mean FFT Magnitude in bins

texts:
I am analyzing sounds of daily activities recorded by a smartphone. For example walking, getting up from bed, falling, running etc.. (one at the time).
Let’s take one them. My goal is to

convert from time domain to frequency domain
divide it in bins of 10 Hz wide
calculate the average FT magnitude in each of these bins.

My questions are:

Which FFT Magnitude spectrum should I use between the following graphs?
How should proceed to divide my signal (99144 total samples with 44100 sample rate) in 10 Hz bins? Can I achieve this just by using Matlab's pwelch function?

-> Here the frequencies of the single-sided magnitude are 0 – 22000 Hz -> Which means I should have 2200 bins of 10 Hz
-> Should I just create a new array and put the average mean of all values between 0 – 10 Hz,  10 – 20 Hz and so on?

[signal,fs]=audioread(filename); % fs = 44100
N = length(signal); % N = 94144

%% Single-sided magnitude spectrum with frequency axis in Hertz
% Each bin frequency is separated by fs/N Hertz.
X_mags = abs(fft(signal));
bin_vals = [0 : N-1];
fax_Hz = bin_vals*fs/N; % conversion Hz - Bins
N_2 = ceil(N/2);
figure;
subplot(4,1,1);
plot(fax_Hz(1:N_2), X_mags(1:N_2))
xlabel('Frequency (Hz)')
ylabel('Magnitude');
title('Single-sided Magnitude spectrum (Hertz)');
axis tight

%% Single-sided magnitiude spectrum in decibels and Hertz
X_mags = abs(fft(signal));
bin_vals = [0 : N-1];
fax_Hz = bin_vals*fs/N;
N_2 = ceil(N/2);
subplot(4,1,2);
plot(fax_Hz(1:N_2), 10*log10(X_mags(1:N_2)))
xlabel('Frequency (Hz)')
ylabel('Magnitude (dB)');
title('Single-sided Magnitude spectrum (Hertz)');
axis tight

%% Single-Sided Amplitude Spectrum
NFFT = 2^nextpow2(N);
Y_NFFT = fft(signal,NFFT)/N;
f_NFFT = fs/2*linspace(0,1,NFFT/2+1);
subplot(4,1,3);
plot(f_NFFT,2*abs(Y_NFFT(1:NFFT/2+1)))
title('Single-Sided Amplitude Spectrum of y(t)')
xlabel('Frequency (Hz)')
ylabel('|Y(f)|')

%% Pwelch defaut values
subplot(4,1,4);
pwelch(signal,[],[],[],fs);
title(sprintf('Pwelch defaut values'));


texts: Regarding the advantages of generalized linear phase filters

texts:
I know that for a linear-phase filter with frequency response given by
$$H(e^{j\omega}) = |H(e^{j\omega})|e^{j\phi(\omega)} $$
if the input of the system is
$$x[n] = s[n]\cos[\omega_0 n] $$
where $s[n]  $ is a narrowband signal with bandwidth $W\ll\omega_0$, then
the output of the system is approximately
$$y[n] \approx |H(e^{j\omega_0})|s[n-\tau_g]\cos[\omega_0 (n -\tau_p)] $$
(if $\tau_g$ and $\tau_p$ are integers) where
$$\tau_g =\left.-\frac{d\phi(\omega)}{d\omega}\right|_{\omega=\omega_o} $$
$$\tau_p =\left.-\frac{\phi(\omega)}{\omega}\right|_{\omega=\omega_o} $$
A broadband signal can be thought as a superposition of narrowband signals, this means that if we have a filter with linear phase (i.e.  $\phi(\omega)= \tau\omega$)
both group delay and phase delay are constant and equal, therefore all the narrowband signal packets will be shifted in the same amount.
But what about generalized linear phase filters? In this case $$\phi(\omega) = n_d \omega + \phi_o $$
so the output of a narrowband input centered at $\omega_0$ will now be
$$y[n]= |H(e^{j\omega_0})|s[n-n_d]\cos\left[\omega_0\left(n -n_d-\frac{\phi_0}{\omega_0}\right)\right] $$
and the term $\frac{\phi_0}{\omega_0} $ will differ from one signal packet to another as the center frequency ($\omega_0$) of each packet changes.
So why are generalized linear phase filters as important  as linear phase ones? Isn't the term $\frac{\phi_0}{\omega_0} $ important?

The only related question I could find here did not have a complete answer to my question.


texts:
I want to simulate a multipath fading channel, different amplitude and delay is given. I want to use delay in padding style. I read that the different values for delay like [0 .6 3.1 ...] represent the delay between the first and last signal arrival? Giving the number of paths, How to simulate it?
regards


texts: Weird resampling artifacts of a periodic signal

texts:
I am trying to grab time series data from a database storing data on a propritary format. When i chose a resolution which is not a multiple of the power of two of the sampling resolution i get these weird staircase, quantised artifacts. Does any one know why this might be?

$6$ times the sampling resolution">
$4 (2^2)$ times the sampling resolution">


texts: Showing that filtering a signal with bandwidth B with a brickwall filter of bandwidth W>B has no effect in time domain

texts:
The time-domain representation of $G(f) H(f)$, where $H(f)$ is an ideal brickwall filter of bandwidth $1/(2T)$ is:
$$
\int g(\tau) \operatorname{sinc}\left(\frac{t-\tau}{T}\right) d\tau
$$
I want to show (using algebra, in the time domain) that the result of the above equation equals $g(t)$ if the bandwidth of $g$ is less than $1/(2T)$. This is something trivial to see in the frequency domain.
But how in the time domain, using convolution integrals?
By definition, if $g$ is bandlimited to $1/(2 T_g)$, I can expand it using the WKS interpolation formula, having the samples as coefficients:
$$
g(t) = \sum_{n=-\infty}^{\infty} g(n T_g) \operatorname{sinc}\left(\frac{t-n T_g}{T_g}\right)
= \sum_{n-\infty}^{\infty} g[n] \operatorname{sinc}\left(\frac{t-n T_g}{T_g}\right)
$$
Plugging this into the original equation:
$$
\int \sum_{n=-\infty}^{\infty} g(n T_g) \operatorname{sinc}\left(\frac{\tau-n T_g}{T_g}\right) \operatorname{sinc}\left(\frac{t-\tau}{T}\right) d\tau \\
= \sum_{n=-\infty}^{\infty} g(n T_g) \left[ \int \operatorname{sinc}\left(\frac{\tau-n T_g}{T_g}\right) \operatorname{sinc}\left(\frac{t-\tau}{T}\right) d\tau \right]
$$
From that, the term in bracket would need to be equivalent to $\operatorname{sinc}\left(\frac{t-n T_g}{T_g}\right)$ if $T \leq T_g$. But I don't see this working out


texts:
Hello everyone have a look at this video of Fourier Decomposition of an image(otherwise you can also refer the image which shows few plots of different extracted waves from an image) . We also know that a Fourier series is given as

$$\frac {a_0} 2 + \sum \limits _{m=1} ^\infty (a_m \cos \frac {2 \pi m t} T + b_m \sin \frac {2 \pi m t} T)$$

1.In the given video at bottom middle there is plot of extracted waves.My doubt is whether these waves means cosine (or sine) functions from the Fourier series formula?

2.What is mean by bases functions(or images)? Whether the plot of Extracted waves are called as bases functions here?

Note:Although above Fourier Formula is for 1D signal and video is of 2D image,please keep in mind Fourier series formula for 2D signal.


texts: Can't implement correctly Python IIR and FIR Filters

texts:
I'm trying to implement 2 lowpass filters and see the difference between them from plots( one FIR filter that needs to be designed with the Hann window method and another IIR filter using Chebyshev type I). The problem is that I can't make 2 correct plots to see the difference between them and I don't know exactly if they are correctly implemented...I have fc1,fc2, ft, rp and rs as parameters. Here it's my python code:

 import matplotlib.pyplot as plt
 import scipy.signal as signal
 import numpy as np

def plotInTime(x,fs):
    t=np.arange(0,np.size(x,0)/fs,1/fs)
    plt.figure()
    plt.plot(t,x)
    plt.xlabel('Time (s)')
    plt.ylabel('Amplitude')
    plt.grid(True)

def plotInFrequency(x,fs):
    N=int(np.size(x,0)/2)
    if np.size(x,0)==1:
        X=np.fft.fft(x,axis=1)
    else:
        X=np.fft.fft(x,axis=0)
    X=np.abs(X)
    X=X[:N]
    f=np.arange(0,fs/2,fs/2/N)
    plt.figure()
    plt.plot(f,X)
    plt.xlabel('Frequency (Hz)')
    plt.ylabel('Magnitude')
    plt.grid(True)

fs, x = readWav('Ring05c.wav')

plt.close('all')
plt.figure(figsize=[12,12])
plt.subplot(3,2,1)
plotInTime(x,fs)
plt.title('Original Signal')
plt.subplot(3,2,2)
myDSP.plotInFrequency(x,fs)
plt.title('Spectrum for the Original Signal')

fc1=1200
fc2=3000
fc= np.arange(fc1,fc2+1)
ft=150
rp=0.1
rs=40
t = np.linspace(-1, 1, 201)
L, Wn = signal.cheb1ord(fc1/(fs/2), fc2/(fs/2), rp, rs);
b, a = signal.cheby1(L, 1, Wn,'low')
h = signal.lfilter(b, a,x,axis=0)
plotInFrequnecy(h,fs)
w=signal.hann(65) #idk what to do after this


texts: Understanding Cb and Cr Components of YCbCr Color Space

texts:
I am familiar with additive (RGB), substractive (CMYK), and HSV-like colorspaces, but an article I'm currently trying to understand operates on YCbCr color space for image segmentation / object definition.

I've spend most of my morning looking for something that would explain the YCbCr naturally, but I just don't get it. I got a nice, intuitive explanation of the general idea behind this color space here, and explanation of how it's used for image coding/compression from these guys (all on photo.SE).

The formulas for calculating YCbCr from RGB is readily accessible on wikipedia.

I got the motivation for this representation, I got that Y component contains the most important (to the human eye) grey-scale information about the image.

I got that Cb and Cr carry information about the colors, and that (because of human eye (in)sensibility), they can be compressed without a visible lost in quality. But, what does each of the chrominance components actually represent?

As the article authors mention that "chrominance information is paramount in the definition of objects" in their approach, and I can not fully understand what I'm reading with my current "Y is intensity, Cb and Cr carry color information somehow" level of understanding YCbCr.

I'm seeking for an answer along the lines "Cb is..., while Cr is..." or "if you imagine looking through/with XY, you're actually looking at Cb component...", or some other way that would help me understand information carried by each of the components separately,  not just that they, together, carry color information.

EDIT

Let me give examples of intuitive explanations for other color spaces of the type I'm looking for:

RGB: Like shining a colored flashlight on a black wall: If you shine with a blue flashlight, you see a blue reflection. If you add a red flashlight, it will show a magenta reflection, which is a mixture of blue and red.

CMYK: Like mixing watercolors, you "add to the colors the surface reflects", (i.e. subtracts color from the background) so if you mix a yellow one with a cyan one, if will reflect green and thus you will get a green color.

HSV: Little kids are attracted to highly saturated objects, not bright (value). The Hue component is what "gives the color", while low saturation means the color is "diluted" by white. Change in value makes the whole thing brighter or darker.

With this definitions, I've been able to get an intuitive feeling about what a color representation in each color space means, without memorizing charts for each of them.


texts:
Assume we have communication system between transmit and receive over wireless channel.

The Friis path loss model is given by the following equation

$$P_r = P_t G_t G_r (\frac{\lambda}{4\pi D})^2$$

Where $P_{r(t)}$ is the received (transmit) power, $G_{t(r)}$ is the gain of the antennas at transmitter (receive) and $\lambda $ is the signal wavelength while $D$ is the distance between transmit receive ends.

In theoretical (academia) and simulation scenarios (for example MATLAB)I have come across examples wireless channel where a power delay profile is defined, that is time of arrival (TOA) of rays versus amplitude of those rays. For example, assume I have five rays arriving and delay spread $40 ns$ with amplitude

$$channel= [ 0.5+i0.5, 0.3+i0.3, 0.2+i0.2, 0.1+i 0.1, 0.3 ] $$

$$TOA= [0, 10*10^{-9} , 20*10^{-9}, 30*10^{-9} , 40*10^{-9}]$$

My simple question is: How are the two concepts related??

Thanks


texts: What is the algorithmic latency of STFT processing?

texts: I was reading this paper, and in section 3 I got a bit confused. It claims that the algorithmic latency is equal to synthesis frame length. If the overlap between two consecutive frames is 50%, the algorithmic latency should be the half of the window size. What am I misunderstanding here?


texts: Estimation algorithms for Multi-User MIMO

texts:
I am interested in a question how to estimate a channel/symbol in a multi-user system. In the case of a single-user, it can used ZF/ pilot estimation/ MS/ LS algorithms. Do we have a difference in using these algorithms if we consider a multi-user system?
In the multi-user case, one signal is transmitted via some number of channels ( = number of users). As a result of the estimations algorithms, we get some number of detected signals and channel estimates.
If there is no difference in estimation algorithms, why are algorithms for multi-user studied as a separate issue?
in case of estimation of the transmit data ( e.g ZF), there are different channel, it means ZF gives different estimates of the transmit data, doesn't?


texts: Matlab IIR cheby2 bandpass, problems with Magnitude

texts:
I am trying to implement an IIR bandpass in Matlab. There are two things I don't understand. But first of all, let me post the code.

fs = 50000; %Hz
f1filter = 1000;  %Hz
f2filter = 2000;  %Hz
filterOrdnung = 6;   %erzeugt (2 * filterOrdnung) Filterkoeffizienten
anzahlFilter = 5;    %Anzahl der zu berechnenden Filter zur Auswertung
schrittweiteVerschiebung = 1000;  %Verschiebung in Hz
astop = 20;           %Verstärkung an den Bandgrenzen des Bandpasses
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

k = zeros(anzahlFilter, 1);                 %Vektor für Gain

z = zeros(2*filterOrdnung,anzahlFilter);    %Matrix für
                                            %Nullstellen

p = zeros(2*filterOrdnung, anzahlFilter);   %Matrix für
                                            %Polstellen

sos = zeros(anzahlFilter * filterOrdnung + (anzahlFilter - 1), 6);  %Matrix für Filterkoeffizienten
[z(:,1), p(:,1), k(1,1)] = cheby2(filterOrdnung, astop, [((2*f1filter)/fs)...
    ((2*f2filter)/fs)]);

[sos(1:6,:), g] = zp2sos(z(:,1),p(:,1),k(1,1));    %Output form:[b01,b11,b21,1,a11,a21
                                                   %             b02,b12,b22,1,a12,a22
                                                   %             b0N,b1N...........a2N]

fvtool(sos(1:6, :),'Analysis','freq');

So I want to create a bandpass of the bandwith of 1000Hz to 2000Hz. The filter order is the 6th order and the stop attenuation should be 20dB. I want to have the Structure of second order form.
(By the way, is there any specific Matlab function to create an IIR filter as a cascade of Directform II structures?)

I am creating "sos" much larger than I need it to be now because I want to create several different bandpasses, but let's just focus on this example.

1)First question: Why do I receive 12 numerator and 12 denominator coefficients when I only have 6th order IIR? In the books I have read, that for a 6th order IIR I should receive 7 numerator and 7 denominator coefficients, with the first denominator coefficient = 1.

2)At the header of the code, I declare astop as 20dB. The Matlab documentation of cheby2 tells me, that this is the attenuation of the stopband. But when I let the code run and look at the magnitude, the magnitude of the passband is about 20dB. I expected it to be 0dB while the stopband should be -20dB. The normed frequencys seem to be about correct though.
I hope I could explain my problems well enough.


texts:
I have a problem in which i have a video that was taken from the side of the subject, something like this

 and i need to transform the coordinates of the subject to be as if the photo was taken from above like this

I have the real set of coordinates that i can relate to from picture 2 to picture 1 , i only need to transform the coordinates of the moving subject, not the whole picture.

I tried using polynomial regression in order to approximate the right transformation, but it failed to work (i can see that it's not the true movement).

also i have a problem that the video is taken with a fish eye lens.

what is the right way to approach it? or if you can direct me to the appropriate papers? (i never done image processing before).

many thanks,


texts:
I need to do a DFE for QPSK simulation in MATLAB.
The system consists of a QPSK signal transmitted with power = 1 which is then pulse shaped with a square raised-cosine filter. Add AWGN and a filter receptor with ISI = [0.25 1 0.25].

Summarizing and clarifying, the sequence is:

QPSK signal -> Upsample -> Rcosine -> AWGN -> ISI [0.25 1 0.25] -> Downsample -> DFE -> BER counting.

I have coded the algorithm, with guidance from Dig. Comm. Lee-M., but I am thinking about problems with the Feed-Forward filter. The objetive is to obtain a signal with NO ISI, and the correct BER for a given SNR.

The code is:

% DFE.
tapsffe=7;
tapsdfe=8;
% Gain
betaf=0.0001;
betab=0.0001;
% Coefficients init. Ck for FFE and Dk for DFE
ck=zeros(1,tapsffe);
ck(7)=1;               % Last tap for FFE=1
dk=zeros(1,tapsdfe);

% Signal to filtering
rk=zeros(1,tapsffe);  % Signal to filter in FFE
ak=zeros(1,tapsdfe);  % Signal to filter in DFE

% Filtered signal, and correspondings error
n=length(s6);
s7=zeros(1,n);
e7=zeros(1,n);

for k=1:n

    rk = [s6(k), rk(1:tapsffe-1)]; % FILTERING in FFE

    % Output from Feed-Forward and FeedBack
    ykf = sum(rk.*ck);
    ykd = sum(ak.*dk);
    yk = ykf-ykd;

    % Slicer for QPSK. sqrt(2) for POWER = 1.
    dec = (-1*(real(yk)<0)+1*(real(yk)>=0) + 1i*(-1*(imag(yk)<0)+1*(imag(yk)>=0)))/sqrt(2);

    % Obtained value for filter ecualized signal
    s7(k) = dec;

    % Error:
    error = dec-yk;
    e7(k) = error;

    % Coefficient adaptation
    ck = ck - betaf*error*conj(rk);
    dk = dk + betab*error*conj(ak);

    % FILTERING for Feedback filter with SLICER decisions
    ak = [dec, ak(1:tapsdfe-1)];
end

Apparently I have problems with the FFE, because I do not see ck taps to accommodate to the inverse of the channel response with ISI. I have little doubt of its coefficients adaptation. Signal for BETA, and adaptation for ck with the corresponding rk, or the fliplr coefficient...


texts: what is the difference between LMS and MPC?

texts:
I do understand that MPC is a control method and requires known model in the feedback path.
LMS, on the other hand, is more like an adaptive filtering, which estimates the tap coefficients yielding the minimum mean squared error. Plus, LMS does not require known model.
Besides the differences I mentioned above, what is the difference between LMS and MPC, and when would one use LMS (or MPC) over the other?


texts: Matching input buffer size to opus frame size

texts:
I am working on an audio effect that passes it's input though the opus codec. I want the effect to be a VST, so I don't have control of the input buffer size and the sample rate. However, opus requires a sample rate of 48Khz and frames of 120, 240, 480, 960, 1920, or 2880 samples. What is the best way to convert from an arbitrary frame size and sample rate to a known one? A loss of fidelity is OK.
Here is the signal chain as I understand it:

Audio comes from a VST host application such as Ableton Live.
I'm using JUCE as a library for creating the plugin so the audio is then past to the internals of JUCE.
JUCE calls the processBlock method on my plugin with an audio buffer. When testing I can force this audio buffer to be a certain size, but I want to support hosts with arbitrary sized buffers.
I need to somehow convert from the host buffer size, back to a frame size supported by opus. This is where my question resides.
I call opus_encode_float on the buffer to compress the data. This introduces sonic artifacts I want to keep.
I call opus_decode_float on the compressed data. This gives me back a buffer the size of a valid opus frame.
I need to then convert this back to a size the host is expecting (same size as the input buffer).


texts: Computing SSD/SSE using pattern with omitted pixel

texts:
The goal is to compute a weighted SSD over a small neighborhood of pixels (Np pattern in the following figure)

I want to know why the bottom-right pixel is omitted:

It is said that to enable SSE-optimized processing but I didn't really understand it!

This is the link for the PDF: http://vision.in.tum.de/_media/spezial/bib/engel2016dso.pdf

and it is the figure - 4


texts:
I have noisy images from which I extract the contours using OpencCV's findCountours, which performs binarization internally. This results in innumerable small outlines made of three or four pixels, which I would like to avoid.

I want to discard these, either before extracting the contours, or during that step. I could binarize the image myself and use a size filter (i.e. erase the blobs tiny in area), or I could use a variant of the contouring function that implicitly discards the very short outlines.

But I can't find OpenCV functions that look like this. Any hint ?

Note that I don't want to use any denoising function, as it will degrade the signal. I don't want to erode either, for the same reason.

Example of outlines to be discarded (don't mind the annotations):

I am not asking to get rid of all noisy blobs, but of the smallest ones.


texts: How do I calculate the frequency of the highest amplitude wave?


texts: Invariance of curvature in Curvature Scale Space

texts:
PDF is here

I have read this PDF. But i don't know what the Invariance means in page 3 and 5. Calculation/estimation of κ is NOT invariant and Invariant to viewpoint. What's the meaning of these sayings? When i read "Invariant to viewpoint", i think it means the k value is same when rotation and translation. But after i read "Calculation/estimation of κ is NOT invariant" ,i have no idea. Then i try the code what i got here,to caculate the k value.

Code is here

And i have found that, the k value is different when shape have rotated which have the same sigma. Then i changed the sigma, k value is also different while the shape is same. When i set the sigma as 0.6667, the curvature of straight line is 1.6 not 0, why? The curvature of straight line should be zero,right? I don't why the value is 1.6. Then I tried to rotate the straight line, the curvature changed!!new value is -6.6. The papge said to find zero crossing to get concave-convex. But here curvature of straight line is not 0 is 1.6? Can somebody help me. Thank you very much!


texts: is any filter whose impulse response has a discontinuity in the first derivative fundamentally high-pass?

texts:
a triangular (bartlett) window has a kink (discontinuity in first derivative).  thinking in the continuous (not discrete) case, my intuition is that the fourier transform of any window with a kink must asymptote to a non-zero value (rather than exponentially decay), since it should take infinitely high frequencies to be able to sum to a precisely sharp "corner."  treated as the kernel (impulse response) of a filter, this would correspond to passing arbitrarily high frequencies.

is this right?  in general, how do i calculate the asymptotic value, and why isn't this a standard quoted feature of a window?


texts: How to plot and normalize a spectrum in matlab

texts:
I am given the coefficients of an FIR filter. I have created its impulse response through a convolution with a unit pulse. Now I want to plot the frequency spectrum. I perform zero-padding and windowing with a blackman-window. This does not seem to have a big effect on my result though. Still, I wonder: For some reason my amplitude of the resulting spectrum is not normalized correctly. Can somebody see what I am doing wrong?

fs = 44100;%sampling frequency
Ts = 1/fs; %time step
t = 0:1/fs:2-Ts; %signal duration

unit_pulse = zeros(length(t),1);
unit_pulse(1) = 1;

b = [1/8 1/8 1/8 1/8 1/8 1/8 1/8 1/8];
ir_filter = filter(b,1,unit_pulse);

nfft = length(ir_filter); %length of the time domain signal
%in order to obtain a good frequency resolution, pad the signal with zeros
%such that the length of the signal is a power of 2
no_zeros = (2^nextpow2(nfft)-nfft)/2;
padding = zeros(no_zeros,1);
signal = vertcat(padding, ir_filter, padding);
windowed_signal = signal .* blackman(length(signal));

spectrum_2side = real(fftshift(fft(windowed_signal))) ./ nfft;
f_2side = linspace(-fs/2, fs/2, length(windowed_signal));
spectrum_1side = 2*spectrum_2side(end/2+1:end);
f_1side = f_2side(end/2+1:end);

fig2 = figure();
hold on
grid on
plot(f_1side, spectrum_1side, 'b');
plot(f_2side, spectrum_2side, 'r');

This is a figure of what the impulse response looks like:


texts: Finding arbitrary/random repetitive patterns in signals (both self and across two signals)

texts:
I am trying to figure out a direction for my research. I need to find random repetitive patterns between two signals and on each individual signal. I have read about FFT and time series-motif discovery(matrix profiles). Is there a concrete way (maybe using machine learning or some regret reward methods) to find "Unknown patterns" in signals in general.

Thanks in advance! :)


texts: Matlab HIgh frequency sine wave generation

texts:
I need to generated a high frequency sinusoidal signal for modulation in MATLAB. But it turns out to be something weird. This is the simple code snippet I used...

t = 0:0.001:100;
A = 1;
s = A*sin(2*pi*1e9.*t);  %1 GHz signal
plot(t, s);
title('Modulating Signal');
xlabel('Time');
ylabel('Amplitude');

Instead of the sine wave I am getting something weird like this..


texts:
Suppose we have a time series which have peaks and troughs.(The red curve below)

I would like to get an algorithm which is able to identify the peaks and troughs locations, then find the midpoint between every peak and trough in both X,Y coordinates (the orange points below)

Then connect those midpoints by spline. (the blue line below)

How can I accomplish it using matlab or so? or there is a common solution for such problem?

Thanks in advance,


texts: What is the physical meaning of coherence bandwidth in mmWave massive MIMO channel?

texts:
I am doing some research about millimeter wave massive MIMO channel now.
We first take account about static MIMO channel, cause we only have SISO measurement system now.
We use scanner to move our antenna to simulate it as array antenna to measure the static channel.
Afterwards, using signal processing method to simulate static MIMO channel.
There are some paper that doing the similar research, they analysis the coherence bandwidth at different antenna element. But I can't realize what the purpose of studying that issue. Is that related to some other MIMO  techniques?

As far as I know, coherence bandwidth is corresponding to multi-path delay spread, and is an indicator to distinguish whether the channel is flat-fading or not.

In the other point side of view, I also study multi-path MIMO channel model. The model is represent as below

It shows that multi-path would cause difference phase shift owing to the steering array. However, I can't realize what the model is associated with coherence bandwidth at each element.

Can someone please help me or provide some idea. Thanks in advance

reference ： R. W. Heath, N. González-Prelcic, S. Rangan, W. Roh and A. M. Sayeed, "An Overview of Signal Processing Techniques for Millimeter Wave MIMO Systems," in IEEE Journal of Selected Topics in Signal Processing, vol. 10, no. 3, pp. 436-453, April 2016.


texts: Current harmonics via FFT -- do peaks matter?

texts:
Typically, one would perform an FFT on a current waveform and measure it's magnitude at multiples of the line frequency (e.g. 50Hz, 60Hz) to get the harmonics, and subsequently the Total Harmonic Distortion.

If I know that my line frequency should be 50Hz but the FFT peak is not exactly at 50Hz (say, it is 55Hz), then what is my fundamental?  50Hz or 55Hz?
How about the harmonics?  Should I then measure at multiples of 50Hz or 55Hz?
If say my fundamental peak is exactly 50Hz, but my second FFT peak is at 110Hz, where should I measure the 2nd harmonic?  100Hz or 110Hz?  In other words, should I seek out the peaks?
Lastly, THD is usually defined to take the sum at multiples of the fundamental.  What if my FFT peaks are not exactly at multiples of the fundamental?

Update:
- I was trying to measure THD for my power supply with line frequency of 50Hz. If measure the peak of the FFT, it's 50.35Hz. If I record that as the fundamental, the fractional points add up in the subsequent harmonics (e.g. for the 29th harmonic, the value becomes 1460.26 vs 1450 if 50Hz was used as the fundamental).  From the FFT plot, clearly 1450 is the peak, while 1460 is not.
- Should I look for peaks at each harmonic?


texts:
This question is regarding digital modulation.

If 64 QAM always provides rates greater than BPSK or 16 QAM, then why do systems always use higher order modulation of QAM?

Thanks


texts: Fourier coefficients of discrete difference of a square wave

texts:
I have a discrete square wave $f(t)$ where $t \in \mathbb{N}$, of amplitude $A$, period $T$ and duty cycle $1/T$
$$
f(t) = \left\{\begin{matrix}
A, & \mathrm{if}\;t=Tn\\
0, & \mathrm{if}\;t\neq Tn
\end{matrix}\right.
\;,\; n \in \mathbb{N}
$$
size = 23
T = 5
A = 10
t = np.arange(size)
f = np.zeros(size)
f[t%T==0] = A
fig, ax = plt.subplots(figsize=(12, 5))
ax.step(t, f)
ax.set(
    xticks=t,
    xlabel='time $t$',
    ylabel='amplitude $A$',
    title=f"Square wave of amplitude {A}, period {T} and duty cycle 1/{T}"
)
plt.show()

Given the Fourier series
$$
\mathcal{F}[g(t)] = a_0
+ \sum_{h=1}^{\infty} a_h \cos(2 \pi h \nu \cdot t)
- \sum_{h=1}^{\infty} b_h \sin(2 \pi h \nu \cdot t)
$$
for this square wave
$$
a_0 = \frac{A}{T}
$$
$$
a_h = \frac{2A}{\pi h} \sin \left( \frac{\pi h}{T} \right)
$$
$$
b_h = 0
$$
so
$$
\mathcal{F}[f(t)] = \frac{A}{T} + \sum_{h=1}^{\infty} \frac{2A}{\pi h} \sin\left(\frac{\pi h}{T}\right)
\cos\left(\frac{2 \pi h}{T} \cdot t\right)
$$
where the Fourier coefficients of harmonic $h$ is $\frac{2A}{\pi h} \sin\left(\frac{\pi h}{T}\right)$.
The discrete difference of $f(t)$
$$
f'(t) = f(t) - f(t-1)
$$
is the sum of two square waves $f(t)$ and $-f(t-1)$ with opposite amplitude and shifted by a sample unit
$$
f'(t) = \left\{\begin{matrix}
+A, & \mathrm{if}\;t=Tn\\
-A, & \mathrm{if}\;t=Tn+1\\
0, & \mathrm{otherwise}
\end{matrix}\right.
\;,\; n \in \mathbb{N}
$$
t1 = t[1:]
f1 = np.diff(f)

fig, ax = plt.subplots(figsize=(12, 5))
ax.step(t1, f1)
ax.set(
    xticks=t,
    xlabel='time $t$',
    ylabel='amplitude $A$',
    title=f"Discrete difference of a square wave of amplitude {A}, period {T} and duty cycle 1/{T}"
)
plt.show()

We can thus say (is it correct?) that the Fourier series of $f'(t)$ is the sum of the Fourier series $\mathcal{F}[f(t)]$ and $\mathcal{F}[-f(t-1)]$
$$
\mathcal{F}[f'(t)] =
\left[
\frac{A}{T} + \sum_{h=1}^{\infty} \frac{2A}{\pi h} \sin\left(\frac{\pi h}{T}\right)
\cos\left(\frac{2 \pi h}{T} \cdot t\right)
\right]
-
\left[
\frac{A}{T} + \sum_{h=1}^{\infty} \frac{2A}{\pi h} \sin\left(\frac{\pi h}{T}\right)
\cos\left(\frac{2 \pi h}{T} \cdot (t-1)\right)
\right]
$$
$$
\mathcal{F}[f'(t)] =
\sum_{h=1}^{\infty} \frac{2A}{\pi h} \sin\left( \frac{\pi h}{T}\right)
\left[
\cos\left( \frac{2 \pi h}{T} \cdot t\right) -
\cos\left( \frac{2 \pi h}{T} \cdot (t-1)\right)
\right]
$$
How can I get the Fourier coefficient of harmonic $h$ from $\mathcal{F}[f'(t)]$?
Is there a better way to express the Fourier series of $f'(t)$?

EDIT #1
As @MattL. noticed (see comments) what I'm dealing with is actually a discrete-time signal, so a better representation of the signal would be

and for the discrete difference will look like


texts:
I would like to synchronize two different music tracks (and maintain synchronization) as a DJ would with two records.

So far, I have the beats mapped for each song, so I am able to adjust their rates and time align them accordingly.  What I've found though, with many sample tracks, is that the two tracks will drift out of sync after a while due to the tempos of the songs not remaining constant. I've tried compensating for this by periodically checking the tempos of the songs and re-adjusting their rates so that they are synchronized again by the start of the following measure.

Is there a common (or better) approach of synchronizing two music tracks?


texts: Recover Frame Compression Lossiness from Many Similar Frames

texts: With many very similar frames of video that have been compressed with an unavoidably lossy encoding and available now as jpeg stills, are there available good mathematical techniques for recovering detail by considering multiple frames?  Certain areas of the image are of great interest and the artifacts there change from frame to frame.  Can they be cross-referenced to solve for higher detail?


texts:
I am trying to get a useable wave from a pulse oximeter, but there is a pesky DC bias that keeps changing every now and then, so I cannot simply subtract the DC bias from it and get useable results for long. I also tried to take an appropriate sampled running average, and subtract that from my wave, and it gave me much better results than before.
However, I am told that a DSP high pass filter will work even better, and I am trying to implement that. I am not an electrical engineer and do not have much knowledge about filters, and absolutely no knowledge of DSP. I found this great website that lets me design a DSP filter and gives me a C++ library to use that filter in my code.
The problem is, I want to design a filter that cuts below 1Hz and lets through any frequencies above 1Hz or 1.3Hz max. My oximeter wave is 1.4Hz. But the design tool I mentioned above seems to indicate that it is not possible.
Any help in this would be highly appreciated.
[Edit]
I have finally managed to make it work a bit, but the DC bias is still there. (red line is the data filtered from the filter from that website, blue line is moving average subtracted from incoming signal)

And this is the frequency-gain graph of the filter


texts: A good mathematical explanation of Gibbs phenomenon

texts:
I was explaining to someone how Fourier series work in context of constructing signals that are not everywhere differentiable, e.g. square waves, sawtooth waves, etc. When I mentioned the Gibbs phenomenon however, I realized that I never really learned of why it happens. In fact, as the story goes, not everyone even realized that it's an actual mathematical property of infinite series of periodic signals and not a computational fluke, and it turns out that most proofs are fairly laborious and elaborate.

After reading several of them, I started realizing why such phenomenon might occur, but I have a background in real and complex analysis, topology and so on. The question is can I fully explain and rigorously prove Gibbs phenomenon mathematically to someone with only the basic undergraduate calculus courses in their arsenal (or any other general prerequisites for an undergraduate signal processing course)? If so, then how?


texts: Are there any quick way to tell if a kernel is a high-pass filter?

texts:
Im new in this image processing field so please be gentle with terminology, i have a kernel of 3x3 and i want some way in order to test if its a high pass filter or not

Thanks in advance


texts: Optimally approximating the sign function by functions with compactly supported Fourier transform

texts:
I'm re-posting a question of mine from math.stackexchange in hopes that folks here might have the right kind of expertise.
I'm looking for a systematic way to approximate the sign function
$$\operatorname{sgn}(x) \triangleq \begin{cases}1&\text{ if }x > 0\\
0&\text{ if }x=0\\
-1&\text{ if }x<0\\\end{cases}$$
by functions $f$ whose (distributional) Fourier transforms $\hat{f}$ are compactly supported.
More precisely, let us fix some $\epsilon$ small. Then I am interested in odd, continuous $f$ such that:

$\text{supp}{\hat{f}}\subseteq[-\pi,\pi];$
there exists some $a_f>0$ such that $|f^2(x)-1|<\epsilon$ whenever $|x|\geq a_f$.

Goal: I am looking for a "best" $f$ in the sense $a_f$ is as small as possible.
I figured that one way to do this would to be to look at convolutions $f=a*sgn$ where $a$ is a function that satisfies $\int_\mathbb{R} a(s)\,ds=1$ and $\text{supp }{\hat{a}}\subseteq[-\pi,\pi]$. For example, we could take

$a_1(s)=\dfrac{\sin(\pi s)}{\pi s}$; or
$a_2(s)=\frac{1}{2}\left(\dfrac{\sin(\frac{\pi}{2}s)}{\frac{\pi}{2}s}\right)^2,$

where the Fourier transforms of $a_1$ and $a_2$ are a rectangular and a triangle pulse respectively.
Doing some numerical experiments, I find that for the choice $\epsilon=0.05$, $a_2$ is "better" than $a_1$ by the above criterion.
Question: Is there a more systematic way to find better (or a best) $f$? References that deal with this type of problem would also be appreciated.


texts: How does voice affect a sound wave or its corresponding waveform?

texts: Someone in the physics stack exchange told me to come here for this question. My question is how does a person's voice affect how a soundwave looks? For example, if I say the letter "a" it would sound different than if you said the letter "a", but my question is if there is a pattern to this, or maybe if we are able to derive a waveform based on voice (however it would be affected by multiple other factors due to when I say "a" it is different than when I say "b").


texts: derive an average waveform from an FFT spectrum, where all cycles have same shape and period

texts:
I measured a (real) voltage waveform (red curve below). Then I took its FFT and used the magnitudes of the first 20 harmonics (even and odd) to model the signal (blue trace below), by summing the fundamental and harmonic-related sine wave components as follows:

Vout(t)=A1*sin(wt)+A2*sin(2wt)+A3*sin(3wt)+...+A20*sin(20wt)

I expected a better match between the two curves. What portion of the spectrum am I missing in my model to get a better match?

The model (blue) has symmetrical rising and falling edges, whereas the measured waveform (red) appears asymmetrical (capacitive charging/discharging; that is, the transitions begin sharply then decay). How does the FFT capture this effect if not in the harmonics?

UPDATE

I modified the above equation to include the phase as follows:

Vout(t)=A1*sin(wt-phi1)+A2*sin(2wt-phi2)+A3*sin(3wt-phi3)+...+A20*sin(20wt-phi20)

where phiN is the phase for each harmonic computed from FFT coefficients between 0 and Nyquist frequencies (e.g. atan(imag/real)).

The model (blue) does show an improvement in addressing asymmetric rise and fall transitions, but I'm still missing something.

Is there a way to improve the model based on FFT coefficients as I'm trying to do here, without computing the IFFT explicitly? I'm trying to create a waveform where every cycle is exactly the same, with the same period (within machine error), which represents the waveform of an average cycle (repeated many times).


texts: Given a frequency response obtained with FFT, I would like to apply a 1/n octave smoothing. What filter should I be using and how? Maybe someone could point to a good reference (a paper or book on the subject).


texts: Are convolution and multiplexing synonymous?

texts: Other than preferences to use one or the other words in different domains, do they refer to essentially the same process? And likewise for the opposite operations, demultiplexing and deconvolution?


texts: References ISAR - Inverse Synthetic Aperture Radar

texts:
Anybody know a reference to start understanding ISAR? Book or article.

Thanks!


texts:
My textbook doesn't explain how they got the answer to this question:

"If a transmission channel uses an analog carrier wave that is modulated by eight amplitudes and sixteen frequencies per bit time, then what is the transmission capacity of that channel in bits per bit time?"

I don't understand how they got the answer and I can't find any good sources online to explain it.


texts: Measuring similarity of music, using lossy compression

texts:
I have two sound clips $C_1,C_2$ which are pretty similar.  I'd like to measure how perceptually similar they are, i.e., how similar a human would perceive the two to be.  Is there a way to use a lossy compression algorithm (e.g., a MP3, AAC, or Ogg Vorbis encoder) to compare the two clips?

It occurs to me that that audio compressors already contain a good deal of knowledge about psychoacoustics and human perception of sound, built into them.  Is there a good way to use them to measure how similar the two clips are?

Maybe something like $L(C_1 || C_2) / (L(C_1) + L(C_2))$, where $L(x)$ is the length of the compression of sound clip $x$, and $C_1 || C_2$ is the result of concatenating the two clips?  Or maybe find the highest bitrate such that
$F(C_1)$ is close to $F(C_2))$ via a simple metric (e.g., L2 norm applied to the FFT spectrum), where $F(C)$ is the result of compressing $C$ at that bitrate followed by decompressing it?  Or something else along these lines?  Has anyone studied this?

If it is relevant, the two clips are fairly similar: one was obtained by a transformation of the other.  They are aligned in time and have the same length.  Each is relatively short (at most a few seconds).  I've done some searching but haven't found any reference or research paper that discusses this sort of approach -- maybe I just haven't found it yet, though.


texts: How to correct the phase offset for QPSK I-Q data

texts: I have an I-Q data of QPSK modulation, the data is is smeared and I have to correct the phase offset that causes the smearing problem, how can I apply the Phased-locked loop or the Costas loop on this stage of I-Q data to correct the phase offset problem.


texts: Can the Walsh Hadamard transform be computed for non power of 2 sizes?

texts:
Can the walsh hadamard transform be calculated for odd image block sizes such as 5x5 or 7x7? Most of the examples I've seen are for 4x4 and 8x8?

I fear it probably can't from the description I read on Wikipedia ( though I'm still trying to fully digest that page).


texts:
The top answer to this question: Power spectral density vs Energy spectral density states:

  However if random process is stationary, then it is for sure that it
  has some finite power over some band of frequencies

Why is that? Also, is stationarity a necessary condition for a process to have finite power over a band of frequencies?


texts: Minimizing profile curvature of 2D image

texts:
I have 2D grayscale image representing terrain heights. I am in search
for (fast) algorithm to minimize profile curvature of this image on selected scales (in scale-space sense).

Profile curvature is function of partial derivatives:

$$P_c = - \frac{(dx^2 \times dxx + 2 \times dx \times dy \times dxy + dy^2 \times dyy)}{((dx^2 + dy^2) \times (dx^2 + dy^2 + 1)^{1.5})}$$

and its geometrical meaning is nicely explained by this image:

I came up with completely ad-hoc iterative approach to minimize curvature
at specified scale, but I am little bit lost when trying to apply this accross
all scales (I am trying to utilize Gaussian / Laplacian image pyramids). It works by adjusting heights by adding height offset according to profile curvature at given point (height offset is negative in convex areas and positive in concave areas).

Results for single scale are not completely hopeless though:

Original data:

Processed data:

Result of this procedure should be formation of sharp V-shaped ridges
and valleys.

Is there any mathematically sound approach how to solve this kind of problems ?
Any tips are appreciated !


texts: Extract approximation and detail coefficients

texts: I am a student and would like to know how to extract the approximation and detail coefficients (A5, D5, D4, D3, D2 and D1) after an applied DWT decomposition dB5 (Daubechies 5, level = 5)?


texts:
I have an audio file, in the range of 4 kHz to 120 kHz. I want to remove the lines that are not harmonic and are recognized as environment noise. the energy of the signal in this interval for each time bin is calculated. can I remove the noise using pitch detection?
that is also important to notice that the upper-frequency values are important and they are not noise (I should keep them).


texts: I want to estimate just the spectral amplitudes at different time points using S-transform given a noisy signal. Would I benefit (in terms of noise reduction) from an approach used in multi taper spectral estimation - namely I do several transforms using suitable orthogonal functions (say, DPSS or sine tapers) as windows for the S-transform (instead of default gaussian and scaling the window size the same frequency-dependent way); then average the resulting spectral power estimates? I've seen a few papers doing different windows for s-transform, but was unable to find anyone doing multitapering...


texts: Upsampling PCM audio: from 6 kHz to 8kHz

texts:
What would a straight-forward way to convert an audio payload (PCM 16bit) from 6 kHz to 8kHz? I understand that this is an interpolation problem.

I fear that a linear interpolation would introduce too much noise. If so, what would be a better interpolation? I was looking at Lanczos resampling but I've seen it used in image scaling only and not sure it's worth it for audio.

I'm using Java.  I've found the JSSRC library butI would have prefer something more lightweight. Beside, I'm not sure this is really necessary for low-frequency audio (which happens to be decoded from ADPCM).

BTW, I'm not interested in creating a WAV having a 6 kHz frequency header, I really want to resample.


texts: Relation between poles and cut off frequency of a filter

texts:
I noticed that for a low pass Butterworth filter, as the cut off frequency reduces, the poles get closer to the unit circle. Is it applicable to all filters and why is this so?

As the normalized cut off frequency reduces from $\pi/2$ to $0$ (close to $0$- really low cut off frequency), the poles get closer to unit circle (the distance between the poles and unit circle reduces monotonically). Similar behavior is observed when we increase the cut off frequency from $\pi/2$ to $\pi$ (close to $\pi$- really high cut off frequency), the poles get closer to unit circle again- at $\pi/2$ they seem to be farthest away from the unit circle.

I would really appreciate if anybody could help me understand why this is so intuitively and also the math behind this (if there is any). Thanks in advance.


texts: Ways to parallelize Sifting in EMD (Empirical Mode Decomposition)

texts:
Sifting process, which is recursive in nature, is used in EMD (Empirical Mode Decomposition) to decompose the signal (x(t)) into Intrinsic Mode Functions (IMFs) and residue, which is a monotonic function. All the examples provided of Sifting is recursive and all parallel implementation of EMDs where GPU or GPGPU or FPGA are utilized (Example), only use the parallel nature of hardware to speedup the mode decomposition algorithm rather than parallelizing the Siting process instead.

Is it possible to parallelize the Sifting process? If Yes, then do you happen to have any ideas regarding this?


texts:
I am a little bit confused about the concept of sampling rate conversion. Consider the following question:

Wideband telephony signals are sampled at a sampling frequency fS1 = 16kHz. To process these signals with an automatic speech recognizer, the sampling rate is converted here to fS2 = 11.025kHz, i.e., the wideband signal is ﬁrst upsampled by a factor U, lowpassﬁltered, and ﬁnally downsampled by a factor R. Determine the lowest possible values for R and U.

I am not sure whether U / R = 16kHz / 11.025 kHz, or vice-versa?


texts: How to add white gaussian noise to an image in Matlab?

texts:
I want to add white gaussian noise to an image of 10 dB in Matlab.

I tried to use Matlab function imnoise but I couldn't figure out what values for mean and variance should I choose to add noise of 10 dB.

How do I do this ?


texts: I want to perform aec on a wav file and calculate erle

texts: I am trying to evaluate the performance of an AEC by comparing the i/p and output wav file. I want to calculate echo return loss enhancement to predict how much(db) echo has been attenuated but i am not sure what would be right approach for that or is it possible or not, can we calculate in python?


texts: Processing a heterogeneous image-collection for CBIR

texts:
I'm working with a grey-scale data-collection of Hebraic tombstones in content-based image retrieval CBIR). For example an image like this tombstone. I'm going to reduce the content of the image to the centered tombstone. And after some other processing steps I'm trying to find a suitable representation of this image to enable CBIR. So far SIFT and SURF were good detectors but others like MSER fail to produce good results. The problem is the heterogeneity of the data-collection (6.700 picture of different tombstone with different shapes, symbols, ornaments and Hebraic letters).

Does anyone can give me a hint which pattern-recognition approach might be suitable? OCR won't do.

Thank for your help! If you need more picture, take a look around at the institue of German-Jewish history.


texts: What is the math behind median filter's noise reduction property?

texts: I am interested in understanding the mathematical reason for why does applying a median filter on an image (or signal) result in reduction of noise.


texts:
I have read some about Karhunen-Loeve Transform (KLT) and its application to the field of seismic data processing.
The method as I understand it based on decomposing the data (actually mostly used in image processing) using SVD on its covariance matrix and projecting the data back after manipulating one or some of the covariance matrix's eigenvalues.
One of the assumptions, when using on seismic data to remove random noise, is that the features to keep, should be aligned in time. If this is not the case, then one have to correct for the observed move-out.

For ex. in the top picture below 400 time samples (y-axis) for more than 50 data traces(x-axis) are shown. Each trace represents data recorded on one geophone. There are multiple "events" in the data represented by horizontal lines across the figure. There is no time delay for the observed event across the traces.
The picture in the bottom is the result after applying KLT on the data, by zeroing the smallest eigenvalue of data's covariance matrix.
My question is, why the assumption of time alignment of the "event" (horizontal features)? The method fails if the events occurred along a line with a slope, that is the same event was observed with a delay from one trace to the next.

Thanks


texts: Relation between original points and 1st/2nd derivative points

texts:
I have points $\{p_0, p_1, ... p_n\}$, I create a discrete derivative consisting of $\{d_0, d_1, ..., d_{n-1}\}$ like this: $d_k=p_{k+1}-p_k$. I'd like to choose a point in the original signal by exploring the derivative. But after I find a specific point $d_k$, which point from the original set should I choose: $p_k$ or $p_{k+1}$? It looks like I can't really choose between them.

Similarly I explore 2nd derivative for inflection points. But in 2nd derivative I'm guessing that $p_{k+1}$ is a sensible choice because it's a midpoint out of 3 participants ($p_k, p_{k+1}, p_{k+2}$). Though this is still not perfect because of the 1st and last points in the set.

What are possible strategies to resolve this ambiguity?


texts: Can you increase frequency resolution of FFT without increasing window size?

texts:
I'd like to use STFT for multipitch analysis.
I realise detecting the partials existing in the signal is just the beginning.
Still I have problem with it.

Let's say I have signal sampled with 'CD' frequency 44100Hz.
With window of 1024 samples I get frequency bin resolution of 22500Hz/512=43Hz.
This is enough only to discern high piano notes like:
C5 = 523.251Hz and C#5 = 554.365.

I used to think 1024 is quite a large window.
But maybe it isn't and normally larger windows are used for detecting partials?

Can frequency resolution be increased with some other method than increasing window size, which worsens time resolution?
I thought of two methods:

Method1:

Divide signal into frequency bands with bandpassfilters (for example 0-11.25Hz and 11.25-22.5Hz).
Downsample higher bands so that original high frequencies will be now low frequencies
(so do it for second band 11.25-22.5Hz -> 0Hz-22.5Hz) - not sure this is possible.
Concat resulting bins sets with adjusted labels.

Method2:

Use series of lowpass filters with increasing limit.
Perform FFT on increasing frequency ranges.
For each frequency use best possible resolution (bins from the first FFT in which this frequency was included).
This will cause low frequencies to have better resolution but I think this is ok because for higher notes
the frequency difference is grater.

I will be grateful any remarks on this issues.

I also read here:
How do window size, sample rate influence FFT pitch estimation?
about method of improving peak picking results. I think will try to use it.


texts: Practical Gardner timing error implementation

texts:
I'm trying to demodulate a QPSK communication.
For the moment I do:

  Signal detection by computing the ratio between the power of the carrier wave compared to the signal power.
  Initial clock synchronization with a preamble.
  Initial phase recovery with the same preamble.

This works great with my signal but now I want to go further and take into consideration a clock frequency offset betweem the TX Clock and the RX Clock.

I made some research and a good way to do it seem to be Gardner Timing Error Detector which should be able to compensate for my clock offset.

To implement it I do:
$$\epsilon_k = Real[(signal(t_k)-signal(t_{k-1}))*conj(signal(t_{k-1/2})]$$
$$t_k = t_{k-1}+T+\gamma*\epsilon_k$$

My problem is that I don't know how to chose the proportional parameter.
$$\gamma$$

I've sometime seen it with something called the normalized narrowband noise BlT but I have no idea what it is. If you could point me in the right direction any help would be very appreciated!