texts:
Do convolution encoders exist with two separate (independent) inputs?

I got the question in my mind when I saw the question attached here.


texts:
I have been trying to implement an algorithm for successfully counting cars in an image. I have tried implementing A Method for Vehicle Count in the Presence of
Multiple-Vehicle Occlusions in Traffic Images

It estimates the background from a set of various images. I have looked into various other techniques for this purpose and all of these in one way or the other use either background estimation from a set of images or require a video. I have as an input, traffic images where the background (probably road in most of the papers) is hardly visible. Moreover, the images are from different areas so they don't have common backgrounds as well. How should I proceed in that case ?

I am thinking that if somehow I can match the structure of vehicles (car) then probably they can be matched. But I don't know if this is feasible and if it is how to proceed since the image contains multiple occluded vehicles as well.

Any hints or even research papers are also welcome.

A sample image is as follows:


texts: Why is autocorrelation used without normalization in signal processing field?

texts:
According to the wikipedia(Link), autocorrelation has two definition.

In statistics, the definition of the autocorrelation between times $s$ and $t$ is like the following:
$$\displaystyle R(s,t) = \frac{\mathbb{E}[(X_t-\mu_t)(X_s-\mu_s]}{\sigma_t\sigma_s}$$

However, in signal processing, the above definition is often used without the normalizaiton.

According to digital communication written by Bernard Sklar,
$$R_x(\tau)=\int_{-\infty}^{\infty}x(t)x(t+\tau)du$$

$$R_X(\tau)=\mathbb{E}\{X(t)X(t+\tau)\}$$

Where \begin{array}{a}
\tau & \mbox{ is the difference between } t \mbox{ and }s.\\
x(t) & \mbox{ is real-valued energy signal.}\\
X(t) & \mbox{ is a random process. }\end{array}


texts: how do windowing functions not distort the signal?

texts:
I'm trying to gain a better understanding of windowing functions, but so far I can't tell why they're used. As an example, I'm familiar with the Hamming Window:

$ w(k) = 0.54-0.46cos( \frac{2{\pi}k}{N-1})$ if $0<k<N$

But I don't understand how this can be done without distorting the signal. Are these specially chosen functions that just happen to retain the spectrum of the signal sample? Can it be proven mathematically that multiplying by this function retains the spectrum? And what is the advantage to using this, rather than simply windowing it and not multiplying it by any windowing function at all (i.e. a windowing function of 1)?


texts: Is real-time signal processing possible under Windows?

texts:
This question is related to on How to decide what platform is best to implement real-time audio processing on?, but focusing on Windows.

I'd like to be able to take input from a data acquisition board and process it (either through Matlab or a custom program), and use the result of that program to drive an external device that is attached through USB.  I know that getting hard real-time responses with Windows is nearly impossible (as there is a "wiggle" (technical term) of 3-15ms).

What is the most effective way to decrease this wiggle time?  Is this possible?  Should I be looking for an embedded solution straight away?


texts: creating a seamless signal / loop using interpolation

texts:
I'm trying to create a seamless loop using a "non-periodic" signal using interpolation to smooth out the beginning and the end but I'm still getting a click at the beginning when it loops and I listen to it.  Can interpolation do this?

Please Note that the equation is done this way to create a "non-periodic" signal to test when a signal does not start and end at the zero crossings.

I used audacity to zoom in and play the loops.  I've included images along with the matlab/octave code.

% combines sig to create seamless loop
clear all,clc,tic;
fs=44100;
dirpathtmp=strcat('/tmp/'); %/home/rat/Documents/octave/eq_research/main/transform/voice
fn=strcat('atest1',sprintf('%02d',fs),'.wav');

t1=linspace(0,2*pi,fs); %need to round off no decimals
t2=linspace(0,2*pi,fs); %need to round off no decimals
t3=linspace(0,2*pi,fs); %need to round off no decimals

%Create signal in different arrays
y1=sin(7*t1);
y2=sin(12*t2);
y3=cos(2.2*t3);
yt=y1+y2+y3;

ytnorm=(yt/max(abs(yt))*.8); %normalize signal

%change end points to stddev number
ytnorm_std=std(ytnorm);

%for loop to replace points to create seamless loop
ytnorm(1)=0; %set first point to 0
ytnorm(fs)=0; %set last point to zero

for kk=2:1:15;
    kk
    ytnorm(kk)=interp1(t1,ytnorm,kk,'spline');
    ytnorm((fs+1)-kk)=interp1(t1,ytnorm,((fs+1)-kk),'spline');
end;

wavwrite([ytnorm'] ,fs,16,strcat(dirpathtmp,fn));

plot(ytnorm)

fprintf('\nfinally Done-elapsed time -%4.4fsec- or -%4.4fmins- or -%4.4fhours-\n',toc,toc/60,toc/3600);


texts: why is the spectrogram from matlab different from audacity

texts:
Something related

Here are the spectrogram plots:

Matlab version:

Audacity version:

the darker parts towards the right of the figure show speech. Silence was added to the left of the figure in audacity. This silent portion does not show any thing in the spectrogram as plotted by audacity which is as expected. but the same silence portion is covered with blue dots in case of the matlab plot. Why didn't Matlab plot it with all white (since it is silence added through software and is not supposed to have any energy)?

---EDIT: response to pichenettes' answer ---

I think you are right about the first explanation

The previous spectrogram was obtained by changing the time domain wave form view into spectrogram view immediately after I added silence. Actually in my case I had added silence at the end of the file to make it's length exactly equal to 2500ms, then cut and pasted to the beginning. So in my case it actually did show the time domain waveform of silence as well after insertion. But it seems that it does not actually include the 0's of silence in the wavfile until I export it. When I see the spectrogram of the wavfile after an export and a re-import, I an see blue dots in the audacity version as well

And teh difference in colour is probably due to the difference in colour palettes used, as pinchette had pointed out in his other answer


texts: I am working on Digital Signal Processing. I know theory very well but I don't understand why IIR filter is used in place of FIR. What is advantage?


texts:
The SNR for a complex valued signal is presented by Dilip Sarwate in: https://dsp.stackexchange.com/a/42359
Following the same steps I would like to estimate the SNR for the magnitude of a complex signal. The received sample signal $y[n]$ is consisted of the transmitted signal $x[n]$ plus noise $w[n]$, such as,
$$y[n]=x[n]+w[n].$$
Also, it is given that, $w$ is AWGN $\sim CN(0,2\sigma^2_w)$.
When the received signal is treated as magnitude,
\begin{align}
E\{|y[n]|\}
&= E\{ |x[n] + w[n]| \} \\
&= E\{ \sqrt{ x^2_I[n] + 2x_I[n]w_I[n] + w^2_I[n] + x^2_Q[n] + 2x_Q[n]w_Q[n] + w^2_Q[n]} \}
\end{align}
And this is were I hit a road block (assuming that my math is correct). How can you extract the SNR out of this equation?
Which I don't know if it is solvable since the square rot expands all over the parameters.
Another solution I had in mind is to transfer the signals to FFT and use integrals to compare the two different magnitudes. Does that make more sense?


texts: Compression Ratio in ECG compression using Wavelet Decomposition

texts:
I have compressed and reconstructed an ECG signal using wavelet coefficients.
In the compression part, many of wavelet coefficients are set to zero. For example, if in original ECG $5000$ wavelet coefficients have been obtained, now $4900$ coefficients have been set to zero. I have reconstructed the ECG signal using only $100$ coefficient, but how do I measure the compression ratio?


texts: Instantaneous velocity and displacement from acceleration signal using a proper filtering method

texts:
first I need to mention I'm new to signal processing. here is the situation:
I have an acceleration time-series derived from an accelerometer

I wanted to imply a filtering method like high pass filter to denoise the signal. Using Fast Fourier Transform, I need first to decite on Cutoff frequency value.
After looking at fft(acc) I thought the cutoff frequency should be 5hz
I must note for x-axis (frequency) I just invert time (Fr=1/t) hope it's correct.

the estimated FFT's values are complex (not real numbers) which I force to work on the real part not imaginary. here is the code I used to filter acceleration signal noise by fft-highpass filter:

        % Matlab_code
   % Filtering signals by fft-HighPass
%%
acc=xlsread('accel_signals.xlsx',1,'B2:B4036');
t=xlsread('accel_signals.xlsx',1,'A2:A4036');
figure(1)
plot(t,acc,'b')
xlabel('Time(s)');ylabel('Acceleration (m/s^2)');
hold on
%%
Ts=mean(diff(t)); % Sampling rate
Fs=1/Ts;          % Sampling Frequency
Fc=5;             % Cutoff frequency = 5 hertz
fft_aac=real(fft(acc));
signal_temp=[acc,1./t];
signal=signal_temp;
for i=1:length(signal_temp)
    if signal_temp(i,2)<5
        signal(i,1)=0;
    else
        signal(i,1)=signal_temp(i,1);
    end
end
filtered_acc=real(ifft(signal(:,1)));
plot(t,filtered_acc,'r')

    %

Now the graph below is the result. the blue line is the noisy one and the red line is filtered signal. the filtered acceleration signals aren't even in the range of acceleration data but it's simply a noisy straight line.

here I listed my questions:
1- why is that happening? filtering didn't work well!
2- Do I need to use Hi pass or low pass filter by the way
3- What is the right way to choose cutoff frequency

please also help me with commenting on code and the way I approached filtering signal noise.

And after having a good filtering do I need to use a numerical integration (like trapezoidal integration method) to measure the instantaneous velocity and position?
Thanks in advance


texts: From symbol rate to sample rate fractional ratio

texts:
My design has symbol rate and sample rate to DAC fixed but the ratio is not an integer.
For example assume my symbol rate is 3 Mbps but the sample rate to DAC is 20 Mbps. So i am having 3 MHZ and 20Mhz clock. Do I have to use a polyphase resampler in the Tx path to bring 3 Mbps to 4 Mbps and interpolate 5 times to 20 Mbps by RRC and then send it to DAC? Similarly on the receive side? or is there any better method?


texts: Does Increasing Resolution Lead to Have a Poor Resolution?

texts:
As it has proven in some paper and books the time and frequency resolution of Morlet wavelet is :
  $\Delta t=\frac{f_c\sqrt{f_b}}{2f_i}$
 $\Delta f=\frac{1}{2\pi f_c \sqrt{f_b}}$
I don't know how these relations have obtained, I have asked it in detail in here.you can answer that if you want.
 but lets accept these relationship for now. there is some misunderstanding for me in here about the concept of resolution.
for this case, by increasing the term $f_c\sqrt{f_b}$ we have finer frequency resolution but poor time resolution. I am sure about finer frequency and poor time resolution because my practical results meet it.  but if you look at $\Delta t$ and  $\Delta f$ relationships you receive that increasing the term $f_c\sqrt{f_b}$ leads to decrease $\Delta f$  and increase the $\Delta t$.
does it mean that smaller value of resolution spell to have finer resolution and vice verca?


texts: What are some of the disadvantages of parametric PSD estimation methods?

texts:
Roughly speaking, the methods of power-spectra estimation can be divided in two categories : parametric and non-parametric.

From what I understood, parametric methods assumes that the signal can be more or less modeled (with an AR model, or a behavior + noise model etc..) and try to use this to perform the estimation.

I have noticed that when I use parametric methods, the result I obtain usually looks "nicer" that if I use a non-parametric method, let's say Welch. The thing is, I don't know anything about my signal and do not know if it can be modelized and if it therefore makes sense to trust parametric methods.

This is where my question comes in : What are the know "problems" which are associated with parametric methods ? Can we trust a spectrogram obtained this way even though the signal can't be modelized or doesn't fit the correct framework of the used method ?


texts:
Let $x_c(t)=\cos(\omega_0t)$. This signal is sampled with $\omega_s$, which is greater than the Nyquist rate. It is then interpolated with a zero-order interpolator. The signal obtained is $y_c(t)$. What should be the relationship between $\omega_0$ and $\omega_s$ so that $y_c(t)$ is periodic? Also, find the relationship between the amplitudes of the first two non-zero Fourier coefficients of $y_c(t)$.

I guess that, for $y_c(t)$ being periodic, $Y(j\omega )$ should consist of just deltas. The problem is that I don't see how this could happen. Mathematically,

$$X_p(j\omega)=\frac{\omega_s}{2}\sum\limits_{k=-\infty}^\infty [\delta(\omega -k\omega_s- \omega_0)+\delta(\omega -k\omega_s+ \omega_0)]$$
$$H_0(j\omega )=\frac{2\pi}{\omega_s}\text{sinc}\left(\frac{\omega}{\omega_s}\right)e^{-j\frac{\pi\omega}{\omega_s}} $$

With $x_p(t)$ being the sampled signal and $h_0(t)$ the impulse response of the interpolator. So

$$Y_c(j\omega)=X_p(j\omega)\cdot H_0(j\omega )$$


texts: Regression vector size for prediction, reconstruction and filtration with adaptive filters

texts:
I am working with adaptive filters and similar adaptive models (mainly with gradient adaptation) for a few years. I and my colleagues always struggle to find out the correct size of regression vector.

So far, as I find out by the hard way (experience):

for filtration mostly works well (low MSE) with something about 10-50 last samples, this number changes according to data and used step-size / algorithm.
for prediction the optimal size also depends on data and learning rate. Longer windows (regression vectors) commonly works well and it can be beneficial to skip samples, example:

Example ad 2.

For data where is one really dominant frequency (but changing over time) works for me the vector

$[u(k), u(k-15), u(k-30), u(k-45), u(k-60)]$ (size of 4 samples)

with the same MSE as

$[u(k), u(k-1), ..., u(k-60)]$ (size of 60 samples)

it seems that only what matters is to cover the size of data about 2 last waves of with the most dominant frequency, no matter how much samples was used.

My question

What is applicable theory for this problem (at least possibly)? I am pretty sure there must be some data attributes what can tell how big regression vector is important to get the most from the data. But I do not really now what should I study, or how to search for it.

Any hint or research direction recomendation is welcome. Thanks in advance.


texts: Voice recovery with high-noise, low-gain

texts:
I have a recorded interview with two speakers, in which one voice's gain was much higher than the other (by three orders of magnitude). Increasing the gain does not help, because speaker 2's voice is so quiet that it is hitting the digitization limit (I believe). Audio quality is not important, but it would be very helpful to have an approximate technique so that the words may be intelligible.

If helpful, I can try to post an audio example of the specific distortion here. The cadence of the voice is there, but it's so mangled the words are unintelligible. Basic interpolation and filtering (both long shots) were not successful in recovering the voice.

Any suggestions for analysis techniques and/or software would be much appreciated.


texts: How to determine the phase of a time-sampled periodic signal?

texts:
I know this is a rather common and a rather simple problem, but somehow I can't find a solution that is equally simple to understand (and implement).

I have a signal that closely resembles a noisy sine wave (sample signal graph below). What I actually need for the practical problem I'm solving is to find the phase of that signal, more specifically - one of the extremum points for each period. I want to know at which sample the new period starts, either from the min or from the max point (doesn't matter which as long as I know which one it is). A real-time solution is preferable (i. e. with as little a delay as possible).

What are good general approaches to this problem? Do I need to find the fundamental frequency? If I do, I have found two algorithms for that: DFT/FFT (overkill because I only need the base frequency), and auto-correlation which would be my choice. Is there any simpler way than auto-correlation?

Of course, if there is a more direct way to get the "starting" point of each period, that would be even better.

Thanks in advance.

P. S. The naive solution I see as an engineer with no training in DSP is to apply a smoothing (low-pass) filter to the signal and calculate something resembling a derivative - s(t) - s(t-1). Where this value changes sign is an extremum - but only with sufficient filtering and sufficiently stable signal. This approach does not seem robust.


texts: Are there any research value in visible light communication?

texts: My advisor wants me to take the area of visible light communication as my MS project, but I don't know whether there are any research value in this area, it seems most of the tenichnical difficulties are solved in this field. Any one has similar experience in this field? thank you !


texts: I'm trying to work out the best way to zero centre an audio clip for a forward FFT.   I've been trying rotate my audio so that a peak exists mid way (N/2).   This seam a little naive and I thought I had read that you can zero pad the centre of the audio clip in order to achieve the same result.  Am I mad?  what is the best way to zero centre an audio clip for Forward FFT


texts: How to discern the distribution function of mean-squared coherence values?

texts:
This probably walks a fine line between Cross Validated and this site, but I think the practical application of it lies more on the signal processing side.

I have had the occasion to record some EEG data for an experiment, and determined the mean-squared coherence between each lead:

$$ C_{xy} = \frac{\lvert{G_{xy}}\rvert^2}{G_{xx}G_{yy}} $$

(I also performed an event-related coherence calculation within certain frequency bands, which gives me a power value, but doesn't buy me anything further in the analysis of significance)

What I end up with is a list of values for the pairwise interaction of the electrodes:

Site1-Site2 = 0.24
Site2-Site3 = 0.13
...
Site7-Site45 = 0.37

so the challenge is to determine, within this sample of mean-squared coherence values, whether the MSC of the Site1-Site2 interaction is significantly different from that of the Site7-Site45 interaction, given a specific set of experimental conditions (e.g., the subject is tapping their foot or something).  Of course, ultimately comparing between subjects is necessary, but that would follow from being able to compare the results of one subject, and is probably more an issue of statistics.

Knowing that the data are not normally distributed, my question is, what is an optimal method of determining whether these values are significant?

I am familiar with 3 approaches that may be used:

Take everything above 0.5 as significant.  This is one that people could probably argue about over in stats land, but even with my untrained eye, that seems like its fudging it a bit
Use surrogate data to construct a distribution -- the signal processing piece of it would be, what would be a realistic set of surrogate data to use
Use the Bootstrap method, or basically derive the distribution from the data.  I get the idea of this method, but I don't fully understand whether this is any more realistic than using the surrogate data, or whether or not this would be SOP in signal processing

Would any of these 3 methods be appropriate for this type of analysis?  Is there another method that I've missed?

I haven't searched the literature on this in a while, but I never found a consensus anyway.  Are these standard sets of tests that you would perform on signal processing data?


texts: Discrete time signals connected in series

texts:
Two discrete-time systems are connected in series. Their input-output difference equations are:

  \begin{align}
w[k]&=0.25x[k-2]\\
y[k]&=0.5w[k-1]+0.5w[k-2].
\end{align}

  Determine the overall input-output difference equation relating $y[k]$ to $x[k]$
  Determine the impulse response of the overall system

Julie.


texts: Bandpass filter with very high sampling rate

texts:
Consider a bandpass filter with Low Cut 17Hz, High Cut 22 Hz, Fs = 45000 Hz and Order = 6. When I pass a mixture of multiple sinusoidal waves through this filter (with a sine wave of frequency 20 Hz), I noticed that Scipy's Butter Bandpass filter, upon filtering, returned values that were unexpectedly high. I did not get a sinusoidal output, but rather, ended up getting an almost straight line that was scaled up by a factor of 1e305.  Since I haven't done a course on DSP, and hail from a CS Background, any help would be greatly appreciated.

Here is my code:

from scipy.signal import butter, filtfilt

def butter_bandpass(lowcut, highcut, fs, order=5):
    nyq = 0.5 * fs
    low = lowcut / nyq
    high = highcut / nyq
    b, a = butter(order, [low, high], btype='band')
    return b, a

def butter_bandpass_filter(data, lowcut, highcut, fs, order=5):
    b, a = butter_bandpass(lowcut, highcut, fs, order=order)
    y = filtfilt(b, a, data)
    return y


texts:
I am tracking a car using particle filter by making a rectangle around it, and I am using the state vector $[x, y, u, v, a, h]$, where:

$x$, $y$ is the position of the body
$u$ and $v$ are velocity in $x$ and $y$ direction
$h = \mathit{height}$, and $a = \mathit{width/height}$ , height and width of the rectangle

My state equations for:

$$x = x' + uT$$
$$y=y'+vT$$

$u$ and $v$ remain same, and I am adding some random noise to it.

But I am not able to figure out, how should I change my $a$ and $h$ value, what should be the state equations for that. I am using histogram matching as the likelihood function.


texts:
I a new to MATLAB and i am trying to apply circle fitting technique to the following image.

Image

Expected Output

I used the following code with no luck:

[centers, radii] = imfindcircles(W,[30 65],'ObjectPolarity','bright');
figure,imshow(W);% title('Sobel gradient');
viscircles(centers,radii,'Color','b');

Note that the circle size can vary between picture

Any suggestions.


texts:
In my DSP class at my university I have to create a simple word recognition system using the MSP430. Basically the board just needs to turn on and off an led at the commands "On" and "Off". My question is more along the lines of finding a good tutorial which I can learn the general steps to perform this. I am learning about MFCCs, would this be a good starting point?

Thanks,
Micah


texts: MATLAB: Prepare an RGB image for digit and letter recognition

texts:
I need a Matlab function that prepares an image for digit and letter recognition.
What I need now is to convert the original RGB image to a binary image that every pixel in it is white except the pixels corresponding to letters and digits, as well as all digit and letter must appear chromatic/saturated, i.e. appear full of color.

Here is the code I have been tested. As you can see some pixels of a letter or digit are white.
I = imread('img6.png');   % read the image into the matrix
Ig = rgb2gray(I);

Icon = imadjust(Ig);

subplot(2,2,1)
imshow(Ig)
subplot(2,2,2)
imshow(Icon)
subplot(2,2,3)
imhist(I)
subplot(2,2,4)
imhist(Icon)

1- How we can convert the original image to a high contrast image?
2- How the shadows around letters and digits can be removed?


texts:
I have read a paper about super resolution where signals are used that are partially aliased. here the paper

If the sampling rate is smaller than the 2*max frequency but greater the max frequency, then the signal is aliased partially.

fs_max < fs <2*fs_max

Now if I consider the case where I have a sampling rate of 4 kHz and a lowpass analog filter that filters all frequencies above 3 kHz, my signal should be alias free until fs -Fsmax = 4khz - 3khz = 1 kHz.
This means I could use the signal normally up to 1 kHz and above I should have aliasing until 2 kHz.

Are there any use cases in signal processing where such partial aliasing is used?
Iam not sure if my question is to broad,i know it should be maybe more specific. But i have not a signal processing background, and dont really know except of the use case in super-resolution, where such a partially aliasing is used elsewhere.
In the image above you can see, that applying a lowpass filter at 1Khz can clear aliasing of two different samples if they are partially aliased, and then you can calculate the shift between two samples. That is useful in super-resolution if you want to register two images for example.


texts: Scalogram (and related nomenclatures) for DWT?

texts:
My understanding of the scalogram is that, for a particular row, the scores of the projection of the input signal with the wavelet at a particular displacement is shown. Across rows, the same thing applies, but for dilated version of the wavelet. I thought that scalograms can be defined for all types of wavelet transforms, that is, for the:

Continuous wavelet transform
Discrete wavelet transform
Redundant wavelet transform

However upon further investigation is seems that the scalogram is only definable for the CWT. Based on this I have multiple inter-related questions that google has not sufficed for ATM.

Questions:

Is it true that the scalogram is not defined for the DWT or RWT? If so, why not?
Let us say an $N$ length signal has a 10-level decomposition by using DWT. If all levels are plotted as an image, (that is, a $10xN$ image), what is this image called?

As an example of a DWT 'scalogram', here is one for AWGN:

Concerning the same signal, suppose we instead plot the approximation MRA of the signal at all levels. (So again, a $10xN$) image. What is this image called in proper terminology?
For example, here I have shown approximation MRAs and detail MRAs for AWGN. (Clearly they are not the same as 'scalogram' of DWT).

Thanks!


texts: Does using the Goertzel algorithm actually give better frequency resolution?

texts:
I am reading this article, and I am getting a little confused by the author's liberal use of 'frequency resolution' regarding the Goertzel Algorithm.

Basic question: Does using the Goertzel algorithm actually give you more frequency resolution over a specific band of interest, or does it simply efficiently compute the FFT over only the specified band of interest, but at the same frequency resolution specified by sampling frequency divided by number of samples?

For example, lets say the $F_s$ is 100 KHz, (fixed) and the number of data samples $N$ is 10000. (Also fixed). If I compute a normal FFT, where FFT length is also $N$, my frequency resolution is $\frac{F_s}{N}$ as to be expected, and it will be equal to 10 Hz. This means my bins are separated by 10 Hz, from -50,000 Hz to 50,000 Hz.

Now let us say I want to use the Geortzel Algorithm to only look at frequencies in the range of say, 20,000-21,000 Hz. If I use the same $N$ for number of samples, and use the same $N$ for my FFT size, then what is my frequency resolution? Still 10 Hz? Or is it $\frac{21,000-20,000}{10000} = 0.1$Hz?

I have a feeling that I am not really increasing my frequency resolution, as much as simply interpolating points on the main lobe, by using the same $N$ in to evaluate the frequencies from 21,000 to 20,000 as I did from 0 to 50,000.

Is this a correct understanding?


texts:
I've seen in many textbooks on Signals and Systems that an LTI (Linear Time-Invatiant) system can be described as a constant-coefficient linear differential equation, such as

$$\sum_{k=1}^N a_k \frac{d^k}{dt^k}y(t) = \sum_{l=1}^M b_l \frac{d^l}{dt^l}x(t)$$

Later on, it is stated that the response of any LTI system can be decomposed into two terms: a zero-input response, and a zero-state response: $y(t) = y_{zi}(t) + y_{zs}(t)$ (among other decompositions) which are independent.

Zero-input (ZI) response $y_{zi}(t)$ is the output of the system when the input is zero, that is, the output to the initial conditions of the system. This means that ZI-response is the same as long as the initial conditions are the same and no matter what the input is.

Zero-state (ZS) response $y_{zs}(t)$ is the output of the system when the input in nonzero and the initial condition are zero. Thus, ZS-response depends only on the input (via convolution integral etc.)

Now, the question: if the system is LTI, it means it satisfies the linearity and the time-invariance property. That is:

Linearity: for input-output pairs $x_1(t) \to y_1(t)$, $x_2(t) \to y_2(t)$, we must have $$ax_1(t) + bx_2(t) \to ay_1(t) + by_2(t)$$

However, this is not true for nonzero ZI-response $y_{zi}(t)$. If $y_{zi}(t) = e^{-t}u(t)$, for example, then this response is not scaled by $a$ or $b$ when an input is applied, because it does not depend on the input! Thus, any system with nonzero ZI-response cannot be linear!

Time-invariance: if the input-output pairs are $x(t) \to y(t)$, and $x(t-t_0) \to y(t-t_0)$, then the system is time-invariant.

However, since again the ZI-response is the same as long as the initial conditions do not change, there is no shifting of the ZI-response when the input is shifted! Thus, a system cannot be time-invariant!

This makes me assume that a system described by a constant-coefficient differential equation is LTI only when the zi-response is zero, that is, when the initial conditions are zero! The last one makes the system causal as well.

Where do I make the mistake??? It seems to me that linearity and time-invariance (and causality) is only valid when initial conditions are zero but this is rarely noted in textbooks...


texts: Converting the equalizer coefficients from VSA at 2 sample/Symbol to 1.5 sample/Symbol

texts:
I was looking for some feedback on conversion of equalizer/filter coefficients at different sampler rate.

Problem Statement:
We have built a transmitter system whose output is at 1.5 sample/symbol (i.e. ratio of Output sample rate/Input sample rate). The signal going through this transmitter is modulated carrier of bandwidth 1 GHz.I have run this signal through a Digital-to-Analog Converter (DAC) and equalized the signal by generating and storing the coefficients from Rohde & Schwarz VSA. The goal is to use minimum equalizer taps to meet some specific EVM requirement. The VSA gives option to generate equalizer coefficients at 2, 4 or 8 sample/symbol thereby giving some oversampling gain.The goal is to translate the equalizer coefficients in 1.5 sample/symbol to be used as hard coded values in hardware design/implementation.

Approach:
The approach I am taking is to take 8 sample/Symbol coefficients and converting it into 1.5 sample/Symbol. I have done this by Interpolation of 3, Low pass Filtering, Decimation of 16. I have also done this decimation using variable decimator (9th order Lagrange based). Now my equalizer coefficients are at 1.5 sample/symbol,I convert them to frequency domain (by same FFT size and 10 times the size of coefficients for better resolution). I then take inverse 1/Eq (f) to model the RF slope/impairments. Then I have taken IFFT of equalizer and RF slope coefficients and their spectrum plots are exact mirror images. I have then applied those coefficients (Distortion and equalizer) to the modulated carrier in MATLAB and measured the EVM. However, my EVM is bad i.e. -27 dB whereas my original carrier EVM is around -55 dB.
I am not sure if I am doing something wrong in this process. Any opinion, feedback or ideas would be highly appreciated. Thanks

Also,Information about a similar VSA is given below

https://www.rohde-schwarz.com/ca/product/fsw-productstartpage_63493-11793.html


texts: How Could One Imitate Photoshop's Vibrance Filter with OpenCV?

texts: Can somebody please explain how Photoshop vibrance function can use in opencv c++ ? so that I may reproduce the same effects in my application. Here is the vibrance documentation


texts:
I have some questions about what is normalization. The obvious way to do that is

x_max = max([max(x), abs(min(x))]);
x=x-mean(x);
x_norm=x./x_max;

Can somebody explain how it is done?
And could you please explain what is the benefit of this method?


texts: Why do I see ringing in the output of a digital filter with a narrow transition band?

texts:
I am doing some 'extreme' eq for spectral mangling type effects with audio. Im using brick wall filters, and very narrow band pass and reject filters (vst plugins), and I'd like to know if there's anything I can do about the pre/post 'ring' with the linear phase /minimal phase filters Im using.  Unfortunately I must use steep eq slopes . Im prepared to use minimum phase as it avoids pre-ring.

Specifically, Im wondering:

What exactly causes the oscilliations in the impulse response just after the input, in a a minimum phase filter?
Are these osccilations what causes the audible pre and post 'ringing' sound which is added to the passband with with steep slope filtering?
Are the oscilliations, and thus the ringing frequency always the same frequency, or does the ringing frequency depend in some way on the input signal?

Thanks very much for your expertise. I look forward to any responses.
Dale.


texts:
I'm working on a computer vision application (using openCV) and the goal is to measure the width of an object before/after it falls on a container. So after the fall its position will be random, something like this to be clear:

The only object I want to measure will be clear filtering the image and will be always on top, but its width won't be parallel to the image plane of the camera in the general case. In the worst scenario the longer face could be very occluded, getting things very hard.

So my question is: what will lead to better accuracy between these 2 strategies?

Getting a pair of stereo images of the container, locate two points on the longer face of the object (vertex or medium point of the borders) and then calculate the distance in 3D space between these points.
Working with a single camera close to the object before it falls into the container, where its motion will be perpendicular to the camera so the entire width will be on a plane parallel to the image plane. Using a known size reference (at the same distance of the object to be measured) and calibrated camera will lead to width measure from a single image simply counting pixels.

Additional info: the distance between camera and object will be 2 to 2.5 m and I need 10mm accuracy

The second path sounds cheaper, easier to implement and likely more accurate..but I'm open to suggestions or other ideas.


texts:
I designed a Butterworth second order bandstop filter on Matlab with the following parameters:

Notch frequency: 150 Hz (the frequency I want to remove)
Bandwidth = 8 Hz, that is
Fc1=146 Hz
Fc2=154 Hz
Fs (sampling frequency) = 10,000 Hz

According to Nyquist Criterion, 0.5xFs > Fm
where Fm is my signal’s highest frequency. Let's say that my signal frequency ranges from 0 to 3 kHz, so my sampling frequency should be 6 kHz or higher. As you saw, I chose a samplig frequency of 10 kHz.

MATLAB gave me the filter coefficients for my difference equation, that is

y[n]=b0x[n]+b1x[n−1]+b2x[n−2]−a1y[n−1]−a2y[n−2] (IIR Filter).

I implemented this equation in a STM32F767 Nucleo Board. The input signal goes to the ADC, the signal is processed and then go to the DAC for output. I used a timer interrupt every 100 us for this. I mean, the process takes place in the timer interrupt loop.

**

The problem is this:
My filter works, but it's no filtering the frequency I chose to filter. I wanted to remove the 150Hz, but it's removing a frequency of 298~300Hz.

**

What could be happening here? Does the sampling frequency have to do with this? Should I choose a lower sampling frequency? If it's needed I can attach my C code as well as the MATLAB design. But this is the basic idea:

struct difference_equation
{
  // coefficients
  double b0;
  double b1;
  double b2;
  double a1;
  double a2;
  // input history
  double x1;
  double x2;
  // output history
  double y1;
  double y2;

  double process(double x0)
  {
    double y0 = b0 * x0 + b1 * x1 + b2 * x2
      - a1 * y1 - a2 * y2;

    x2 = x1;
    x1 = x0;

    y2 = y1;
    y1 = y0;

    return y0;
  }
}


texts: What is the antialiasing algorithm employed by video cards?

texts:
What is the algorithm employed by video cards when one talks about for example 8xAA?
I thought the algorithm was about looking at neighboring pixels for correction. Yet, I hear that the implementation is just upsampling followed by downsampling.


texts:
I'm currently reading this paper: http://www.rssd.esa.int/SP/LISAPATHFINDER/docs/Data_Analysis/GH_FFT.pdf
On page 21, it has a section called "Putting it all together", it states the following steps:

Input data
Frequency resolution and length of DFT
Window function
Splitting of the data stream
FFT
Scaling

Now, the "Window function" is mapped out before the "Splitting of the data stream" if this is the case, should I therefore multiply each of the bins within the data stream by each of the window values (Hanning)?
For example, at the moment, my Hanning window size is: 256 and the data is split into segments of size 256x128 in this case.. N = size of stream and then compute hanning(N)
I've seem a lot of DSP engineers split the window up into frames, before applying the window?
Thanks


texts: Power, energy and amplitude spectrum from fft in MATLAB - scaling

texts:
I've looked at previous answers and none of the answers seem to agree (perhaps I'm missing something obvious):

I would like to know what the correct scaling to use is for

amplitude,
energy and
power density spectra

after using MATLABs fft function to convert a signal into the frequency domain.

The problem I have is that I have been through various forums and seen a number of different answers, with some people saying to divide by length (L) of the original sample and others saying to divide by sampling frequency (Fs).

I understand that you divide by L in the case of a DFT where L is the same both before and after the fft however I don't see how this becomes Fs if the lengths are different as L does not directly relate to Fs.

Additionally I would like clarification on whether the scale factor of 1/Fs after the fft is for amplitude or energy spectrum - I understand that it comes from parsevals theorem which relates the energy before and after the fft however I am seeing answers which suggest the scale factor Fs should be applied to amplitude spectrum - surely it should be root(Fs)?


texts:
In control systems, the Laplace transform is often used to analyze the stability and the performance of LTI system. For instance, the LTI system is stable if and only if the transfer function, which is the quotient between the Laplace transform of the output of the system and the Laplace transform of the input, has all of its poles in the left half complex plane.

Does wavelet transforms also found applications in analysis or design of control systems?


texts: Using different algorithms/formulas to create spectrograms

texts: On the internet, I have seen people use Matplotlib/Python and short-time fourier transformations to create spectrograms. Are their other formula/algorithms to create spectrograms? And are they possible to implement in python or be called through command prompt?


texts: Why is PSD estimated, and not simply computed?

texts:
I apologize if this comes as a basic question, but I am struggling to understand why the PSD can only be estimated and not directly computed. For example, this thread discusses several such PSD estimation methods.

If I have a deterministic signal with a fixed number of samples, shouldn't I be able to directly determine its spectral information?  Also, it is well known that PSD can be defined as the Fourier transform of the auto-correlation function. Isn't this calculation deterministic?

Finally, in this paper the authors compute the PSI  directly from the FFT coefficients as shown below. There doesn't seem to be anything stochastic about the computation, and the computation of FFT coefficients is not really an estimation, to the best of my understanding. What am I missing?


texts:
I would like to smooth amplitude spectra of signals around their peak frequencies. I could perform FFT, find the peak frequency, and smooth around the peak in frequency domain, then inverse FFT back to time domain. However, is there a way to do the spectrum smoothing in time domain? If finding peaking part is difficult, is there a time domain operator that smooths spectrum for a given frequency band? What would be the theory behind?
Thanks in advance.


texts:
I have an exam in my signals and systems class in a couple of days, and I'm unsure how to go about solving this practice problem. The question is as follows:

Consider a discrete time system whose input and output are related by the following difference equation.

$$  y[n] =
\begin{cases}
(1/4)y[n-1] + x[n],  & \text{if $n>=0$} \\
(1/4)y[n-1] + x[n] + x[n+1]*\cos(n*u[n] + \pi/2), & \text{otherwise}
\end{cases}
$$

Use recursion to find an expression for the zero-state output, y[n], when the input is given by
$$x[n] = δ[n + m]$$
where m is an integer

I'm having a bit of trouble with the fact that the equation extends to before 0; usually to solve one of these by recursion we'd have something like y[-1] = 0, which would allow us to go ahead and compute more ys ... but in this case that seems to be impossible.

The only thing I managed to notice was that cos expression is irrelevant because of the unit step function; it's all 0 before 0, and that whole term goes away.Also recursively the y[n-1] term seems to divide by infinity ... but I don't know where to take it from there.


texts:
The question is specific to this document: Image Compression.

It is chapter 6 from book "A First Course in Applied Mathematics" by Jorge Rebaza. It is, a to the point explaination of DCT that is easier for an engineer to grasp. However, some things are not explained and thus here I am.

The questions are about the notation used when the book starts talking about 1D DCT; on pg.3 of the pdf it shows $x$ that is the input to be transformed. This $x$ is a vector i.e a matrix with $n$ rows and $1$ column. We then multiply this with $C$ that is $n \times n$ matrix to get a $n \times 1$ matrix $y$, that contains the DCT coefficients.

Q: Why is $x$ described fundamentally as a column matrix and not a row matrix on pg.3 of pdf? If the $x$ was row matrix i.e it was not transposed, making it $1 x n$ matrix, how would the equation to calculate $y$ change? Right now it is $y=Cx$.

Q: Why is the equation y=Cx and not written as $y'=Cx'$ where the $'$ symbol means transpose? Since we are describing both $x$ and $y$ as being transposes?

Q: When we move to 2D DCT (pg.8 in pdf) the equation is derived like this $y=C \cdot (Cx')'$ which gives $y=CxC'$. How come here we explicitly write the transpose of the operand $x$ but not in the 1D equation?

The descriptions are looking inconsistent.


texts: Why do we need to construct Gaussian pyramid using SIFT detector

texts:
I am learning about SIFT detection and descriptor. I am slightly unsure about why a Gaussian pyramid is built for the image.

I do understand that within each octave, we are applying the Difference of Gaussian filter at different scales to the image and finding for each pixel location, whether it is a local maxima. We do this also for the image at a smaller scale. So now we have marked out the pixels in two different scales of image that have local extrema values.
What do we do with the local extrema values in these 2 different scales ? Do we compute SIFT descriptors at the 2 different sizes of image ?


texts: Different amplitude in time-domain vs frequency-domain

texts:
Reading the book Understanding Digital Signal Processing I am confused with the following picture:

First figure is the input signal ($x_1(n) = \sin(2\pi f_0nt_s)$, $f_0$ frequency, $t_s$ being the sampling period) at 1Hz. Second is the input signal squared ($y_1(n) = \sin(2\pi f_0nt_s) \cdot \sin(2\pi f_0nt_s)$). Third figure is the second signal displayed in frequency domain. How can it be that the amplitude is $-0.5$ when the second figure is strictly positive and the amplitude is $1$?

Note: I am a complete beginner at this.


texts: determine the impulse response of given second order difference equation

texts:
$y[n]-3y[n-1]-4y[n-2]=x[n]$

i solved it as follows :

1.first calculated natural-response(ZIR i.e,zero input response)

by using characteristic equation it came out as

  $y_n[n]=[c_1(-1)^{n}+c_2(4)^{n}]$ here i couldn't be able to calculate $c_1$ and $c_2$ because there were no initial conditions given in the question.

2.And,Then calculated forced-response(ZSR i.e,with all initial conditions zero) and ,since we know it consists of two parts

homogeneous solution and particular solution i.e,($ y_h[n] +y_p[n]$)
i calculated both of parts separately as follows:
first $ y_p[n]=0 $ because input is $\delta [n] $
and secondly $y_h[n] $ =$[C_1(-1)^{n}+C_2(4)^{n}$ (here i was able to calculate values of $C_1$ and $C_2$ as $\dfrac{-1}{5}$ and $\dfrac{6}{5}$ respectively by using zero initial conditions i.e, $y[-1]=y[-2]=0$,$x(0)=1$ ,as per definition of forced response)

3.and finally i added all solutions to get total solution i.e, $y[n]= y_n[n]+y_h[n]+y_p[n]$ and got answer as $ y_n[n]=[c_1(-1)^{n}+c_2(4)^{n}-0.2(-1)^{n}+1.2(4)^{n}+0] $
but answer in the book is given as $y [n]=[-0.2(-1)^{n}+1.2(4)^{n}]$ so my problem is why didn't they incorporated natural response term in final answer  .
thus, my questions are

  1.does "finding impulse response in numerical" means finding only "forced response" and leaving natural response.terms.unlike we do in other input cases(like $x_\left[n\right]=\left[\dfrac{1}{2}\right]^n$) where we also calculate natural responses(where of course initial conditions are provided so that we can calculate $c_1$ and $c_2$ as well)...... is impulse input an exceptional case of inputs?

2.same they have done for questions regarding 'step response'

i haven't read z-transform and generating function method to solve difference equations so please do not give answer by using those techniques.


texts: How do I know if my EEG signal need denoising?

texts:
I recently started  working on sleep study.

For my research I download sleep EEG data from physionet. The EEG data has 100 Hz sampling rate and was recorded from 2 bipolar EEG site.

When I start the preprocessing stage, I encounter a simple problem:

How would I know if my signal has an artifact or noise?

It should be noted, based on Nyquist theorem and my signal's sampling rate, the maximum frequency of my signal is 50 Hz, so I did not filter unnecessary EEG frequency.

In general I only used a simple notch filter at 50 Hz, and used simple threshold method in order to remove the epochs that were grossly contaminated by muscle and/or eye movement artifacts.

Back to the main question, how should I know if I need to uses more complicated method for removing EMG or EOG artifact from my signal?


texts: What do the Contour Levels Produced by Matlab Function Contourc Represent

texts:
I have been trying to understand what the contour levels are.

As far as I understand a contour of the function $Z(x,y)$ is a set of points in the $(x,y)$ plane, such that $Z(x,y)$ is fixed at some constant value, that constant value is the contour level.
Matlab docs state that the contourc function takes an argument that determines the levels upon which the contours are computed.
I wanted to try that out, so I constructed a picture with $10$ rectangles, each of which has a distinct depth starting from $0.1$ ending up at $1.0$, and I ran the contour function to see the highlighted contours according to the specified levels in the input, but the results weren't expected.

For instance, I ran the code on $0.1$ contour level and the contour function produces all the contours in the picture, not only the ones with $0.1$ level.

Here is the Matlab code used to construct the picture and find its contours:

pic = zeros(500, 500);
val = 0.1;
shift = 40;

for j = 1:10
  for i= 50:450
    pic(shift*j,i) = val;
  end
  for i= 50:450
    pic(shift*j+25,i) = val;
  end
  for i = shift*j: shift*j+25
    pic(i, 50) = val;
    pic(i,450) = val;
  end
  val = val + 0.1;

end

imshow(pic);
figure(2);
contour(pic, [0.1 0.1]);

I'd be so grateful if someone could clue me in.


texts: How to sample a transfer function (angular spectrum) in the frequency domain?

texts:
I am having this problem in Fourier optics, where I am using the Angular spectrum method (a lti filter) to calculate the electric field at the required plane given the distance p and the electric field of another parallel plane.

Essentially I have to implement the following equation for light propagation given in the continuous time domain as a convolution.

i_required(x,y) = i_given(x,y)*hp(x,y)

Now, my doubt is when computing this using discrete Fourier transforms.

Note the Angular spectrum function is defined only in frequency domain Hp(fx,fy). For ease of explanation sampling of i_given(x, y) is done at 1 unit in each dimension.
The steps I am doing:

Take DFT2 (Discrete fourier transform along rows and columns) of
given samples of i_given(x, y) and let it be I(u, v) for u,v = 1:N
Sample the frequency domain of the transfer function Hp(fx, fy)
at fx = u/N,fy = v/N
Multiply H(u,v)I(u,v)) and take the IDFT2

What is the consequence of sampling in frequency domain (Step 2)?
Will this cause aliasing in time-domain? Ways to mitigate effects if any?


texts: Difference between double-sided and single-sided AWGN noise after bandpass filtering?

texts:
Consider a bandpass signal $s(t)$ with bandwidth $W$.
After bandpass filtering, let the output signal be $r(t)=s(t)+n(t)$
I have read a paper that denotes $n(t)$ as Gaussian noise with one-sided power spectral density $N_0$. Therefore, the noise power is $\sigma^2=\mathbb{E}\{n^2(t)\}=N_0W$.
What would be the purpose of denoting the noise as single-sided?
It seems that if we consider the noise as double-sided with power spectral density $\frac{N_0}{2}$, noise power is still $\sigma^2=\mathbb{E}\{n^2(t)\}=N_0W$ since we have to integrate over the negative frequencies and the positive frequencies.
What is the purpose of describing AWGN noise as single-sided versus double-sided? Considering the case of real signals, do both end up giving the same results?


texts: periodicity, minimum phase, maximum phase, interpretation

texts:
I have a finite linear difference equation

$$y(n)=ax(n-1)+bx(n-2)+cx(n-3)+\ldots+fx(n-m)\text,$$

relating an input $x(n)$ to an output $y(n)$. If I assume periodicity of type $x(n-2)=x(n)$, the right hand side reduces to a summation over $x(n-1)$ and $x(n-2)$  (where $x(n-2)=x(n)$) and the collective coefficients  say $A$ and $B$:

$$y(n)=AX(n-1)+Bx(n)$$

($y(n)$ then also has period $2$.)

Applying the $\mathcal Z$-transform to this and exploring the zeros (poles just at $z=0$) I would like to make comments on the coefficients predicting that a period 2 system is possible.

How can I do this regarding zeros inside/outside the unit circle ?


texts: how to make fft ignore phase shift when only interested in magnitude

texts: I have a signal that consists of a sine wave, on which I apply a rectangular window and then an FFT. I'm only interested in the magnitude of the sine wave, and I want it to stay the same even if the signal shifts a few samples to the right relative to the window (of course assuming the sine wave has the same amplitude from top to bottom). Is this possible and how can this be done best? The application is a kind of pitch detector where I have to detect a small group of different pitches.


texts: Why should an image be blurred using a Gaussian Kernel before downsampling?

texts:
I recently read that before downsampling an image, it should be blurred using a Gaussian Kernel. This way, the downsampled image is better than just picking a single pixel out of a NxN block or averaging over the block. After searching in this site as well as google, I didn't get any exact answer.

But there were questions on how to select $\sigma$ for blurring. Reading the answers on those posts, I learned that downsampling has to be done in accordance with sampling theorem. Downsampling without blurring causes aliasing effects.

Can someone please explain why image has to be blurred before downsampling? I mean what is the exact relation to sampling theorem. What happens when an image is downsampled without blurring? I mean what are these aliasing effects? How can I notice them in the downsampled image?
Why is Gaussian blurring better than Averaging over a block?

If you can give some examples of the images, I would be a lot grateful. Ans, I would appreciate all kind of answers, partial, intuitive, rigorous, anything.

Thank You!


texts: How to calculate LF/HF power ratio from heart rate RR-intervals

texts:
I've been searching everywhere, but I'm having trouble finding a step-by-step guide for someone with little knowledge of signal processing.

I have a file with a list of RR-intervals in milliseconds. The RR-interval is the time between successive heartbeats, so if you took the cumulative sum, you could think of it as a timestamp for each heart beat.

One method of calculating heart rate variability is to find the ratio of power between the low frequency band (0.04 - 0.15 Hz) and the high frequency band (0.15 - 0.40 Hz) in the heart rate signal.

How can I find these values? The RR-intervals aren't like an evenly sampled signal, so I think resampling would be involved. Thank you very much.


texts: Alternative to Orthogonal Matching Pursuit (OMP) Algorithm

texts:
In the Compressed Sensing context, assume there is a signal $ x \in {\mathbb{R}}^{n} $ which is $ k $ sparse. Namely its Pseudo $ {\ell}_{0} $ Norm is $ {\left\| x \right\|}_{0} = k $ (The signal has only $k $ non vanishing elements) where $  k << n $.

Given a Model Matrix $ A \in {\mathbb{R}}^{m \times n} $ the measurements are given by (This is the Model):

$$ y = A x $$

The recovery problem is given by:

$$ \arg \min_{x} {\left\| A x - y \right\|}_{2}^{2} \; \text{s. t.} \; {\left\| x \right\|}_{0} = k $$

Since the exact solution to the problem above is hard to find the recovery (Estimation) of the signal $ x $ from the measurements $ y $ is usually done using Orthogonal Matching Pursuit (OMP) Algorithm.

Basically the OMP finds iteratively the elements with highest correlation to the model.

The question is, since the measure of the quality to select indices is based on Correlation, why can't one just find the support using the following:

[vCorrVal vCorrIdx] = sort(A' * Y);
vSignalSupport = vCorrIdx(1:k);

The result is almost the same as that of normal OMP.


texts: derive AR model based on the autocorrelation of jakes model

texts:
I am trying to derive the channel model based on the autocorrelation of Jakes model.
In step 2, i am trying to get rid of $s(n+1)$ by inserting it to $s(n-k)$ in which the limit will change. However i don't think step 2 makes since because the limits should be from $k=-1$ to $M$. However, if that is the case the final results will be different, i.e. we will not reach to step 7. Please take a look and tell me if the derivation is correct if not i would appreciate it if you can correct it.[![page for derivations][3]][3]


texts:
Is there any difference between the terms sample and sample value in DSP? In statistics, those are very different concepts: a sample is a subset of a population: it is a set of random variables. A sample value is the realization (aka. observed value) of this set.

In DSP, I feel that sample is often used with the same meaning as sample value:


texts: Is there a way to reduce the covariance matrix of several source signals to the dominant source signal?

texts:
The problem I have can be seen in the context of DoA estimation or blind source signal separation and similar fields, where several source signals are observed by several antennas (or by an antenna array, respectively).

The basic model is something like
$$\mathbf{y}(t) = \sum_{i=1}^{n_s} s_i \mathbf{a}\left(\theta _i\right) + \mathbf{n}\left(t\right),$$
where $s_i$ describes the source signals, $\mathbf{a}\left(\theta _i\right)$ the mixing vector and $\mathbf{n}\left(t\right)$ the additive noise term. Note that neither of these terms should be considered known.

From this, I have available the sample covariance matrix
$$\mathbf{\hat{C}} = E\{\mathbf{y}(t)\mathbf{y}^H(t)\} = \frac{1}{T} \sum_{t=1}^T\mathbf{y}(t)\mathbf{y}^H(t)$$
with dimensions $N \times N $, if $N$ is the number of antennas, $n_s$ the number of source signals and $T$ the number of samples.

Now, what I want to do is the following:
I don't want to estimate all DoAs nor all source signals. I am looking for a method that is able to reduce the covariance matrix containing information about $n_s$ source signals to a covariance matrix containing just information about the dominant source. Actually, it is not even so important that it is the dominant source, the main goal is the reduction to just one signal.

Is there any method to achieve this kind of cleaning, of signal elimination, of source reduction, of clutter elimination or whatever you want to call it?

EDIT: I think I have not made clear a very important side fact: I am not particularly interested in the amplitudes or powers $\mathbf{s}$ themselves, but more in their geometry/directions $\mathbf{\theta}$.


texts: How to select the specific frame with object

texts:
I am detecting the object from the live camera through feature detection with svm , and it read every frame from camera while predicting which affect its speed , i just want that it should select the frame which contain the object and ignore other frames which have no object like empty street or standing car's , it should only detect the moving object

For example , If the object came into camera in 6th frame , it contain into the camera till many frames until it goes out from camera's range , so it should not recount the same object and ignore that frames.

Explanation :

I am detecting the vehicle from video , i want to ignore the empty frames , but how to ignore them ? i only want to check the frames which contain object like vehicle , but if the vehicle is passing from video it take approximately lets assume 5 sec , than it mean same object take 10 frames , so the program count it as 10 vehicles , one from each frame , i want to count it as 1 , because its the one (SAME) vehicle which use 10 frames

My video is already in Background subtraction form , i used SURF/BOW with SVM

I explore two techniques :

1- Entropy ( Frame subtraction )
2- Keyframe extraction


texts: Simple discrete time transformation $x[(n-1)^2]$

texts:
If I want to do the following transform
$$x[(n-1)^2]$$

I have thought about substituting each value of $n$ in $x[n]$ according to $x[(n-1)^2]$

i.e at $n=0,    x[0]=1$  to put it in $x[(n-1)^2]$

$x[(0-1)^2] = 1$ and so on...

Am I right ? and if I am at $n=-4$ it will be replaced at $n=25$


texts:
Let $u_1$ be a random noise in $\mathbb R$. The PSD of $u_1$ is constant in the interval $[f_{1,1}; f_{1,2}]$ and is noted $p_1$.
Let $u_2$ be a random noise in $\mathbb R$. The PSD of $u_2$ is constant in the interval $[f_{2,1}; f_{2,2}]$ and is noted $p_2$.
The intervals $[f_{1,1}; f_{1,2}]$ and $[f_{2,1}; f_{2,2}]$ are disjoint.
Is the PSD of $u_1+u_2$ computable ? Does it only depends on $p_1$ and $p_2$?


texts: Find best fitting rectangles after applying edge detection

texts:
I am trying to implement a box detection algorithm. In my pipeline, I start with image warping to simulate a frontal view of the shelf containing the boxes (assuming boxes are straight in that compartment). This then facilitates filtering extracted edges (ex. Canny) to only keep strictly horizontal and vertical edges. Once there I get something like this:

As a human being it is easy to say that there is almost a rectangle where the box is, even two rectangles, one for the box cover. This is not because you see the box image in the background, even with edges only it is obvious.
Here is the edge only image:

I am trying to come up with some kind of operator that scans all the image and returns the best fitting rectangles.

Best fitting here means:

The rectangle model has a high relative number of red pixels on its edges (let's say 80% or so) Cross-Correlation maybe?
The ratio between length and width should be bigger than 0.5.
(Optional) The inside of the rectangle should be 80% empty or so

There could also be a tolerance parameter for the rectangle model, where red pixels in an area of +/- tolerance are also considered to belong to the rectangle being tested.

As scanning all different rectangles sizes at all different image position is computationally not realistic, what would be an efficient approach to solve this problem? My intuition is screaming "Convolution" at me but I am not sure how to model that case.

EDIT:
Here is the original image


texts: Comparisons of FIR Causal filters of type HRIR in Discrete Time and Frequency Domains

texts:
I have just implemented a Discrete Time Convolution between HRIR filter at a range of angles. I also implemented an Overlalp-and-Add method and FFT and IFFT to compute the same convolution in Frequency Domain.
The HRIRs are the same measurements which are taken from a public database for both DT and Overlap-And-Add methods.

The input signal is an audio file and the output is supposed to be a 3D effect of producing a sound that moves in the horizontal and vertical planes for defined angle steps for both methods. The horizontal plane movement is a full circle at the level of the listener's ears from left to right and the vertical movement is a half circle from left ear to right ear at the level of the listener.

My questions are:

1) If I wish to compare the filtering done to each HRIR angle above in Discrete Time, is it beneficial to check the shapes, magnitudes of each HRIR angle and compare it against each other angle?

2) With regards to comparing the filtering done in the the Frequency Domain. What parameters should I compare?

3) Does the FFT of the individual HRIR at an angle help to compare the results?

Note that I have only compared the quality of the sound in the output file in both DT and Frequency Domains.


texts:
Suppose I have a IIR filter represented by $$G_0\left(z\right)=\frac{1}{1-0.2z^{-1}-0.1z^{-2}}$$
I would like to use the LMS algorithm to model an FIR filter $G\left(z\right)$ of order $N = 15$ such that it would adaptively reach $ G_0\left(z\right)$ coefficients values
So we know that $G_0$ can be represented by:
num = 1;
den = [1; -0.2; -0.1];

my issue is that I don't know how to initiate $G(z)$ given its order is $N=15$.
Is it valid to say:
G(z) = zeros(N,1)??

because my confusion is that if $G_0(z)$ has only 3 coefficients, how would $G(z)$ converge to 3 coefficients given that it is 15 taps long?
Please give me some clear insights into this. Thank you in advance.


texts: Does the instantaneous frequency contradict the uncertainty principle?

texts: The uncertainty principle states that there is a trade off between time and frequency. So, finding frequency components at specific time is impossible. However, the instantaneous frequency measure the frequency as a function of time. Which means using the instantaneous frequency, the frequency components could be found for a signal at a specific time. How can you interpret this? Why don't we use the instantaneous frequency for time-frequency analysis?


texts: How to get output from High Pass filter on this signal?

texts:
I'm trying to solve this exercise:

  Consider a High-Pass filter with a cutoff frequency of $W=2\pi$

  Calculate the output signal if the input signal is $x(t)=\displaystyle \frac{\sin(4\pi t)}{\pi t}$

The fourier transform for the input signal is:

$X(\omega)= \left\{ \begin{array}{lcc}
             1 &   \text{if}  & -4\pi \lt \omega \lt 4\pi \\[2ex]
             0 &  \text{otherwis}e \\
             \end{array}
   \right.$

Now, the output signal is :
$Y(\omega)=H(\omega)X(\omega)$

$Y(\omega)= \left\{ \begin{array}{lcc}
             1 &   \text{if}  & 2\pi \le |\omega| \le 4\pi \\[2ex]0 &  \text{otherwise} \\
             \end{array}
   \right.$

I can get here, but the solution to the exercise converts this function with inverse fourier transform, giving the result of $x(t)=2\displaystyle \frac{\sin(\pi t)}{\pi t}\cos(3\pi t)$.

I don't know how did they get to that conclusion, I have tried to search for it, but i don't know how to look for that.

I hope that the question is clear. Sorry if I'm lacking some details, it's my first time asking this type of questions.


texts: Audio transient characterization of instrumental music

texts:
Some time ago, I seem to recall hearing or reading of an audio experiment where the very short initial transients of one musical instrument (A) were spliced in front of the much longer steady state or sustain sounds of another instrument (B).  Human listeners in this experiment, upon hearing these composite sounds, were reported to recognize or hear the first instrument (A) with some reliability even though the initial transient or attack was only a very short portion of the entire note played.  (Anyone have a reference to this research?)

If the above is correct, what type of signal processing analysis of just the initial transient of a note from a musical instrument, before steady-state periodicity or stationarity, might be used to try to do musical instrument recognition or separation?


texts: Orthogonality of pseudo random basis functions

texts:
I was reading about Matching Pursuit and it struck me that you might use a dictionary simply consisting of uniformly distributed bipolar pseudo random vectors, instead of, say, Gabor atoms or windowed sinusoids.

Then I thought about orthogonality. Given a set of vectors, what would be one way to measure their orthogonality? We would ideally like to see the inner products [ V_i V_j ] vanishing for i != j. How do we quantify departure from this ideal? Furthermore, what level of orthogonality would we expect given a set of N uniformly distributed pseudo random vectors?


texts: How to expand on and deepen a basic skill set for image/video processing?

texts:
I didn't take any class on image processing but I studied the subject based on lecture notes and important books for last three months. So at this point, I would like to sharp my image processing skills. Of course, I am practicing a lot of image processing work but the work seems to be very similar.

As a programmer, I learned a lot from top coder or similar where you can compete each other for better programming. Is there any web site I can compete for difficult image processing problems?


texts: Eye pattern construction and interpretation

texts:
I have read some text about the eye pattern (or eye diagram), but I do not understand how should I read it.

The wikipedia definition of it is this one:

  In telecommunication, an eye pattern, also known as an eye diagram, is an oscilloscope display in which a digital signal from a receiver is repetitively sampled and applied to the vertical input, while the data rate is used to trigger the horizontal sweep. It is so called because, for several types of coding, the pattern looks like a series of eyes between a pair of rails. It is a tool for the evaluation of the combined effects of channel noise and intersymbol interference on the performance of a baseband pulse-transmission system. It is the synchronised superposition of all possible realisations of the signal of interest viewed within a particular signaling interval.

So my first question is: how does an ideal eye pattern look like?

My second question is about how should I read it, and I think that in order to understand this I should know how it is built. For instance this page shows it in this way:

According to wikipedia, it is sufficient to make the superposition of all the signals represented in picture. I understand that the resulting signal is that shown in the last graph. But, how should I read it? Which are the advantages of analyzing it instead of the single signals properties (edges etc)?


texts: Does Reed Solomon successful decoding guarantee valid payload?

texts:
I've got a CCSDS message. It was decoded by viterbi, de-randomized and processed by Reed Solomon decoder.

Decoder said that 14 bits were corrected. However when I decode payload according to the protocol, I'm getting invalid data.

So it looks like I've got random noise, which was accidentally decoded by Reed Solomon? Can it be possible? Or am I missing something?


texts: Applicability of Fourier transform to periodic signals?

texts:
Can we use Fourier Transform for periodic signals or only we can use fourier series with periodic signals?
I am asking this question because I read on page 301 of alex palamides as shown highlighted in attached photo


texts: Are location in BRIEF feature descriptor reused?

texts:
In the BRIEF feature descriptor ("BRIEF: Binary Robust IndependentElementary Features", Calonder et al.,  2011) they investigate five different methods of choosing point pairs to compute the binary values of the descriptor vectors:

Among these methods there are the methods named GI up to GIV that sample the point pairs randomly, according to various distributions.
Are these point pair sampled for every keypoint that we want to compute the descriptor for separately, or are these pairs sampled once and then remain the same for every keypoint?


texts: Frequency components much less prominent at the receiver for multiple tones

texts:
I am trying to transmit a multi-tone signal from one USRP (N210) to another and have written an out of tree block to generate the multi tone signals using an ifft. The two USRPs are connected directly via a cable and a $50\ \Omega, 20\textrm{ dB}$-attenuator.

I am finding that the signal is received clearly for 1 and 2 tones but not for 3+ tones. I'm not sure what I can do digitally to make the frequency components are lot more distinct. The received signal is amplified by $10\textrm{ dB}$ and passed through a LPF and I've attached some FFT plots showing the results.

I don't have enough reputation to show the transmitted signals but they are just direct spikes evenly distributed through the bandwidth and very distinct.

The received signals at the USRP are complex and so the FFT plots shown are only the real components.

Flow graph

Relevant graphs for a series of different tones

Single tone

Receive:

Transmit:

Two tones

Receive:

Transmit:

Three tones

Receive:

Transmit:

The number sweep block is an out of tree module that produces the frequency array that is passed into the FFT block.

The two USRPs are connected via a MIMO cable to ensure synchronisation of their clocks.


texts:
Is it possible for two different decoders to output two different sample results for the same MP3? I'm decoding an mp3 on Matlab and it produces two columns (presumably one for each channel). When I extract the sample data from the same file using AVAssetReader (iOS), I get different results. When I tried the same code with a WAV file, the two results matched, so I'm guessing the code is fine (although the Matlab result had a few extra blank frames).

If I, non-scientifically, choose random values from my AVAssetReader MP3 result, and search for them in the Matlab results, they tend to exist, but not always. I don't know if this is just coincidence, different rounding off errors or if they genuinely match. The problem is, when they match, the surrounding numbers differ from one another. For example, 0.0021 occurs in both results, but the surrounding numbers on Matlab are -0.0649,0.0147 etc.. (which don't appear near the 0.0021 in the AVAssetReader results).

What could cause this discrepancy, does it cause a serious lack of integrity in my app and how would I fix it? Thank you.


texts: How to remove heart beats interference from pectoralis major electromyogram?

texts:
I am using electromyography to detect activity on pectoralis major, however I found an interference from heart beats that is affecting my posterior analysis. The sampling rate is 2000 Hz, and the time of sampling is 150 s. The main signal is the muscle activity as the arm moves (four major big masses in the figure, between $-2*10^{-4}$ and $1*10^{-4}$), and the interfercence can be seen in the figure below as pulses at constant rate on values between $-5*10^{-5}$ and $1*10^{-5}$:

For comparison, I provide a figure of another muscle's (Deltoid) signal , without the heart interference:

As I don't know much about filters, I would like to ask for advice on how to remove the heart interference from this signal. Specifically, some directions on how to do it on matlab or R.

I can not use methods to record simultaneously heart and pectoralis major signals, since all individuals have already been sampled.

I found some papers addressing this issue, but I'm not able to implement the suggested solutions. For example:

Removing ECG noise from surface EMG signals using adaptive filtering

A sample file with this data is available here.


texts: Is there a function in python which returns the Amplitude/Sound Pressure Level of a sound file(like .wav) file?

texts: I found a function called scipy.io.wavefile.read() which returns the sampling rate and an array. But in the documentation, it is not specified that whether the array returned by this function is of Amplitude or Sound Pressure Level. Which one is it?


texts:
Is wavelet a Nonlinear transform, or Not?
specifically, continuous wavelet transform with morlet function.
I am studying behavior of a dynamic system, and it has nonlinear behaviour. can I employ wavelet transform?


texts: Exact definition of soft bits in digital receiver

texts:
At which stage of digital receiver, the bits are considered as soft bits?

I am unable to find the exact definition. I have rough idea how soft bits are different from hard bits but in terms of signal processing, I am confused. The signal after demodulation, phase/frequency/timing offset correction before the hard bits should be considered as soft bits?

I believe adding the samples amplitude of a single bit and averaging it over the number of samples to normalize the amplitude of single bit can be referred as soft bit right before converting it into hard bit?


texts:
Filter sharpening is a technique to sharpen the magnitude response of a digital filter. Finding information online about it is problematic since almost all google hits will be about image sharpening (unsharp mask etc.), which is unrelated to filter sharpening.

A naive technique to sharpen a filter would be to cascade it with itself. This kind of works but there are ways to get steeper response for essentially the same amount of computation.

The simplest sharpening operation is to subtract the double application of a digital filter from twice the identity operation.

$H_{sharp} = 2 I - H ^ 2$

Pseudo code:

init_sharp2(params)
  return [ init_filter(params), init_filter(params) ]

apply_sharp2(h, x)
  y1 = apply_filter(h[1], x)
  y2 = apply_filter(h[2], y1)
return 2 * x - y2; // 2I - H^2

A higher order sharpening operation is to subtract two times the triple application of a digital filter from thrice the identity operation.

$H_{sharp} = 3 I - 2 H ^ 3$

Pseudo code:

init_sharp3(params)
  return [ init_filter(params), init_filter(params), init_filter(params) ]

apply_sharp3(h, x)
  y1 = apply_filter(h[1], x)
  y2 = apply_filter(h[2], y1)
  y3 = apply_filter(h[3], y2)
return 3 * x - 2 * y3; // 3I - 2 * H^3

Make sure you use separate instances of the filters when cascading!

References: (to be done once I have waded through all the unrelated google hits)


texts: How to design a variable slope highpass filter

texts: I want to design some specific slope highpass filter to enhance  speech; just like $1$ dB/octave,  $2$ dB/octave and more. Is there a method to calculate the coefficients by specific slope?


texts: criteria for choosing a window for filter design?

texts:
When choosing any of windows(Bartlett, Rectangular, Hamming etc) for filter design, one important specification of window is minimum stop band attenuation
What can be other window specification(s) that are also required for making a choice?
For example I have been given specification of filter with stop band attenuation 21db, why should i choose only rectangular window? Why I can't choose Bartlett or Hamming window?


texts: Generating a sawtooth function with a variable frequency

texts:
So I'm trying to write a script that produces a sawtooth function using the equation:
s = 2 a / π atan ( cot ( π f t ) )
Where:
a : amplitude
f : frequency
t : time
It's all working fine when f is constant. But when f is variable (especially with a steep slope) it fails. In fact when f is falling, I get an inverse sawtooth signal (since df / dt is negative, f * t is going backward). Even when it's positive, though the sawtooth function looks correct, its fundamental frequency is not consistent with the value of f.
I tried to convolve f with a [-1,1] kernel and get its local derivative... But I'm not sure I really know what I'm doing at this point...
What I need to do is find a transformation for f (that probably involves its local derivative) that guarantees the sawtooth function does not invert, and that the frequency of the pulses is always consistent with f. Can anyone help?
Some context: what I'm ultimately trying to do is use the sawtooth function as the index for a wavetable scanner. I know there are easier ways to do wavetable synthesis but I need my process to be end-to-end differentiable.


texts: Impulse response of a 3x3 PSF - how to find analytical expression for fourier transform of a 3x3 matrix?

texts:
I have a filter $\mu[n_1, n_2]$ with taps:

$$ (1/8) (1/4) (1/8)$$
$$ (1/4) (1/2) (1/4)$$
$$ (1/8) (1/4) (1/8)$$

How do I find an analytical expression for $\hat\mu(w_1, w_2) $?

Since it looks so much like a triangle, I feel like it looks something of the form $sinc^2(w)$, but the exact answer I need help with.


texts:
I am working with the Nyquist criterion for zero ISI when I find something that makes me think that I misunderstood this criterion.

What Nyquist says is that to avoid ISI in the sampling we must ensure that the sample frecuency is less than 2 times the bandwith of the signal, so if the channel filter is something like a rise cosine the ISI in the sampling will be $0$.

At the same time, we have (another) Nyquist criterion which says that to be able to perfect reconstruct a signal, the sample frequency must be at least $2$ times the bandwith of the signal.

So... taken into account that the case of $F_s=2B$ is not implementable, how can we assure no ISI at the same time that we have perfect reconstruction? Aren't this two criteria contradictory? Am I missing something?

Thanks!!!


texts:
I'm trying to find the zero-state response (ZSR) of an LTI system to a one sided periodic input, like a square wave that is equals to zero for $t < 0$.

I know that I can use the Fourier series of said input function to find the steady-state (SS) response, however I'm having trouble understanding how to use the Laplace transform to obtain the ZSR, which contains the SS component plus a transient one.

My guess is that I need to calculate the Laplace transform of the periodic input, and then solve the system for $s$ to obtain the transform of the output.


texts: 2D Frequency Domain Convolution Using FFT (Convolution Theorem)

texts:
In the time domain I have an image matrix ($256x256$) and a gaussian blur kernel ($5x5$). I've used FFT within Matlab to convert both the image and kernel to the frequency domain as zero padded $260x260$ matrices      ($N + M -1 = 256 + 5 -1 = 260$)
I then multiply the image matrix by the kernel and use IFFT to convert the result back to the time domain. When I try to display the result, it is just junk and doesn't resemble the original image with a gaussian blur like it should.
Here is the Matlab code I am using, where image = $256x256$ and kernel = $5x5$:
imagefreqdomain = fft2(image,260,260)

kernfreqdomain = fft2(kernel,260,260)

filtimagefreqdomain = imagefreqdomain * kernfreqdomain

filtimage = ifft2(filtimagefreqdomain)

What am I doing wrong? Thanks


texts: I am trying to transform a signal into multiple images but the images are not clear

texts:
I have a signal that contains three distinct images, this means that I have three frequencies or peaks, and each one corresponds to a picture.

I have a function that converts a signal into an image.
I'm using the low pass, high pass, and band pass filters in Matlab to filter out the frequencies I want. When I use the LP filter, the image I get is clear.
But when I use both the HP and BP filter, the images I get are not clear/(contain noise?).
I'm using the "butter" and "filter" functions. I'm not really sure how to clear up the images or if I'm doing the wrong steps.
What I'm doing is using the filter, then using a tdft function, then I plot that and use the signal-to-image function I have to get the image. I'd appreciate any help.

Examples:

Signal with all three images:

TDFT of image:

First image after lowpass:

Second image after bandpass:


texts:
I resize the Multispectral image to perform IHS-to-RGB transformation. I used the Nearest Neigbour Interpolation method when resizing. While researching this issue, I saw that this is the best option to prevent spectral contamination, but I do not know exactly what the definition of spectral contamination means. I searched, but could not find detailed information on this topic.
What is the meaning of spectral contamination in image processing?


texts: Intuitive Meaning of Regularization in Imaging Inverse Problems

texts: Hello Every one I have been trying to understand the intuitive meaning of using a regularizer in images.  Specifically what does the Total Variation regularizer do in images and how is it able to prevent the edge smoothing?


texts: How to plot the Hilbert Spectrum in Hilbert-Huang transform?

texts:
I'm working on integral transforms for a science initiation project and i got to do a work on the Hilbert-Huang transform.

I've seen on the internet that, after one found the IMFs with the EMD method, you can do a Hilbert Spectrum plot of the absolute value of the componentes $H(\omega,t)$ where $t$ is for time, and $\omega(t)$ is the instantaneous frequency.

Suppose i got 5 IMFs stored in 5 vectors in GNU/Octave (or Matlab, wharever). How can i do such plot?


texts: Why do most digital pll's only use the positive zero crossing?

texts:
I've been trying to get my head around digital plls from knowing nothing and seen that most examples only use the positive zero crossing, not the negative. I've tried to find the answer but the best i could find is a textbook that said "complications arise when using the negative zero crossing so this type of PLL isn't as common" without further explanation.

The only reason that i can think of is that it would require more processing, but surely this would be worthwhile as you would be able to achieve faster lock times?


texts:
I don't understand why the substitution $s=\frac{z-1}{T}$ allows us to discretize a transfer function from laplace to z-transform through Forward Euler Discretization.
Can you explain to me ?


texts: This question is about modelling mechanical response of behavior in terms of signals

texts:
My dissertation supervisor ask me to code this.

r1=.3;
r2=.5;
xh=[0.00001:.01:.21];
yh=3.2*xh-0.8;
A=2*r2*xh;
B=2*r2*yh;
R=sqrt(A.^2+B.^2);
C=xh.^2+yh.^2+r2^2-r1^2;
z=C./R;
zz=sqrt(1-z.^2);
theta2=atan2(B,A)+atan2(zz,z);
theta1=atan2((yh-r2*sin(theta2)),(xh-r2*cos(theta2)));
plot(xh,180*theta2/pi)
hold on
plot(xh,180*theta1/pi,'r')
axis([0 .2 -170 0])
xlabel('xh [m]')
ylabel('\theta [degree]')
legend('\theta_2','\theta_1')
title 'The change in angles between the elbow and shoulder while lifting a heavy Load' grid

I understand it but now he has ask me to..

" Please do the links velocities and send me the results, please plot velocity of the links against yh, limit the axis of yh to be  ‘axis([-.76 -.16  -15 5])’"

I know that length of r1 or r2 multiplied by theta1 or theta2 should give arc length. Then arc length divided by a time interval will give rad/sec
which i can plot against yh...........I dont know what this axis([-.76 -.16  -15 5])’ means...... BUT I AM VERY NEW TO MATLAB HELP PLEASE.


texts: Analog to digital controller- What sampling rate?

texts:
I'm studying about the design of controller in digital control systems. Right now I see the method in which I design my controller in the s domain and then convert it to the z domain.

However, in order to achieve specifications I must choose a suitable sampling period. Otherwise the transfer function in the z domain might have (for example) different poles from those I was going for.

What I do I know is that the bigger the sampling period T the greater the problem. Seeing some examples they choose a T which is 0.1-0.5 times the smallest time constant of the transfer function. In other examples of second order systems T is chosen so $$T<2π/(40ω_d)$$ where ω_d is the natural frequency.

So how should I choose my sampling period?


texts: Can you calculate the absolute/amplitude values of a Fourier transform without complex/imaginary?

texts:
The DFT formula is $$X(k) = \sum x(n)e^{-i2πkn/N}$$

Is it possible to obtain absolute values from the DFT without having to calculate the imaginary components? I only need the signal amplitude values, not phase. I'm trying to create a spectrogram so I'm wondering if there's a shortcut or if I have to program complex math into the programming language


texts: Continuous frequency vs discrete frequency?

texts:
I have understood idea of discrete time and continuous time but I am feeling difficult to comprehend this idea in regard to frequency.

As for example the DFT output is discrete and the DTFT output is continuous.

How we can realize/visualize difference between continuous frequency and discrete frequency?


texts: What are filter banks and what's their application? What's the meaning of $H(z)$ in descriptions of filter banks?


texts: Python, resampling tools dont work as expected

texts:
I've tried both using scikit.samplerate.resample and scipy.signal.resample. With neither of them can I achieve the result I want.

Scipy.samplerate:

file1 = '../machine_learning/voice_snippets_stepvoices/t10_9steps.wav'
file2 = '../random_data/t10_9steps.wav'

sr, y = scipy.io.wavfile.read(file1)

secs = len(y)/sr # Number of seconds in signal X

samps = secs*16000 # Number of samples to downsample
Y = scipy.signal.resample(y, samps)

scipy.io.wavfile.write(file2, 16000, Y)
#librosa.output.write_wav(file2, Y, 16000)

With both the outputs from scipy/librosa-write_wav() I can't listen to the file. So I assume the file is corrupted and this would be a result of the scipy.resample step. Yet I cannot work out why. I have no error logs to go off. I've tried plotting y and Y on wavplots and they are both the same except for different length x-axis(samples).

Any ideas?

Scikit.resample:

file = '../machine_learning/voice_snippets_stepvoices/t10_9steps.wav'
new_file = '../testing/random_data/t10_9steps.wav'
ratio = 16000/48000

sr, y = scipy.io.wavfile.read(file)
y_new = resample(y, ratio, 'sinc_best', True)
scipy.io.wavfile.write(new_file, 16000, y_new)

In this one I do get an output but it changes somewhat noisy audio of someone speaking to what sounds like Skrillex... (Joking. but look at the graphs).

I didn't expect the resampling to have this effect especially since scikit.resample is supposed to be the best resampling tool for python. (and yes it does apply anti-aliasing).

Anyone have any idea why these techniques aren't working?

Thanks a lot (:

EDIT:

Thanks @hulappa for the solution. It was related to the output I got from  scipy.io.wavfile.read. I used this code to solve:

 # scale to -1.0 -- 1.0 - https://stackoverflow.com/questions/2060628/reading-wav-files-in-python

if y.dtype == 'int16':
    nb_bits = 16 # -> 16-bit wav files
elif y.dtype == 'int32':
    nb_bits = 32 # -> 32-bit wav files
max_nb_bit = float(2 ** (nb_bits - 1))
samples = y / (max_nb_bit + 1.0) # samples is a numpy array of float representing

#--------------

Alas, this only worked for scikit.samplerate.resample(). I still get an unreadable file from using scipy.signal.resample().

I have tried running scipy.signal.resample() on a sine wave like so:

fs = 48000 # sample rate
f = 5 # the frequency of the signal
x = np.arange(fs) # the points on the x axis for plotting
# compute the value (amplitude) of the sin wave at the for each sample
y = [ np.sin(2*np.pi*f * (i/float(fs))) for i in x]

secs = len(y)/fs # Number of seconds in signal X
samps = secs*16000 # Number of samples to downsample
Y = scipy.signal.resample(y, samps)

file1 = '../random_data/sine48000.wav'
file2 = '../random_data/sine16000.wav'

scipy.io.wavfile.write(file2, 16000, Y)
scipy.io.wavfile.write(file1, 48000, np.array(y))

I cannot listen to both the resampled wav file or the sine wav file. I assume this is a careless error but I will put this here in case an answer helps future readers.


texts: Oversampling and decimation: What filter to use?

texts:
I have a sensor producing (more or less) bandlimited data with a cut-off of about 45Hz, with a roll-off and AWGN. I have an ADC that samples said signal at 800Hz, with a single-pole anti-aliasing filter at about 200Hz. The problem is, I only have enough communication bandwidth to send samples at 100Hz and therefore some decimation is necessary.

Currently, I simply have an 8-sample moving average filter and send every 8th sample. This feels dirty and suboptimal. Surely there must be a better way.

Is there an accepted "best" thing to do in this instance?  Should I, for example, do a low-pass FIR filter to squeeze out as close to 50Hz of signal bandwidth as possible?  Or, is there some sort of optimal estimation scheme will do better?

The aim is to implement several channels (9 channels) on a smallish microcontroller (ARM Cortex M4, for example), so the computationally cheaper the better!


texts: How to implement anisotropic diffusion using java?

texts:
I am working on an image processing project in java where we use anisotropic diffusion for scale space generation.

In the below equation, after finding the diffusion value.using the second equation, I do not know how to find the divergence of diffusivity and gradient.

Since I am getting the diffusivity as a float value. I do not know how to find the divergence of that.can anyone please help me.


texts: Classifying a time series with a Lorentzian power spectral density

texts:
I was wondering if there is a general classification for time-varying signal with a Lorentzian shaped power spectral density, specifically with some nonzero center frequency. In terms of equations, what I mean is a power spectral density of the form $S(f) = \frac{a}{1+((f-f_0)/b)^2} + \frac{a}{1+((f+f_0)/b)^2}$ where $a$ is its maximal amplitude, $f_0$ is the center frequency and $b$ is the full width at full maximum. Note that I am talking about a real signal for all that follows.

The reason I am interested in this is because I know that if one has $f_0 = 0$, the timeseries could be seen as an instance of the Ornstein-Uhlenbeck (OU) process. However, I do not know of any process that generates a displaced Lorentzian power spectral density.

I tried thinking about this in terms of the autocorrelation function, but this has not led me very far. For OU this is an exponential decay, and by the Fourier transform this leads to the Lorentzian PSD. But conversely, a displaced Lorentzian again leads to exponentially decaying autocorrelations, multiplied by some phase factor that does not show up in the actual autocorrelations.

However, I am pretty sure there is a physical difference between the two power spectral densities (think about processes where the energy of the Lorentzian is relevant), and I would be interested in looking into the $f_0 \neq 0 $ case a bit further. So I am therefore wondering if there is some OU-type process that generates this, or some classification such as white noise, pink noise, etcetera, that fits this type of spectrum.


texts: Log LUT applied before bebayering vs applied to RGB

texts:
In order to get more detail when encoding the blacks, a log LUT is going to be applied to the pixel values.  Like gamma, the logical place to do it in the image processing pipeline is after demosaicking, so the same LUT is applied to the R,G,B components.

However, it occurs to me that a very similar effect can be achieved by applying the LUT to the bayer pattern instead.  The motivation for this is to utilize fewer logic resources (in an FPGA), since only a single LUT is required.

Is there any fundamental reason to do this after demosaicking and not before?  What about applying it to the Y component after RGB->YUV color space conversion?


texts: How to find correlation/cross-correlation of two signals in real time?

texts:
Considering there are two signals and the signals are real time in nature. Visibly when one signal does up the other signal does down and vice versa. Sometimes both the signals moved towards the same direction and sometimes moves away from each other.
How to determine the juncture when both the signals change their direction.


texts: How do I use a Savitzky Golay filter to find local maxima (in between samples) in a discretely sampled 1D signal?

texts:
I have a seismic signal y(i):

Here I have found one maximum: i=152.54, y=222.29 manually and plotted it in red.

I want to find all maxima automatically.

I read that the Savitzky Golay Filter (SGF) can be used to find smoothed estimates of both a signal and its derivatives, and that one of the benefits of the SGF is that it preserves minima and maxima much better than other filters. This sounds great for my use.

I found a Matlab script that generates SGF coefficients.
And used this to find that the 4th order SGF coefficients for the derivative.
I coded a small Matlab script that

finds the derivative of the signal by convolving the signal with the
4th order SGF coefficients for the derivative
finds pair of samples (i,i+1) where the derivative changes sign
finds zero crossing of derivative by linear interpolation between i and i+1

Script:

function [maxX,maxY] = findLocalMax(y)
% Kernel for 4th order Savitzky-Golay filter for finding derivative:
d4 = [0.0724 -0.1195 -0.1625 -0.1061 0 0.1061 0.1625 0.1195 -0.0724];

dy = conv(y,d4,'same'); % derivative

[m n] = size(dy);
maxX = [];
maxY = [];
for i = 1 : n - 1
  if dy(i) < 0 && dy(i+1) > 0 % max somewhere between i and i+1
    a = dy(i)/(dy(i) - dy(i+1)); % linear interpolation
    mx = i + a;
    maxX = [maxX mx];
    my = y(i)*(1-a) + y(i+1)*a; % linear interpolation
    maxY = [maxY my];
  end
end

Im my script I had to test for if the derivative changes from negative to positive to get the function to give the desired result, however this confuses me.
Should not the derivative for a maximum go from positive to negative?
Is there some better way to distinguish between maxima and minima?

Below is the result of using this function to find the maxima on my signal:

The results look good, but I notice that some maxima are not found:
i= 143.13, 190.88, 256.97.

Is this because they are to close to other maxima?

How can I control the nearest two maxima may be?

Thanks in advance for any answers!


texts: Are discrete systems defined by LCCDE always LTI?

texts:
Suppose a discrete-time system is defined by linear constant-coefficient difference equation

$$\sum_{k=0}^{N} a_k y[n-k] = \sum_{k=0}^{M} b_k x[n-k]$$

where at least two different coefficients $a_i,a_j$ are nonzero (so the equation is recursive). Isn't it true that such system is LTI and causal regardless of any auxiliary condition? After all, it is causal because it does not depend on any future inputs (RHS of the equation has only present or past inputs). And it is LTI because: if $x_1[n] \to y_1 [n]$ and $x_2[n] \to y_2 [n]$ the above difference equation is valid for $x_1,y_1$ and $x_2,y_2$ and by adding them together we can show that

$$\sum_{k=0}^{N} a_k (y_1[n-k]+y_2[n-k]) = \sum_{k=0}^{M} b_k (x_1[n-k]+x_2[n-k])$$

which means $x_1[n]+x_2[n] \to y_1[n]+y_2[n]$.

(similarly we can prove the homogeneity and the time-invariance property).

However it doesn't seem to be true according to Signals & Systems by Oppenheim A.:

  As in the continuous-time case, such equation does not completely specify the output in terms of the input. To do this, we must also specify some auxiliary conditions.

Up to this point I agree. But then they write:

  [..] we will focus for the most part of the condition of initial rest - i.e., if $x[n] = 0$ for $n < n_0$, then $y[n]=0$ for $n<n_0$ as well. With initial rest, the system described by the [first] equation is LTI and causal

In other words, the author seems to imply that without the initial rest condition, there's no guarantee that the system is LTI and causal (why contradicts my previous statements). Where's my mistake?


texts:
$p(t) =  \frac{1}{\pi\sqrt{2B}(1-64B^2\rho^2t^2)} \ \Big\{  8B\rho\cos\left(2{\pi}B\left(1+\rho\right)t\right )+ \frac{\sin\left(2{\pi}B\left(1-\rho\right)t\right)}{t} \Big\} $
Given a Square Root Raised Cosine Pulse, $p(t)$. The signal $p(nT_S)$ is obtained after sampling for $-100 \leq n \leq 100$, given $T_s=0.2$.
Assuming that the symbols are drawn from the constellation $±1$, I have to find the ratio of the desired signal power to ISI (Intersymbol Interference) power in decibels, from the autocorrelation of
$p(nT_s)$. The symbol rate is given as $T=1 s$.
My work:
The average power of constellation ($P_{0}$) would be $\frac{1}{2}(1)^2 + \frac{1}{2}(-1)^2 = 1$
The desired signal power would be $P_0 R_{pp,0}$. where($R_{pp,n}$ denotes autocorrelation of $p(nT_s)$ at lag $n$).
Now, I am confused with the ISI power calculation as the sampling time period ($T_s$) is not equal to the symbol rate $T$.
Can anyone help me with this?
Reference: https://home.iitk.ac.in/~vasu/book0.pdf (eq.5.29)


texts: I am wondering if there is a formula for the period of the sum of $N$ cisoids of the form $e^{j\frac{2\pi}{N} i\, \omega_k}$ where the frequencies $\omega_k \in \left[-N/2,N/2\right]$, $k=0,\ldots,N-1$ and $\forall\, p,q,\, \omega_p \neq \omega_q$. This kernel arises, for instance, in the expression of the Non Uniform FFT (NUFFT).


texts: What's wrong with my implementation of the Matching Pursuit algorithm?