texts: How can I oversample the received signal by double of sampling time and have two signals

texts:
I have a question, how can I make the sampling in Matlab for the received the signal by half of time duration of symbol (Ts), and have two copies of signal (that's the process of fractional sampling FS). . that's the question briefly. let me explain what's the process of that,

A block diagram of an OFDM system with FS is shown in the below figure,

suppose the information symbol on kth sub-carrier is s[k] (k = 1, ....., N), the ofdm symbol is given as below:

After appending the cyclic prefix "NGI" before transmission, the baseband signal at the output of the filter is given by:

where p(t) is the impulse response of the baseband filter and Ts is the symbol duration. this signal is unconverted and transmitted through multipath channel with impulse response c(t), the received channel is given as:

where
h(t) is the impulse response of composite channel,
  and v(t) the AWGN. For multipath channel, h(t) can be expressed in baseband form as

where:

Nm =  assumed that channel has Nm path component.

 = the amplitude of that time invariant during one OFDM symbol.

 is the path delay.

if y(t) is sample at rate Ts/G, where G is the oversampling ratio, its polyphase components can be expressed as:

where:

and  is the initial timing of the samples

Now, My question how can I do that sampling for the signal in matlab, and then separate y1 from y2 ......  in that case, if I have G = 2, I supposed have y1 and y2. how can I get these two signals?

I've made the below Matlab code,

function data_out = received_dat(RxDa,snr_db)
Numsymbol=128;                      % number of sending frames
N=1024;                            % FFT points
N_data=N*7/8;                     %useful data
Fb=5120;

T_symbol=N/Fb;  %period of one OFDM symbol
Fc=30000;                          %subcarrier carrier frequency
Fs=102400;                          % sampling frequency
Ts=1/Fs;                            %Period

L_cp=N/8;                          % length of CP (1/8 total)
L_OFDM=N_FFT+L_cp;                %length after adding GI

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%  Is it here to add the sampling by Ts/G %%%
G = 2;
Tg = Ts/G;
Fg = /Tg;
L_RData=L_OFDM*Numsymbol;
%% t=0:1/Fs:1/Fs*(L_RData-1);
t=0:1/Fg:1/Fg*(L_RData-1);

%%%%filter parameters
Ts = 1/Fs;
Nos = Sample_up;
rolloffFactor=0.0999;
psFilter = rrcPulse(Ts,Nos, rolloffFactor);
roll_len=length(psFilter);
fil_delay=floor(roll_len/2);

%LFM parameters
LMF_m=0:4095;
LMF_f0=20000;
LMF_deltat=-1/Fs;
LMF_deltaf=4*10^4;LMF_T=length(LMF_m)*LMF_deltat;
LMF_u=2*pi*LMF_deltaf/LMF_T;
%st is LFM signal
LMF_st=(cos(2*pi*LMF_f0*LMF_m*LMF_deltat-1/2*LMF_u*(LMF_m*LMF_deltat).*(LMF_m*LMF_deltat)));

%%
%%%%%%%%%%%%%%
%multipath channel
h=[1  0.8  0.5];
RxDa = conv(RxDa,h);
%adding wgn
% snr = -11;
RxDa = awgn(RxDa,snr_db,'measured');

 index=121;

%%%%%%%%%%%%%%%%%%data processing %get %
R_D_use=RxDa(1,index+4096+12000:index+4096+12000+L_RData-1);%1*98305
% R_D_use=RxData(1,index:index+L_RData-1);%1*98305

% Downconversion
R_D_demodu=exp(-1i*2*pi*Fc*t).*R_D_use; %(F)%second-level demodulation

data_out=[];

for isij=1:Numsymbol

    R_D_fil_be=R_D_demodu(1,(isij-1)*L_perOFDM+1:isij*L_perOFDM);  %extracting a symbol data
    %%filtering
    u=[R_D_fil_be zeros(1,fil_delay)];
    R_D_fil1=filter(psFilter,1,u);
    R_D_fil=R_D_fil1(fil_delay+1:end);

    %down Sampling
    R_D_de=real(R_D_fil(1:Sample_up:L_perOFDM))+1i*imag(R_D_fil(1:Sample_up:L_perOFDM));
      %%%%%%%%%%%%%%%%%%%%%%%removing GI
    R_D_FFT_be=R_D_de(L_cp+1:end);
    %%%%FFT
    R_D_FFT_aft=(1/N_FFT).*fft(R_D_FFT_be,N_FFT); % (I)

So, after the line where I wrote, %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%  Is it here to add the sampling by Ts/G %%%   .. it's supposed that I sampled the signal by half of time duration of symbol and I should have two output signals. . is that right?? so how can I extract the two branches of signal?

thank you.


texts: how to evaluate derivative of convolution integral?

texts:
If the signal $x(t)$ has ordinary first derivative $\dot x(t)$, then $\dfrac{d}{dt}\big(x(t)\star y(t)\big)$ is:

  (a) $\dot x(t)y(t)$
  (b) $x(t)\dot y(t)$
  (c) $\dot x(t)\star y(t)$
  (d) $\dot x(t)\star \dot y(t)$

I solved it as follows: we know,

$$I(t)=x(t)\star y(t)=\displaystyle\int_{-\infty}^{\infty}x(\tau).y(t-\tau) d{\tau}\implies$$
$$\begin{align}\dfrac{dI(t)}{dt}&=\dfrac{d}{dt}\displaystyle\int_{-\infty}^{\infty}x(\tau)y(t-\tau) d{\tau}\\&=\displaystyle\int_{-\infty}^{\infty}\dfrac{\partial}{\partial t}x(\tau).y(t-\tau) d{\tau} \\&=\displaystyle\int_{-\infty}^{\infty}x(\tau).\dfrac{\partial}{\partial t}y(t-\tau) d{\tau}=x(t)\star \dot y(t)\end{align}$$

So option $(b)$ should be correct but answer in the book is given as $(c)$ but I think both options $(b)$ and $(c)$ should be correct because in above
method I fixed $x(t)$ and shifted $y(t)$ but we can also do that other way
round fixing $y(t)$ and shifting $x(t)$,and we know by doing so,convolution
integral remain unaffected,so tell where i'm wrong ,any help would be appreciated


texts: Proof that DFT does not require more than N points

texts:
I'm trying to show how the discrete Fourier transform (DFT) arises from the equation for the continuous-time Fourier Transform. I've run into an interesting caveat which I can't seem to find an explanation to anywhere. My 'derivation' goes something like this:

Lets consider the continuous time Fourier transform equation
$$
F(\omega) = \int_{-\infty}^{+\infty} \, f(t) \, e^{-2\pi i \omega t} \,dt
$$
If $f(t)$ was to be discretised at $N$ evenly spaced sampling points with the sampling interval of $dt$, then it could be thought of as a continuous function of time with Dirac deltas at each sampling point. The integral of each of the deltas would be equal to the value of $f(t)$ at that point. Lets denote $f(t)$ at $k$-th sampling point (0-indexed) as $f_k$. Now, the integral is non-zero only at those delta functions so the entire above equation can be written as a sum
$$
F(\omega) =  dt \times \sum_{k=0}^{N-1} \, f_k\, e^{-2\pi i \omega (k dt)}
$$
Even though the sum is finite, this is a continuous function of $\omega$. $F(\omega)$ turns out to be periodic in $\omega$ and therefore just a single period of it is needed to be kept to retain all of the information about the  sampled version of $f(t)$ it came from.

All of this is (I believe) fine. Here comes the tricky bit. I want to then say that this single period of $F(\omega)$ can be sampled down to $N$ evenly spaced points which would in fact give the equation for the DFT. I say that: "It is one of the implications of the Shannon information theory (...) that for a general case of $N$ arbitrary bits of information, there does not exist a smaller set of bits which can be used to represent all of the information of the original $N$ bits. This places a lower bound on how many samples of $F(\omega)$ one can take."

Question 1: Is this a correct statement about implications of the information theory?

Question 2: I know that N bits of $F(\omega)$ are sufficient, but how do I prove it? To put it differently: How can I one show that for any arbitrary signal I will not loose any information about $f(t)$ by sampling $F(\omega)$ at only $N$ points.


texts: Estimate camera generalized velocity from consecutive frames

texts: Let's suppose I have a camera which can move freely in 3D space and has 6 degrees of freedom. Is it possible to estimate the linear and angular velocity of the camera from 2 or more consecutive frames? If yes, are there any environment or camera constraints that must hold?


texts:
The context is communication where we have a front-end that samples a signal and a noise (but here we focus only on the noise). My goal is to determine the noise power that I should use to simulate (in Matlab) the discrete noise after the ADC.
This post is related to this one, and I will refer to it. Below are figures to illustrate the discussion.

Let's consider a (virtual) continuous white noise of PSD $N_0/2$ (see Fig. 1). It passes through an ideal filter of bandwidth $[-B; B]$. So, we obtain a band-limited white noise, of power $N_0 B$ (see Fig. 2, with $B$ = 10 kHz). Here, we are just before the ADC of the front-end. After that, the signal is sampled, and here is how I see the things :

If the signal is sampled at a higher frequency than twice the bandwith (e.g. 30 kHz), the output is no more a white noise, since the PSD is not constant (see Fig. 3, in red is the duplicate of the spectrum around $±f_s$, so the actual spectrum is the grey curve plus the red curve).
Dilip Sarwate illustrates this very clearly using the autocorrelation function of the output noise in this post.

If the signal is sampled at a frequency equal to twice the bandwith (i.e. 20 kHz), the output is a white noise since the PSD is constant and equal to $N_0/2$ (see Fig. 4).
However, this disagrees with the development of Dilip Sarwate still in this post, where with 20 kHz we are not anymore on a zero of the sinc and thus the output samples are correlated...

If the signal is sampled at a frequency lower than the bandwith (e.g. 10 kHz), the output is also a white noise since the PSD is constant; but there is aliasing which increases the amount of noise and the PSD is now $N_0$ (Fig. 5). With lower sampling frequencies, the increase would be higher.

Therefore, for me, if I want to simulate in Matlab the discrete noise after the ADC, I should consider $f_s = 2 B$ to assume the noise as AWGN, and the noise power should be $\sigma^2 = N_0 B = N_0 f_s / 2$, whatever the actual front-end bandwidth is.

Could you tell me where my reasoning is wrong regarding the case of Fig. 4 ?


texts:
Hey I want to remove DC offset from tetra signal captured as inphase and quadrature phase samples(I and Q samples). I and and Q samples are 16 bit signed values. I tried averaging 2000 I and Q samples out of 2040 sample burst and subtracting corresponding averages from I and Q sample values recieved.But it doesn't seem to work well. Average values I'm calculating seems to vary widely from burst to burst..But if I'm getting DC offset value as average ,it should not be varying much from burst to burst right???

These I and Q samples correspond to pi/4 dqpsk modulated signals .when we average suffiecient number of theses samples to get the DC offset present ,I think we should get a less varying value when we perform same averaging procedure in every burst .. I wanted to know if my reasoning is correct??

could you suggest or point me to any techniques to remove DC ofset from unpredictably varying pi/4 dqpsk modulated I and Q samples. My I and Q sample values are signed 16 bit integer values.So I and Q values could be 32768 to -32767. I see 10481 to -11090 values as my I and Q sample when information is present .When I average 2000 message bearing I samples I get -361 in first time ,10 second time ,-778 next,598 an other time. So I kinda see a variation in average from say -800 to + 800. Could that be the DC offset. I think DC offset should not vary much like above


texts: MATLAB optimization for a subroutine function

texts: I am going to find the optimum values for a subroutine function in MATLAB. the subroutine function is not accessible in a mathematical form and we don't know any thing about it. We have ten input parameters and we find the optimum values for them which minimize the output of the subroutine function.


texts:
Possible Duplicate:
  How to extract traffic signs from a photograph?

I am working on a project which involves detecting north american speed signs (black/white) using a 720p HD camera. My problem is that I cannot seem to figure out how to classify the rectangular profile of the speed signs in order to pass it on to the text detection stage. My current segmentation approach detects differing levels of white in an image and thresholds the image based on those values (determined from color of road signs). The problem is that I need to segment it further as threshold-ed shape doesn't contain the complete road sign, but bits and pieces of it. I wanted to know what would be the best way to classify the road sign?

These are some pre-segmented images and the corresponding segmented images:

As you can see the road sign has holes in it but its distinct rectangular profile is in-tact in most cases. I am currently looking into using kurtosis shape profile to determine if it is rectangle however the approach seems complicated and computationally expensive, I wanted to know if anyone knows a faster simpler method to determine the rectangular profile of the road sign from the segmented image?

I did this in Matlab using the image processing toolbox.

EDIT: Use Local OTSU thresholding it will allow for segmentation and further morph operations allow to speed sign detection.

Whoever marked this similar to the link below as a duplicate, its not... there is fundamental difference between chromatic and achromatic colors (This question deals with achromatic) whereas the link suggested below deals with chromatic.


texts: Calculate the percentage of accuracy with which user made the assigned sound

texts:
I want to design a web-app for my cousin who is 2 years of age in which i have implemented a functionality in which when an image is clicked some sound gets played and the user has to make the same sound which gets recorded.
For eg-If i click on image of "Apple" the sound made is "A for Apple".Now the user has to say those words which get recorded.
Now I want to calculate the percentage of accuracy with which the user spoke.I want to know how can i know the accuracy percentage.
I read some research papers and did some online research and I have come to know across is that i will have to use DTW or MFCC and other research papers it was asked to use both.
I want to know what resources should i refer to and what parameters of sound signal should i use for the purpose of knowing the accuracy


texts:
I do not seem to know how to extract from a Matlab plot. For example in the plot given below, I have a simulated $P_b$ for Rayleigh fading and theoretical AWGN channel Pb plot against SNR ($\large \frac{E_b}{N_o}$).

My question is how do I get the value of $\large \frac{E_b}{N_o}$ for a particular value of $P_b$. For example, if I want the read the $\large \frac{E_b}{N_o}$ from the graph to get a probability bit error for the Rayleigh channel, what code can I use?


texts: Turning a MPG video into a set of coordinates

texts:
I have a video in MPG format showing a white mouse with a strong black dot on the head moving around on an off-white background, so effectively a black dot moving around on a 2-D plain surface.  From this video, I want to generate a set of coordinates that describe the position of the black dot as it varies with time, that is $(X_1, Y_1),...,(X_t,Y_t)$ relative to some arbitrary point on the surface, such as the centre of the image.  I also want to create a set of arrays representing a grid across the plain, with $0$s across the grid, except for a $1$ for where the mouse is at time $t$.  That is, the motion of the mouse down in a small surface in 3 time steps/frames would be represented by
$$
        \begin{matrix}
        0 & 0 & 0 & 0 \\
        0 & 1 & 0 & 0 \\
        0 & 0 & 0 & 0 \\
        0 & 0 & 0 & 0
        \end{matrix}
$$
$$
        \begin{matrix}
        0 & 0 & 0 & 0 \\
        0 & 0 & 0 & 0 \\
        0 & 1 & 0 & 0 \\
        0 & 0 & 0 & 0
        \end{matrix}
$$
$$
        \begin{matrix}
        0 & 0 & 0 & 0 \\
        0 & 0 & 0 & 0 \\
        0 & 0 & 0 & 0 \\
        0 & 1 & 0 & 0
        \end{matrix}
$$
or $(2,3), (2,2), (2,1)$.

I think the first stage is to somehow convert the video into a set of still images, so effectively split the video into the frames that make it up.  I have a mac, and any suggestions on a piece of software to do this would be much appreciated.

The second stage requires some kind of image processing package, but again, I'm not sure what to use, so advice would be much appreciated.

The project I am working on requires the final data (i.e, matrix and coordinate) forms, and isn't that concerned with how I get the data in the first place, so I am looking for simple software packages that lets me get this data.  However, if anyone has some code in matlab or python that lets me analyse the still images from scratch, that would be appreciated too.

Thanks!


texts:
I am new to matlab and computer vision. I used the code given in the link to detect cars. But the problem is the shadow is also being detected and tracked. Can anyone tell me how to modify the code so that only car are detected. Link:http://in.mathworks.com/help/vision/examples/detecting-cars-using-gaussian-mixture-models.html
Thanks in advance


texts:
A bit of background information:
I plan to start experimenting with digital signal processing on microcontrollers. The particular microcontroller I plan to use (TI Stellaris LM4F230H5QR, from the Stellaris Launchpad) has a 12 bit ADC integrated on it, while on the other hand, all DACs I that look like possible candidates for me to use are 8 bit.

Obviously, before getting the output, I'll have to reduce the bit depth somehow. I could just get an 8 bit ADC and avoid the issue altogether, but I'd like to keep as much of the signal processing line at 12 bits as I can.

Questions:
First, am I right in my assumption that by keeping 12 bits for as long as I can, I'll get better results?
Second, is there a smarter way of turning those 12 bits into 8 bits than just shifting everything to the right four times?


texts: Manual Extraction of Filter Phase Response with MATLAB using sweep sine

texts:
I'm currently at a loss for why my code seems to not be working.  I'm doing a sine sweep on a filter to calculate its freq and phase response.  The frequency response checks out, however the phase response doesn't look right when compared to MATLABs freqz function.  Plus since I know the filter is a comb, I can tell its wrong as well.

Here's what I've got so far.

%   Filter Coefficients
b = [1];
a = [1, 0, 0, 0, 0, 0, 0, 0, 0, -0.96];

%  sweep is my sine wave that goes from 0->fs/2
filtered_sweep = filter(b, a, sweep);

% This section correctly Grabs and plots the Freq Response
fft_sweep = fft(filtered_sweep);
freq_response = abs(fft_sweep);
freq_response = 20*log10(freq_response/1);      % Convert to dB scale
freq_response = freq_response(1:end/2);         % Cut to pi fs/2
figure;
plot(freq_response);

And Now here is where I try and get the Phase two different ways with the same wrong result.  From what I understand to get the phase you just need the angle of the complex values.  In MATLAB I thought angle() should work, but just to be safe I tried to manually compute the angle myself using atan with the imag and real components.

% Pre Allocate Vector
% Manual Angle Extraction without using Angle()
phase = zeros(1, length(fft_sweep));
for i=1:length(fft_sweep)
    phase(i) = atan2(imag(fft_sweep(i)), real(fft_sweep(i)));
end

% Using angle()
phase_response = angle(fft_sweep);
phase_response = phase_response(1:end/2);
figure;
plot(unwrap(phase_response));
grid on;

Both methods give the same incorrect phase response.  Any help would be appreciated.


texts: Output of discrete-time LTI system guaranteed to be same form as input?

texts:
I know that in the continuous-time context, if I supply a complex exponential input to a Linear Time Invariant system, the output will be of the same form as the input - for example, if the input is $x(t)=Ae^{j \omega_0 t+\phi}$, the output will be of the form $y(t)=|H(j\omega_o)|\centerdot A \centerdot e^{j(H(s)\omega_0 t+\phi +\theta_H)}$ where $H(s)|_{s=j\omega_0} = |H(j\omega_0)|e^{j\theta_H}$ is the transfer function of the system evaluated at the frequency $j\omega_0$. My point is that the system does not modify the input frequency.

Does the same hold true in the discrete-time context? If I supply an input $x[n]=a^n$ to an LTI system, will the output also contain $a^n$? Or is it possible to supply $a^n$ and get the output $b^n +c^n$ where $a\ne b\ne c$ (for example, $x[n]=(1/6)^n$, $y[n]=B(1/2)^n + C(1/3)^n$)?

Edit: I've posted a related question that contains the issue that actually prompted this question...


texts: Transmitting over Unknown Fading Channel

texts:
I have a system with no diversity and the channel's coefficients change every $T = 10\text{ bits}$ transmitted. The channel estimation system has a flaw and detects the channel's coefficients equal to $h$ while their real values are $h+c$ where $c$ is a constant equal to $1$.

Is there any method I can apply to achieve a better BER than simply using the faulty $h$?

I am using BPSK.


texts: Kalman Filter - Deriving state transition function

texts:
I am relatively new to using Kalman Filtering. Currently I am trying to understand it and how to implement it in Matlab. I found a website with some nice examples that I would like to rewrite in Matlab using the unscentedKalmanFilter() function. The website is Kalman Filter examples and I am trying to rebuild the first example where depending on some measurments with noise the weight of a gold bar is estimated.
I've come up with some code but I doubt that my state transistion function $f$ is correct. From what I understand one needs the measurement function $y=h(x)$ calculating the state $x$ from the measurement $y$ and the state transition function $x_{n+1}=f(x_n,u)$ where $x_{n+1}$ is the prediction for the next state from the input $u$ and the current state $x_{n}$.
As the gold bar weight is directly measured the measurement function should simply be $h(x)=x+v_{k}$ with $v_k$ being the additive noise term. For the state transition function I don't have an idea. In the example they write $\hat x_{n}=\hat x_{n-1}+α_n(y_n−\hat x_{n-1})$ where $y_n$ is the last measurement and $α_n$ a factor. However I don't think the state transition function $f$ should include the measurement.
So maybe someone could enlighten me. Here is the Matlab code I have so far:
initialStateGuess = [1030];
n=length(initialStateGuess);

h=@(x)[x(1)];% Measurement function
f=@(x)[x(1)];% State transition function

ukf = unscentedKalmanFilter(...
    f,... % State transition function
    h,... % Measurement function
    initialStateGuess,...
    'HasAdditiveMeasurementNoise',true,...
    'HasAdditiveProcessNoise',true);

yMeas = [1030 989 1017 1009 1013 979 1008 1042 1012 1011];% Measurement Values
R = var(yMeas);%0.2; % Variance of the measurement noise v[k]
ukf.MeasurementNoise = R;
ukf.ProcessNoise = 60;

Nsteps = length(yMeas); % Number of time steps
xCorrectedUKF = zeros(Nsteps,n); % Corrected state estimates
PCorrected = zeros(Nsteps,n,n); % Corrected state estimation error covariances
e = zeros(Nsteps,1); % Residuals (or innovations)

for k=1:Nsteps
    % Let k denote the current time.
    %
    % Residuals (or innovations): Measured output - Predicted output
    e(k) = yMeas(k) - vdpMeasurementFcn(ukf.State); % ukf.State is x[k|k-1] at this point
    [xCorrectedUKF(k,:), PCorrected(k,:,:)] = correct(ukf,yMeas(k));
    predict(ukf);
end

plot(xCorrectedUKF')
hold on
plot(yMeas)
plot(1010*ones(1,Nsteps))
legend('Kalman FIlter state','Measurement Values','True Value')

Edit:
As can be seen in the above picture the Matlab code I wrote does work. As more measurements come in the state gets closer to the true value. However the variance value for the Process Noise seems to be quite relevant to achieve a fast convergence. Even after playing around with it for a bit I don't manage to achieve that fast convergence as in the example:

So I wonder why my code convergeces so slowliy?
Edit2:
As suggested I have tried to set the process noise to 0 and the measurement noise to the variance of the measurement values. However this results in a very slow settling time. Might this have to da with me using an unscented Kalman filter? I thought that would be a good choise as I can use it also for other, nonlinear problems.


texts: How to remove 750Hz sinusoidal background from audio using FIR filter?

texts: Kindly help me to design a FIR filter for eliminating the 750 Hz sinusoidal beep from audio. I shall be thankful to you


texts: How do you get FFT for negative $k$ values?

texts:
I am reading a book (am a programmer so I suck at math) and it states that for a number of $k$-values that are symmetric around 0 (for example $k = -3, -2, -1, 0, 1, 2, 3$), we need to calculate

$$\sum_{j = 0}^{N - 1} x_j e^{-2\pi i kj/N}$$

and the book claims this can be done with FFT.

I know nothing about FFT but Wikipedia tells me that FFT can calculate above sum for $k = 0, ..., N - 1$ in $O(N\log N )$-time.

How does the book then intend to apply FFT to get the values for the $k$ we are interested in here? We want the sum for $k = -3, -2, -1, 0, 1, 2, 3$, but the FFT will calculate them for $k = 0, 1, 2, 3, 4, ..., N - 1$.


texts: How to compute the impulse response from incomplete frequency response data?

texts:
I need to compute the impulse response of a system, but I only have access to the frequency response data.

This data contains the output magnitude of the system (for a fixed input amplitude) at frequencies between 10Hz and 400Hz, sampled at each 5Hz (10, 15, 20, ..., 395, 400) with a 1000Hz sampling frequency. The magnitude past the area of interest tends towards zero, but was not measured directly.

I dont have phase information (or a way to obtain it), but I only care about magnitude information.

Here's a quick graph of the data I have:

(Amplitude units are undefined, but aren't meaningful since an arbitrary scaling factor is added during processing steps.)

How can I obtain an impulse response of the system with incomplete frequency response data?

I'm thinking of using the IFFT function in MATLAB, but I am unsure of how it will interact with the gaps and the missing information past 400Hz.

I assume I could pad the data with zeroes, but up to how many?

I can also obtain more data to "fill in" make the gaps smaller, but there will always be some since I could also sample at non-integer frequencies.

EDIT for extra context:
I am trying to implement a parallel filter design to equalize the magnitude response of my system, based on the works of Balasz Bank. The author provides MATLAB code to determine the parameters of the system, but said code requires the impulse response of the system as input, not the frequency response.

The code takes the impulse response as input, converts it to minimum-phase and then computes the filter parameters using a least squares method. (The actual code is in the roomcomp.m and parfiltid.m files)

The end goal of the equalizer is to get a flat frequency response for the amplitude (In this case, amplify 0-50Hz, attenuate 50-200Hz and amplify 200+Hz). The system takes in a 1kHz signal as input, equalizes it and outputs the result in real time at 1kHz.

I'd like to take phase into account eventually, but due to time constraints, for now any solution that results in decent equalization works.


texts: When should I use a frequency spectrum rather than a spectrogram representation?

texts: It seems to me that the spectrogram representation of a finite signal gives you significantly more useful information than a frequency spectrum.  As I understand it, the spectrogram breaks down the spectrum over time whereas the frequency spectrum gives you no time dependent information.  Why wouldn't I want to use this kind of representation all the time?  When would it be more useful to use the frequency spectrum rather than the spectrogram?  Is it just computationally expedient to produce a frequency spectrum?


texts: In DSP - is it true that the only type of interfering wave occurs when frequencies match?

texts: Therefore, any other frequency, no matter the amplitude, won't interfere or degrade original wave in the DSP frequency domain systems?


texts: Could not construct original matrix using SVD

texts:
I need to

read a .wav file
make a 2D matrix from it using the STFT
generate its singular value decomposition
do some watermarking

but I can't build the original matrix again via matrix multiplication:

 x = audioread('0.wav');
 stft = spectrogram(x);
 [U,S,V] = svd(stft);
 stftb=U*S*V.';

The problem is that STFT and STFTb are not the same.


texts:
I have the problem below. It sounds simple but for some reason I have been stuck on it for a long time and don't know what am doing wrong.

Am trying to solve this using correlations.
So we all know that the variance $\sigma _y^2\:=\:R_y\left(0\right)$ which is basically the correlation of $y$ evaluated at zero.
Now we know the convolution $y(n)\:=\:x(n)* h(n) = \sum _{m\:=-\infty }^{\infty }h\left(m\right)x\left(n-m\right)$
Using the idea of correlation, I get the following:
$R_y\left(k\right)\:=\:E\left(y\left(k\right)y\left(n+k\right)\right)\:=\:E\left[\sum _{m=-\infty }^{\infty }h\left(m\right)x\left(k-m\right)\sum _{m=-\infty }^{\infty }h\left(m\right)x\left(n+k-m\right)\right]$
Now am so stuck here and just don't know what to do. Please help me by directing me in the right direction and by providing clear and coherent steps and explanations. Thank you very much in advance.


texts: Improving the performance of the Hough transform

texts:
I have just started doing image processing, and I am currently working on line detection. I am using Hough transform on the image below.

I'm wondering how I can improve the efficiency of the Hough transform? Before applying the transform what can be done (pre-processes) to improve the performance?


texts: MATLAB: filter nonperiodic noise in the signal

texts:
I have gone through the below related posts of filtering noise from the signals

MATLAB, How to filter a discrete signal?

MATLAB: Filter a noisy EKG signal

But the signal I want to filter contains noise which is not periodic as shown in the images below:

Can anyone suggest a filtering technique for the noise labeled with red colour in the image?


texts: The Number of Sine and Cosine Waves in an $ N $ Point DFT

texts:
This is bound to be an embarrassingly simple question, but here it goes...
I was reading the chapter on discrete Fourier transforms (DFT) of this really didactic online book, The Scientist and Engineer's Guide to Digital Signal Processing, by Steven W. Smith and I got stuck thinking about the last sentence in the caption to this illustration:

The parameter, $k$, determines the frequency of the wave. In an $N$
point DFT, $k$ takes on values between $0$ and
$\color{red}{\frac{N}{2}}.$

He goes on to say with regards to the $32$-point DFT,

Fig. 8-5

shows some of the $17$ sine and $17$ cosine waves used in an N = $32$ point DFT.

So it seems to indicate $16$ sine waves, or $(N/2)$, plus the constant component, and a parallel split for cosine waves.
However, the DFT is defined as:
$$X(k)\equiv \sum_{n=0}^{N-1} x(n)\; \exp\left(\mathbf-i\frac{2\pi}{N}kn\right), \quad k=0,1,\dots,\color{red}{N-1}$$
which is $\color{red}{N}$ values of $k$, not $\color{red}{\frac{N}{2}}.$
And given Euler's formula:
$$e^{-ix}=\cos x - i \sin x$$
it seems as though there should be an equal number of sine and cosine basis equations: one of each frequency parameter $k$ for a total of $N$ sine and $N$ cosine.
Of course, at some points, the sine or cosine components will be zero (as we move around the complex plane, and depending on $N$), but not necessarily $\frac{N}{2}$. For instance, the $4$-point DFT would indeed either fall on the $x$-axis (real - cosine), or $y$-axis (imaginary - sine), splitting the basis function in half. Yet this seems to be a very sweet and unique example.
What am I missing?


texts: Fourier series of a square pulse (simple simplification)

texts:
Hi guys I'm currently studying for finals and I came across a square pulse problem.

I ended up getting this:

I'm wondering if I can simplify this to a sin function. If so how? And please correct me if I did the problem wrong in the first place.


texts: LMS and delta impulse response- Equalization concepts

texts:
I have been reading about equalization and channel estimation in order to apply to my application of estimating trajectory path for a two-wheeled robot. The application is quite similar to equalization.  I am studying the Least Mean Square algorithm (LMS) and have some basic doubts regarding how to determine if equalization is proper or not i.e., if there is a measure to quantify how much of the signal has been estimated properly. I am following this MATLAB implementation.

Doubt 1 :
The cost function for LMS is constructed using the input, so we are minimizing the error function. So, based on my understanding the input is known to the receiver. Hence, the LMS equalizer is not blind. Please correct me if wrong.

Doubt2:
On running the code (using the same parameter settings in the code), I cannot understand what is the significance of the fourth tap having a magnitude one. Is this the delta impulse in the third subplot.

Does having a delta function mean that equalization is correct? I had read that for equalization to happen, the convolution of the estimated channel coefficients (here these are the weights of the LMS) and the known channel impulse should be a delta function. Does this graph convey the same? Could somebody please explain this concept of delta impulse and the graph?


texts: Image Filtering by Averaging Similar Areas of the Same Image - Patch Based Processing

texts:
I heard of filtering algorithms which, to filter an image specific area, find similar areas in the image and average them to reduce the noice of the original area. E.g. an edge of a house can be more or less the same in the whole image, so one can make many patches from that area and average them. It should be similar to using multiple shots of the same scene and averaging them to make a final image.

What's this algorithm called? I'd like to learn more about it as I found it pretty interesting. But couldn't find them on the Internet so far except some general averaging algorithms.


texts: A basic question in FIR filter design using MATLAB

texts:
I was reading from Internet about FIR filter design using MATLAB, and I saw parameters like passband frequency, stopband frequency, passband attuenation, stopband attuenation, etc. What made me confused was the parameter sampling frequency.

I don't understand the significance of sampling frequency with respect to a filter. Is it the sampling frequency of input signal that this filter can work on or is it something else?


texts: What is the reason for this 'linear "error"'

texts:
Here's MIM (Magnitude Invariance Method) thesis (press the "View PDF" to get the theis with MATLAB code in hands) and here's a plot showing the issue I'm trying to solve:

Magnitude responses for one pole LP filter at few frequency locations.

As plot shows, there's some sort of an issue in MIM function c2dn() implementation, which 'moves' the fc point especially at low fc values. *IIRC, same type of error happens when changing the fs.*

Analog prototype LPF is calculated as:

w0 = 2*pi*fc;
Analogb = 1;
Analoga = [1 w0];
Analog = tf(Analogb, Analoga);
Analog = Analog/dcgain(Analog);

which is then given as an input for to calculate the MIM filter:

fs=44100;
mimpim = 'mim';
samplingtime = 1/fs;
numofsamples = 2048;
[Dz1] = c2dn(Analog, samplingtime, mimpim, 1, numofsamples);
%[a, b, T] = tfdata(Dz1);   %coeffs

where c2dn() is the function from MIM paper.

Plotting:

fs2 = fs/2;
nf = logspace(0, 5, fs2);
[mag, pha] = bode(Analog,2*pi*nf);
semilogx(nf, 20*log10(abs(mag)), 'color', 'g', 'linewidth', 1.5);
axis([10 fs2 -50 1]);
hold on;[mag, pha] = bode(Dz1,2*pi*nf);
semilogx(nf, 20*log10(abs(mag)), 'color', 'k', 'linewidth', 1.5, 'linestyle', '--');grid on;
title('Various TF (LPF 1)');
legend('Analog', 'MIM','location', 'southwest');
xlabel('Hz');ylabel('dB');

So far, I've found out that the fc error is quite linear (I picked -3dB points for few fc and then calculated the trend f(x) (R² was 0.99989...)) so, one could probably find the source for "error" by just looking the matlab codes for MIM function c2dn().

Here's plot showing the effect of my correction f(x):

Correction formula f(x) = 0.9704384746x - 51.6991952722 works well for fc in range 60Hz-Nyqvist (fs=44.1kHz) and can even be improved a bit. (Note: correction for fc=10Hz showen in plot  is done using another formula so you can omit it as a result of this f(x)).

Any suggestions regarding the source for this "error" ?

EDIT: I quess the functionality behind the issue can be located to cepstral processing block ... there's a line with remark: "% minimum phase sequence r^mn" where h is recalculated using lmn matrix created earlier in "homomorphic filtering" block:

h = h.*lmn';

When this line is turned to a comment, magnitude plots looks good for any fc (if the numofsamples parameter has suitable (big) value):

Problem is that commenting the line leads to the aliasing issue which is common for this type of filter... :( .

Any thoughts if this (homomorphic filtering/cepstral processing) can somehow be improved to result the fc point untouched?

EDIT2:

When the resulting LPF order is 3 or more this issue in discussion is not present anymore:

(numofsamples=4096, fs=44.1kHz, fc=1...N Hz)

--> could it just be so that the fitting method used there in function c2dn() isn't suitable for low order filter?


texts:
I'm trying to implement noisy AR(1) process and plot it. The observed noisy sequence x(n) = s(n) + w(n) where variance of w(n) = 0.2.

s(n) is defined as an AR(1) process with s(n) = 0.5 s(n-1) + e(n), for n=1:100, s(0) = 0 and the variance of e(n) = 1. w(n) and e(n) are independent.

I first do the following:

N = 100;                       % number of process samples.
a = [1, 0.5];                  % denominator coefficients, p = 1.
b = 1;                         % numerator coefficient.
s = filter(b,a, randn(1,N));   % generate N sample of AR(1)

nu = sqrt(0.2) * randn(1,N);
x = s + nu;

figure(1)
plot(s,'r');
hold on;
plot(x,'g');
legend('AR(1) Process','Noisy Process');

Can anybody help me whether I do the correct thing. Any help would be appreciated.


texts: Transfer functions from wavelet transform

texts:
So I have this problem where I need to measure the phase of a signal and correct for a delay associated with the travel time of the signal while simultaneously determining the transfer function of my system (with the delay corrected).

So I thought I probably need a wavelet transform so that I can determine when my signal arrives as well as the spectral components of the signal, but my transfer function is supposed to be defined in terms of the fourier transform of my signal (transfer function $H(\omega)$ is defined as $\frac{\mathscr{F}\{S_{out}\}}{\mathscr{F}\{S_{in}\}}$), so my question is:

What kind of transform do I need to run on the wavelet transform (i.e. CWT) in order to get the fourier coefficients of my signal at different times?
As an additional question to this, is it even necessary to apply a second transform afterwards to get the correct transfer function, or could I perhaps deduce my transfer function directly from the wavelet transform?
Basically in the shortest amount of words possible, how do I get transfer functions from wavelet transforms?


texts:
Consider  a static AWGN channel
$$
Y = hX+N
$$
where $h$ is a constant channel gain and the noise $N(0,N_1)$ is independent of the input $X$.  The input is from a 2-PAM constellation, i.e., $X \in \ \left\{+√p,-√p \right\}$ with equal probability where $X= +√p$ is used to send a bit at 1 and $X=-√p$ is used to send a bit at 0.  The decision rule is follows: decide that 1 was sent if $Y>0$ and 0 otherwise.

Find the probability of error as a function of $SNR:=\left|h\right|^2 P/N_1$ (express it through the $Q$ function).
what is approximately the behavior of the average probability of error when $SNR>>1$?


texts: Compute Power Delay Profile (PDP) from Delay Spread

texts:
I have data pertaining to channel obtained from measurements. In order to make use of this data, I need to convert it into a form as follows:

    ChanMod.PDP_dB = [-2.5   0 -12.8  -10    -25.2  -16; % Average power [dB]
                      0 300*10^-9 8900*10^-9 12900*10^-9 17100*10^-9 20000*10^-9]; % delay (s)
    ChanMod.normH = sqrt(sum(10.^(ChanMod.PDP_dB(1,:)/10)));

However, the data from the measurements is in the form of Delay spread vs distance. I am not sure how to determine the power delay profile from the Delay spread data.

I am new to signal processing. Any help would be appreciated


texts: Fourier Transform of Morlet wavelet Function?

texts:
One definition of the Morlet wavelet function is given by:
$$\frac{1}{\sqrt{\pi f_b}}e^{\frac{-t^2}{f_b}}e^{j2\pi f_c t}$$
The Fourier transform of this equation is:  $e^{-\pi^2 f_b(f-f_c)^2}$ (is it right)?
First I attempted to plot the FFT of Morlet function by FFT function in Matlab,  then I've plotted the Fourier transform function directly. I've expected to see same plots, but unfortunately they have different magnitude (why?). I publish the plot and my codes, do you have any idea why this happened? Is there any problem in my codes? Or any problem in the obtained Fourier transform? Or any problem in Matlab built-in FFT function?

I wrote this script to get those plots:
clear all;
fS = 500;
tStart= -4;
tStop= 4;
timeVector = linspace(tStart,tStop, (tStop-tStart)*fS );
fC = 2;
fB=2;
timeMask = zeros(1,length(timeVector));
timeMask((timeVector >= -fB/2) & (timeVector <= fB/2)) = 1;
psiWavelet = ((pi*fB))^(-0.5).*...                   % Morlet function
exp(2*1i*pi*fC.*timeVector).*exp(-timeVector.^2/fB); % Morlet function
%      FFT plot by matlab bulit-in FFT function
     Nfft =10*2^nextpow2(length(timeVector));
    FFT =fftshift(abs(fft(psiWavelet,Nfft)));
    freqs=[0:Nfft - 1].*(fS/Nfft);
    freqs(freqs >= fS/2) = freqs(freqs >= fS/2) - fS;
    freqs=fftshift(freqs);
    figure(2);
    subplot(1,2,1)
    plot(freqs, FFT);
    xlim([-1  5]);
    xlabel('Frequency / Hz');
    title (sprintf('Fourier Transform'));
%     FFT plot by its direct fourier transfrom function
    f_psi=exp(-(pi^2*fB)*(freqs-fC).^2);
    subplot(1,2,2)
    plot(freqs,f_psi)
    xlim([-1  5]);


texts: Can we have a Digital Anti Aliasing filter?

texts: I am working on a board that has no antialisaing filter at the input of the ADC. I have  option to I implement my own filter using RC + Opamp circuit. But is it also possible to implement Anti Aliasing filter after sampling by ADC and processing in Digital domain: a digital Anti aliasing filter?


texts:
I am making an IIR Filter and I am running into problems with stability with higher orders. The values go off to infinity as soon as it starts.

So far, I've been using MATLAB to generate my filters and then running them in an embedded system. I'm using a band-pass filter, state-space representation and single precision values. If I understand this correctly, the issues happens because the poles are getting too close to the unit circle, so the rounding errors on my coefficients or state space are getting out of hand.

I could reduce the order, but that feels wasteful when I have the computational power to run a higher order filter. Is there a filter design that will improve at a higher order while giving the poles a good margin?

Alternatively, Is there another trick I can use to mitigate this issue?


texts: DSP Hardware for Detecting an Audio "Click"

texts:
I am working on isolating a specific audio click in a factory type setting. After my initial analysis I determined that a 2-pole High Pass Filter set between 500 and 800Hz would work best for me.

The timing can be random on when the clicks occur due to human interaction. The shape of the click is a "spike" shape. I do not have the images with me on this workstation but I can get them next week if it helps. Thus the process is not completely automated as a user is inserting the connectors together however the goal is to limit human error so as little interaction with this implementation as possible is preferred.

There will always be 3 clicks. Click A and Click B are very pronounced but Click C is very quiet and up until now a very expensive camera system was used to capture Click C visually.

Potential Microphone: link

However I was curious as to what DSP hardware would be recommended for analyzing such waveforms in a fast and efficient manner.

Side Note: I am leaning towards IIR due to ease of use and tweaking if that is an incorrect assumption please correct me.


texts: How does one compute the band width of a signal in the time domain $x(t)$?

texts:
Sorry if this is a super easy question, I am really not a signals guy (more of a statistician, computer scientist). But I was trying to reconstruct/learn a sinusoidal function $x(t)$ with linear regression $f(x) = \langle w , \phi(x) \rangle $ (I'm adding as many polynomial features as I may need) over a fixed interval $[-1,1]$. Then I realized that there is this thing called the Nyquist-Shannon sampling theorem that might help figure out if I have enough samples. The reason that I care about it is because the performance of my regression model is really bad on the test set and I wondering if I am just not getting enough samples from my ground truth signal (which for the moment I control synthetically). I know now that I need my sample frequency $f_s$ to be larger than twice the band width $B$ of my signal:

$$ f_s > 2B$$

to my understanding bandwidth is just the range of the frequencies present in the signal $x(t)$ (I even asked to clarify that to me just in case here: What is the definition of the bandwidth of a signal?). Thus if that is correct then band width is:

$$ B = f_{max} - f_{min} $$

is there a general way to get $f_{max}$,$f_{min}$ from a signal in the time domain?

If I understand this correctly then I just need to get the frequencies that define $x(t)$? Right?

If that is correct then the only way I know is if we know the analytic form of the $x(t)$, which I do for my example, then I just read of the frequencies from the Fourier series $ f(x) = \frac{1}{2}a_0 + \sum^{\infty}_{n=1} a_n cos(nx) + \sum^{\infty}_{n=1} b_n sin(nx) $. Say $n_{max},n_{min}$ are the largest values modifying the inside of sin or cos terms then we read them off and do:

$$ B = \frac{n_{max} }{2 \pi} - \frac{n_{min}}{2 \pi} $$

right? What happens if there is only 1 single term like it only a sin like $x(t) = sin(n t)$, how do we get the smaller frequency if there is no other frequency?

Now that I understand much better what the term frequency means I assume that the answer will point me that if I don't know the analytic form of my signal (as probably happens most in practice) we need to resort to some type of transform used. Probably the Fourier transform? But a quick google search to the frequency domain yielded a list of methods:

Fourier series – repetitive signals, oscillating systems
Fourier transform – nonrepetitive signals, transients
Laplace transform – electronic circuits and control systems
Z transform – discrete-time signals, digital signal processing
Wavelet transform - image analysis, data compression

I don't know when to apply each but it seems the wikipedia article links to more articles for each one...

Is this correct or am I totally off? (which might be the case since I'm not very familiar with this field). I am assuming there are probably engineering details I am totally missing like flow pass filters or something else that might be important for real signals in practice. Though its just a random guess based on the definition of low-pass filter (filters high frequencies out). Though not sure.

Further reading What is the definition of the bandwidth of a signal? makes me suspect that the actual correct answer is as follows:

Consider a time domain signal $x(t)$.
Consider its frequency description $X(\omega)$

the the support of $X(\omega)$ is the bandwidth. In other words, "the summations" of the points in the domain (to be more precise, the integral of the domain). So if the domain is the whole interval $[-W,W]$ the the bandwidth would be:

$$ B = \int^{W}_{-W}d \omega = 2W $$

so in general is it:

$$ B = \int_{w \in supp(X(\omega))} d\omega $$

would be my guess.


texts: Eroding noisy borders of polygons in an image

texts:
I am new to image processing, and this is the task at hand.
I have a mask image of shape 500x500x1 that contains polygons.
These polygons (=vector data: common term in remote sensing and GIS) are labeled, and will be used as my target later on to classify crops. This vector data has been rasterized (another remote sensing and GIS term) and resulted in the 500x500x1 mask. As you can see the borders of all polygons are noisy (contains pixels of different colors==> different classes) although each polygon should correspond to one class (one color). I am guessing that something went wrong during the rasterization process;  I tried to erode the borders using simple morphological operations:
kernel  = cv2.getStructuringElement(cv2.MORPH_RECT, (2, 2))
erosion = cv2.erode(lulc_mask, kernel, iterations = 3)

However, this resulted in reducing the area inside the polygons and not the border.
Each time I increase the size of the kernel I basically erode the data from within the polygon, but the border remains the same.
Any idea on how to solve this?


texts: find the gradient direction at a point in a shape

texts: I am trying to implement the generalized Hough transform in matlab. The algorithm requires the gradient direction at each point in the shape. How can I measure $ \phi $ as shown in the figure below?


texts:
For the LTI system given below, there are three regions of convergence.

$$H(z)=\frac{5-3z^{-1}}{1-\frac53z^{-1}-\frac23z^{-2}}$$

a) Find all possible regions of convergence for this filter.

b) For each region of convergence, find the impulse response of the filter.

I tried this problem using the poles and came up with the following outcomes. Want to confirm

Are the ROCS $z<2$ and $z>-\frac{1}{3}$  and $z=3/5$? Any help in this regard is highly appreciated.


texts: Trying to find an intuitive understanding of OQAM/FBMC

texts:
I am trying to understand, possibly in an intuitive way,  why would OQAM/FBMC when used with a Phydyas filter lead to a signal that does not need any cyclic prefix just like in any OFDM signal also created by an IFFT
If the cyclic prefix is absent how would ISI be avoided?


texts: What are the classification methods available for face recognition watchlist screening?

texts: My intention is to develop a method that only able to recognize a target among the non-target (unknown people) groups. What algorithm/method can I go through to build this type of classifier. It is like building a object detector? Where the detector, as an example is train to only detect particular object (no matter what the object looks like). Should I look into machine learning algorithm; genetic algorithm, neural network or evolutionary algorithm? However the problem is, the condition of my work only allow one still image (in frontal face view) of the target.


texts: Can amplitudes be used to differentiate one signal from another?

texts:
I have use case, where there are lot of sensors placed under ground.The sensors give amplitudes each second.So my aim is to detect if some anomalous activity takes place at that point.

IF an activity such as digging takes place, there will be variation in amplitudes, so can that data be fed to a machine learning model and find the anomalous activity taking place?

I have signatures of activities like drilling,digging,augering etc.But my question is amplitude a unique feature here or do I need to consider things like frequency?


texts: Is this graph of Wigner-Ville distribution OK?

texts:
I am studying some code for smoothed Wigner-Ville distribution.

update 3- solution, graph was over amplified in a 2d overdrive/oversaturation effect. if i divide by 20 only a line is visible.

Update - indeed there is a bug, the current image is from 128 samples of a $44.1\textrm{ kHz}$ signal where sample[i] = sin[i/10.0]; i.e. a $4410 \textrm{ Hz}$ sine wave, to fit inside the 128 samples.

As suggested by JazzManiac, here is the code which is causing errors, it's actually P Kootsookos Cohens.C code, with a minor change, instead of a .raw input audio TFD file i am using a sine wave array in get_my_signal function... A trivial and simple patch, wouldnt you agree? that can't be the error?!

I have a professional C programmer who has been coding for 30 years who provided this version of the code, it's just setting the argc and argv options in advance, to spwvd, hamming, and default window (was 128, is now 1024).

Is smoothed Wigner-Ville the same as smoothed pseudo Wigner-Ville?...

The original author (i.e. me) gets this for each of the three test cases:


texts:
This is a line from a paper I've been reading:

  The static gain of the closed loop system must be $1$ ($G(1) = 1$) [...]

First of all: I know what gain is, but isn't gain dependent upon frequency? And why does $G(1)$ do the trick of determining the static gain? And what is "static" gain, anyway?

We are talking about a discrete-time closed loop system and $G(z)$ is its transfer function.


texts:
I have the audio stream below, which is a recording of Arabic. I am trying to split the stream into individual letters. I have manually marked the ideal locations with black lines in the image below. As you can see, there are definite feature changes at all these points, which gives me hope. Even the fourth one could potentially be further split into two about a third into that segment.
I have had partial success using Python's pydub library's split_on_silence() function. It's more geared towards finding word breaks, by looking for periods of silence. Given the partial success with this again gives me hope.
Any ideas on where I can go with this in an attempt to find these breaks using DSP techniques? It's as if I need to find the points where the frequency spectrum changes, but I have no idea how to do that.

For background, I am trying to solve this problem: Testing user's pronunciation of Arabic against correct pronunciation
UPDATE: The second image below is of the filtered signal and STFTs. I'm still getting familiar with interpreting these plots, but I think it's showing each STFT vertically by shading based on the magnitude of each frequency for that STFT. The time axes roughly align (there's just a border around the first). I don't see the distinguishing features I had hoped for. I wonder whether it's the amplitudes I need to look at, as those visually appear to be changing?

UPDATE2: Attached plot with a 2nd degree moving average (using Hilbert transform).

UPDATE3: Attached plot with moving average (using my own method of averaging over 17 points) in orange, and STFTs of this moving average. This time I extended the plot to the full audio file, which is longer than the initial wavelength I posted right on top. More features are becoming apparent. Is it enough to detect these features?


texts:
I want to calculate the total bit rate of a video system.

In order to calculate the total bit rate for a 1080/50p video system(4:2:2) we need:

•   Luminance sampling rate:Fs=13.5MHz  (standard for 4:2:2)
•   Number of bits: N=8
•   Number of components per PEL:  M=3 (Y,Cb,Cr)
•   Number of lines: L=1080
•   Line duration: Tline=?
•   Frame Rate:  Fr=50

I dont know how to find line duration. Is line duration Tline=L/Fs ??


texts:
I've been wrestling with this question for way too long. I appreciate any insight you can offer. Thanks.

  If the $9$-point sample sequence $x(n)$ represents a time domain signal sampled at $48\textrm{ kHz}$, what frequency does the eighth term $X[7]$ in its DFT correspond to?


texts: Difference Between Correlation / Convolution and Matrix Multiplication

texts:
Can anyone please clarify the difference between correlation/convolution and matrix multiplication? As I thought either convolution or correlation is similar to matrix multiplication. I read this question difference between convolution and multiplication, that is about simple multiplication.I am asking about matrix multiplication.
Thanks in advance.


texts: What does the output of Gaussian Mixture Model (GMM) represents in a HMM-GMM based speech recognition application?

texts:
Till now I know that- first the speech is converted frames and feature vectors are calculated for each frame using MFCC. And while training the Acoustic model- HMM model is generate for each phoneme and each such HMM model has 3 states representing starting, middle and ending of context dependent phonemes. Also each of these states gives the likelihood probability for a given observation sequence using GMM.

My question is:

What is this observation sequence taken in GMM, is it the feature vector of a single MFCC frame or a sequence of MFCC frames ? If not then what exactly are these observation sequences and how are they related to MFCC feature vectors.


texts: Order one FIR Filter with complex coefficient

texts:
I am trying to learn about the behavior of the FIR filter however with complex coefficients.
The filter I am trying to analyze is the following:
$$H(z)=a+jbz^{-1}\quad\text{where the variable}\quad j = \sqrt{-1}$$
Now by setting $a = 1$ and $b = -1$ we obtain the filter $H(z)=1-jz^{-1}$
If we consider a discrete complex input signal $x[k] = \{x[0], x[1],...,x[N]\}$ where $N$ is the signals length and $k$ is the discrete index.
By applying the filter on the input signal $x[k]$ we get the output $y[i] = x[i]-jx[i-1]$ with $i <= N$. And by setting $z = e^{j\omega}$ and by substitution we get $H(z) = a + jb\cos(\omega) + b\sin(\omega)$.
If we evaluate the frequency response now $|H(z)| = \sqrt{(a+b\sin(\omega))^{2}+(b\cos(\omega)^{2})}$ so in the set example we will get
$$
|H(z)| = \sqrt{(1+\sin(\omega))^{2}+(-\cos(\omega)^{2})}
$$
Phase will be
$$
\text{phase}(H(z)) = \tan^{-1}(b\cos(\omega))/(a+b\sin(\omega))
$$
again for the example we will get
$$
\text{phase}(H(z)) = \tan^{-1}(-\cos(\omega))/(1+\sin(\omega))
$$
But how do we proceed in the analysis?

What would be the effect of such filter on the complex input signal $x[k]$? What about if it was a real signal?
How do we analyze and interpret the magnitude, phase, and z transfer
function with respect to the coefficients $a$ and $jb$?

By modeling the example in MATLAB and plotting the Bode plot using the following commands:
q = tf('z',1);
myf = 1 - 1i*q^-1;
bode(myf)

We get the following output plot:

Thank you it is much appreciated


texts: Filtering method that minimizes ringing in time domain, implementable in Python

texts:
I am acquiring data through an oscilloscope, which I am then filtering. I am doing all of this in Python.

I need a bandpass filter with stop bands from 0 to .4MHz, and 4MHz and up. My pass band needs to be in the remaining region and would ideally be as large as possible.

I checked out a text from the library to help design a filter. The first filter I built was a Butterworth filter. However, the time domain response was awful for any decent frequency range, as I need an order 5+ filter.

I am now using the Remez (in scipy.signal) algorithm to generate my Transfer function coefficients. It looks All right, but I'm wondering if there is a better filtering option for flat time domain a fast frequency response?


texts:
I'm so happy that i managed to come at this level to understand Wavelet transform to some extent with the help of Stackexchange fellows, Initially i had so many difficulties as i had no concept of Frequency Domain, then I realized that in order to Understand DCT it is mandatory to have basic idea of Co-relation. After studying different books I managed to understand how Wavelets works and how it plot its plot.

Here is when I am analyzing the noissin signal in Matlab Wavelet Toolbox.

The db4 wavelet is used here with scaling of 1-48 and step size equals to 1.
The first Plot is the original signal and the second plot is its Wavelet tranform which seems easy enough to understand now.

but what are the other two plots (3rd and 4th) ?

Also, the book says that Wavelet transform plots time vs scale plot and the inverse of scaling is the frequency.

Here the scaling levels are 1-48 , so what are the frequencies supposed to be,
are they , 1/1 , 1/2, 1/3, 1/4, .....1/48 ?


texts: Normalized cut segmentation output correct or not?

texts:
I have implemented "normalized cut" segmentation. The change here is that, instead of giving an image as input, I have given an matrix of image. As my output looks odd to me. I need to know whether my implementation is correct or not.
Code:

clear all
tic;
% im = imread('lena.pgm');
im =[94 122 99 101 111 101;
99 92 103 87 107 116;
93 109 113 84 86 106;
5 17 6 54 56 53;
13 11 5 56 44 50;
0 10 5 49 42 51];
% resizing to avoid out of memory error
% cim=imresize(im,[100 100]);
cim=im;
[r, c]=size(cim);
ind=find(cim);
lind=length(ind);
[I,J]=ind2sub([r,c],ind);

% % I've used linear indexing to speed up the partitioning
% vectoring the pixel nodes
for i=1:lind
       V1(i)=double(cim(ind(i)));
end

% normalizing to [0-1] scale
V=(V1./255);

% w is the weight matrix (similarity matrix or adjacency matrix)
w=zeros(lind,lind);

% r, sigmaI, sigmaX values
rad=4.5;
sigi=10;
sigx=25;

% computing the weight matrix
for i=1:lind
    x1=I(i,1);
    y1=J(i,1);

    for j=1:lind
         if (i==j)
                 w(i,j)=1;
         else
                 x2=I(j,1);
                 y2=J(j,1);

            dist=((x1-x2)^2 + (y1-y2)^2);
            if sqrt(dist)>=rad
                dx=0;
            else
                dx=exp(-((dist)/(sigx^2)));
            end

            pdiff=(V(i)-V(j))^2;
            di=exp(-((pdiff)/(sigi)^2));
            w(i,j)=di*dx;
        end

    end
end

d=zeros(lind,lind);
s=sum(w,2);

% the diagonal matrix for computing the laplacian matrix
for i=1:lind
     d(i,i)=s(i);
end

A=zeros(lind,lind);
A=(d-w); % A is the laplacian matrix

%  vt has the eigen vectors corresponding to eigen values in vl
%  other eigs / eig functions in matlab can be used but I'm using the
%  function to compute the 5 smallest eigenvectors
[vt,vl]=eigs(A,d,5,'sm');

% se has the second smallest eigen vector, third and so on
se=vt(:,2:4);

% % % % % Simultaneous 'k' partitions
k=6;
id=kmeans(se,k);
imp=cell(1,k);
pic=cell(1,k);

for i=1:k
    imp{1,i}= find(id(:,1)==i);
    mat=zeros(100,100);
    in=imp{1,i};
    mat(in)=cim(in);
    pic{1,i}=uint8(mat);
%     figure,imshow(pic{1,i});
end

% pic has the sub graphs or partitiond sub images
figure;
subplot(2,4,1);imshow(uint8(im));title('Original image');
subplot(2,4,2);imshow(uint8(cim));title('Preprocessed image');
subplot(2,4,3);imshow(pic{1,1});title('Partition 1');
subplot(2,4,4);imshow(pic{1,2});title('Partition 2');
subplot(2,4,5);imshow(pic{1,3});title('Partition 3');
subplot(2,4,6);imshow(pic{1,4});title('Partition 4');
subplot(2,4,7);imshow(pic{1,5});title('Partition 5');
subplot(2,4,8);imshow(pic{1,6});title('Partition 6');
toc;

Output:

Thanks in advance.


texts:
I have a system using 16-QAM, with 2.4 GHz, working up to 2 km at different bit rates, e.g. 1Mbit/s.
My task is to provide graph, which will show relation between BER and distance for different bit rates. However, based on that article:
https://www.mathworks.com/help/comm/ug/bit-error-rate-ber.html#bq4230l and adding bit rates as errors in dB, I am able to provide the graph for BER vs. Eb/N0, I wonder- what is relation BER to distance?


texts: How does one calculate a steering matrix for DOA given real data and only antenna positions

texts:
I am currently trying to implement the MUSIC algorithm for a real dataset which captures a sound signal in a room using a cubic 8 sensor array setup.
Every example I've found for the MUSIC algorithm talks about the steering matrix and calculates it using a set of DOAs which are, well, the actual DOAs that the algorithm is trying to estimate? This part deeply confuses me.
All I have as inputs are:
X = [M x N] matrix, where M is the number of antennas, N is the number of timesteps of the signals. So essentially an 8 channel signal snapshot.
Y = [M x 3] matrix, which holds the 3D coordinates of each sensor.
It is worth noting that the sensors in my dataset are not actually a perfect cuboid. It's essentially two rectangles where the upper rectangle is above the other, but also slightly shifted in the X axis.
It is my understanding that a steering matrix should be computed using only Y. X is used later, for the eigenvector computation. So how would I go about generating this matrix if all I have are mic positions?
Any advice, literature would help me greatly.


texts: Is the path loss exponent $\alpha$ is always 2 in friis equation model?

texts:
In the friis equation,
the reference distance is 1m at the log distance path loss.

Then the formula would be:

$$P_r = P_tA_rA_t(\lambda/(4\pi))^2 /d^\alpha$$

where $d$ is distance between terminals, $P_r$ is received power, $P_t$ is transmission power, $A_r, A_t$ are the rx, tx antenna gains, respectively, and
$\lambda$ is wavelength.

It seems that the path loss exponent $\alpha$ is not mentioned.

But I haven't seen a case where this $\alpha$ isn't 2.

Is this $\alpha$ always 2 in the friis equation?

And can the simulation environment be used even if this $\alpha$ is not 2?


texts: Least Squares Filter Design: Deriving the Objective Function

texts:
I'm following the derivation in this paper A Comb Filter Design Using Fractional-Sample Delay to obtain the objective function for the least-squares filter design.

N-order FIR filter:

$H(z) = \sum_{n=0}^N h(n)z^{-n}$

Frequency response:

$H(\omega) = \mathbf{h}^T\mathbf{e}(\omega) = \mathbf{e}^T(\omega)\mathbf{h}$

where $\mathbf{h}=[h(0)\quad h(1) \quad\dots \quad h(N)] $ and $\mathbf{e}=[1\quad e^{-j\omega} \quad\dots \quad e^{-jN\omega}] $

Least squares error:

$J(h)=\int_{\omega \in R^+\cup R^-} |H(\omega)-F_d(\omega)|^2 d\omega$

where $R^+=[0,\alpha\omega]$ and $R^-=[-\alpha\omega,0]$

Which is rewritten in the quadratic form: $J(h) =h^TQh - 2h^Tp + c$

$Q$, $p$, and $c$ are given in the paper as follows:

$F_d(\omega)= e^{-jD\omega}$ and $h(n)$ is real.

I've been having trouble with getting these expressions for the Q matrix and p vector. How can I obtain them?


texts: Why do we integrate the modulating function in FM?

texts:
I've been reading about FM and I keep coming to an expression, where the instantaneous phase

$$\Theta=2\pi f_it+\phi\text, \tag1$$ where
$$f_i=f_c+k_fm(t)\text,\tag2$$
($f_c$ being the base carrier frequency and $k_f$ being some proportionality constant) is written as some sort of integral expression, like here:

$$\Theta_i\{t\}=2\pi f_ct+2\pi k_f\int_0^t m\{t\}\,dt$$

No clear explanation is given, apart from:

  The instantaneous phase of the modulated wave at any instant can be obtained by substituting 12.6 into 12.3 and integrating to get [the integral expression]

(12.3 and 12.6 being my equations (1) and (2) respectively).

Why do we need to integrate the modulator signal?

Why is the following not an accurate expression for the phase: $\Theta =2\pi f_ct+2\pi k_fm(t)t+\phi$, (simply plugging equation (2) into equation (1))?


texts: What Is the Walsh Hadamard Transform? How Could One Use It in Image Processing?

texts:
I am trying to teach myself about the WHT but there dont seem to be many good explanations of it online anywhere. I think I have figured out how to calculate the WHT, but I am really trying to understand why it is considered useful within the image recognition domain.

What is so special about it, and what properties does it bring out in a signal that would not show up on classical Fourier transforms, or other wavelet transforms? Why is it useful for object recognition as pointed out here?


texts: In the Block LMS algorithm, the input is partitioned into nonoverlapping blocks of size $L$ and the filter coefficients are updated once every $L$ samples. Would convergence improve if we used more frequent filter coefficient updates by using overlapping blocks? Having more "descent steps" per unit time would seem to imply faster convergence, but the lack of mention of this in any literature suggests otherwise.


texts: Singularity Detection from 2D Wavelet Modulus Plot

texts:
I was wondering if I could get some tips/resources on how to pick out the singularity from my 2D Continuous Wavelet Transform Coefficient Plot (scalogram) using the Gaussian Derivative as the mother-wavelet (the Mexican-Hat works well as well).

Here is an example of a plot.

How do I prevent false detections? What is the best way to sort through this to find the singularity? Should I only be looking at one scale and do a 1D signal peak Detection?

Any help would be appreciated. Thank you!


texts: How to determine which Fouriers Series terms to use to approximate a signal?

texts:
I have a signal (a time-series of air temperature values) that I can approximate quite well with a Fourier series. However, the number of terms in the series grows rapidly, to the point that 30 - 40 terms are needed for a good fitting.

So I was trying to understand how can I select only the Fourier series coefficients that convey the most information about the signal, and discard the others.

I could simply choose values of the series parameters a and b above a certain threshold value, but I do think this is not the right way to go.

I need to limit the number of terms because this approximate function will later be used for further elaborations, and the function must be input manually in the code (suggestions on how this task can be automated would be appreciated too).

I am not trying to predict future temperature or anything like that, I just need a function that can reproduce temperature oscillations with minimum period of ~12 hours.


texts: A Simple Algorithm to Filter / Smooth / Denoise a Noisy Staircase Graph

texts: Is there a way to remove the noise and smooth the graph into a staircase graph.


texts: Generate Complex White Gaussian Noise in MATLAB

texts:
In the followinf code I am trying to generate a Complex Gaussian Noise:
n_3 = sqrt(0.1)*randn(1,K);
n_4 = sqrt(0.1)*randn(1,K);
beta_NLoS = (n_3+1i*n_4); % CN(0,0.1)

Does my code do as intended?


texts:
I am working in face detection and recognition project. I am using STASM for face detction and locating face landmarks. On googling I found AAM (Active Appearance Model) and found that it is also used for face detection and locating face landmarks. Is AAM more efficient than STASM, can you provide your ideas like pros and cons between AAM and STASM or anyother better algorithm than these two?

Image input: Web-cam/secondary-cam of Ipad & Android Tablets/Phones

For the same set of training images - which one has greater range of performance w.r.t distance from camera/pose/illumination?


texts: How should one select this filter coefficient for a pre-emphasis filter?

texts:
My professor asked me why you choose $a=0.97$ in a pre-emphasis filter $H(z)=1-\frac{a}{z}$ for your pre-processing step.

What is the relation between $a$ and the filter?
How does this coefficient effect the performance?
Why do people use $a=0.9$ or $a=0.97$?


texts: How to use Joint Probabilistic Data Association Filter (JPDAF) for varying number of targets?

texts:
I have been working on JPDAF for two days, and I have to implement it using varying number of targets. As far as I studied, it is mainly used for fixed number of targets. I have studied different papers regarding birth, detection and termination of targets. But I am confused with the number of targets I have to set initially to start the algorithm as given in this PAPER.
Kindly guide me how do I proceed with the varying number of targets. I have completed the code with fixed number of targets.
It will be better if the code is provided.


texts: Particular Solution to Difference Equation

texts:
I have a system given by
$$y[n] - \frac{1}{4} y[n-1] - \frac{1}{8} y[n-2] =3x[n] $$
I want to solve for $y[n]$ for $x[n]=(\frac{1}{2})^nu[n]$.
The complementary solution evaluates to $[k_1(\frac{1}{2})^n+k_2 (\frac{-1}{4})^n]u[n]$.
But when I evaluate the particular solution consider $y_p[n]=k(\frac{1}{2})^n u[n]$ I get an absurd answer as $0=3$. And boundary conditions are not given either. What initial conditions am I to consider? I want to solve this difference equation without using Z-transform or Fourier transform.
Edit:
I took the particular solution of the form $$y_p[n]=kn(\frac{1}{2})^nu[n]$$ since the input is of the same form as the roots of the characteristic equation.
and get k as equal to 2.
and evaluate the coefficients of complementary solution as
$$y[n]=\frac{8}{3} (\frac{1}{2})^n u[n]+\frac{1}{3} (\frac{-1}{4})^n u[n]+2n (\frac{1}{2})^n u[n]$$
but the solution given is $$\frac{1}{3} (\frac{1}{4})^n u[n] + 4(n+1)(\frac{1}{2})^{(n+1)} u[n+1] + \frac{2}{3} (\frac{1}{2})^n u[n]$$
I don't where the anomaly in my evaluation is? Or is the given solution wrong?
I'm new to the concept of difference equations.
I just want to know if my understanding is right.
I wish to solve this difference equation without using z transform.


texts: How to determine degree of polarization in time domain!

texts: I know there are methods to determine the degree of polarization of multi-dimensional signals, say [Bx(t), By(t)] -> DOP(f). Is there any way to extract a DOP for given vector time series in the time domain? Thanks!


texts: Quantization step-size for a given signal based on its PDF

texts: I am familiar with the principles of midtread and midrise quantizer. However, I have difficulties determining the step size where it hasn't been explicitly given. For example, the following probability distribution of the input signal s(t) is given. This signal shall be quantized with 2 bit and we want to use a uniform, midrise quantizer. How can I calculate the step size and thus reconstruction values/decision thresholds for this quantizer?


texts: Generate noise with arbitrary covariance

texts:
I am doing a time series change detection experiment.  One of the experiments includes generating some artificial data for model evaluation.

I came across a problem in generating noise data with some arbitrary covariance at every 100 time steps.

While randn from Matlab allows me to generate the value, I am never able to figure how to change the covariance of the data.  Is there any example that I can refer to?


texts:
I am working on Speckle reduction in ultrasound images. I read a paper (snapshot of that paper is included below) where they have used a metric called beta metric which indicates the edge preserving capability of the filters. I tried to implement it using the equation (7) provided in the below snapshot.

This is the code.

 %---Beta Calculation
    h = fspecial('laplacian');
    I1 = imfilter(Orig_Image,h);
    I2 = imfilter(Esti_Image,h);
    I_1 = mean2(I1);
    I_2 = mean2(I2);
    metrics.Beta = sum(sum((I1 - I_1).*(I2 - I_2)))./(sqrt(sum(((I1 - I_1).^2).*((I2 - I_2).^2))));

As you can see that the beta value is a single value [1x1] vector in Table 2 inside the snapshot. But when I run my code, I get beta value of size 1x256 for a 256x256 image.
Is my code wrong? How to implement the given equation (7) correctly in MATLAB? Please help.


texts: Why are wavelet transforms (Multi Resolution Analysis) used more in practice for compression rather than Fourier series?

texts:
I know that both Fourier and wavelet can be used for compression of signals.

The Fourier series guarantees that it gets the closest approximation of the original signal in the least squared sense.  It also decomposes the signal into orthogonal components.  So, I wonder why it isn't obvious to always use the Fourier series as a compression algorithm?

The Wavelet transform allows us to observe frequencies at different times, because it is localized in time (at least relative to the fourier transform).  So it is only useful when we care about the interpretability of the components, it seems to me.

Why is the wavelet compression used in practice much more than compression using a fourier series?


texts:
I'm having some trouble implementing my LMS Adaptive Filter in MATLAB to separate wideband and narrowband signals from a voice signal.

I'm using a delayed version of my input as a reference as well as the error term.

step = 0.01;
w = zeros(1, N);
xDelayed = [zeros(1, 100) x']'; % delaying input

for n=1:length(x)
    e = x(n) - w(1)*xDelayed(n);
    w = w - step*e*xDelayed(n);
end

It's essentially an implementation of this

$$w(n+1) = w(n) - \alpha e(n) x(n)$$

For some reason, my entire w (N long) vector is all the same value.
UPDATE:

M = 5;
N = length(sound)
w = zeros(M, N);
STEP_SIZE = 0.01;
d = sound;
x = sound_delayed(1:N);

for i=(M+1):N
   e(i) = d(i) -  x((i-(M)+1):i)*w(:,i);
   w(:,i+1) = w(:,i) + mu * e(i) * x((i-(M)+1):i)';
end
for i=(M+1):N
    yd(i) = x((i-(M)+1):i)*w(:,i);
end


texts: Autocorrelation of discrete signal $\sin{2\pi fn}$

texts:
Determine the autocorrelation $r_{xx}[m]$ of the discrete signal

  $$x[n] = (\sin2\pi fn).$$

  where $n$ and $m$ are integers.

Using the definition I get

$$\begin{align}
r_{xx}[m] &= \sum_{n=-\infty}^{\infty}x[n]x[n-m] \\
&= \sum_{n=-\infty}^{\infty}\sin(2\pi fn) \sin\big(2\pi f(n-m)\big) \\
&= \sum_{n=-\infty}^{\infty}\sin(2\pi fn) \sin\big(2\pi fn - 2\pi fm\big) \\
\end{align}$$

but I can't seem to figure it out from here. I've tried using different trigonometric identities without result. I'm guessing it's something simple I'm missing.


texts: Are there condition numbers associated with the STFT, DWT?

texts:
Recently I learned that the DFT has good numerical stability since it can be represented as an orthogonal matrix, which has a condition number of 1.

Is it possible to represent the STFT and DWT as matrices and asses their numerical stability using condition numbers?

To be specific and capable of comparing stability between STFT and DWT, the wavelet would need to be a sinusoid as shown here (also should have an imaginary portion):


texts: What is the difference between Linear Interpolation factor and Sampling rate conversion factor?

texts:
I have come across sampling rate conversion factor, which is given by:

                             S_factor = F_new/F_old

If F_new > F_old, then s_factor > 1

and

If F_new < F_old, then s_factor < 1

But, what is this "linear interpolation factor"?. Is it the same as sampling rate conversion factor?

Does the linear interpolation factors value should be in the range 0 to 1?, If so, why is that?


texts: How the FFT takes a cosine or sine and outputs the frequencies of the complex form?

texts:
If i take the Fast Fourier Transform (FFT) of a cosine function, what has turned this cosine function into its complex exponential form which consists of $e^{i \omega t} + e^{-i \omega t}$ ?

Because on its own, cosine has a single frequency at omega, but the FFT must be interpreting cosine as a sum of its complex exponential because its output is amplitudes at frequencies $-\omega$ and $\omega$. So whats going on here?


texts: What are the uses of those three types of wavelet transformations?

texts:
In my studies of wavelets, there appear to be 3 different families of them:

The Continuous wavelet transform
The Discrete wavelet transform
The Redundant wavelet transform

They are all based on the same concept, but vary in how they are shifted/scaled, and/or decimated or not at every scale level.

My question is, where does each type find utility? For example, why would I want to use the Redundant Wavelet Transform over the Discrete Wavelet Transform, over the Continuous wavelet Transform in a particular application?

What advantages/disadvantages does one type of transform have over another, as far as its applicability is concerned?


texts:
I'm trying to understand a piece of code that is using a camera projection matrix. The camera projection matrix $P = \left[\begin{array}{c}p_1^T \\ p_2^T \\ p_3^T\end{array}\right]$ takes a point $X$ in 3D world coordinates and projects it onto pixel coordinates $x$ of an image. It is a $3 \times 4$ matrix. The 3rd row $p_3^T$ is the optical axis of the camera (neglecting the 4th element). The 1st and 2nd rows also correspond to the x and y axes if I normalize them.

In the piece of code I am working with, the norm $\|p_1^T\| + \|p_2^T\|$ is calculated. Any idea what this quantity could represent? It is called a "scale" factor.


texts: Can I calculate a half-zero data's FFT from its non-zero front part's FFT?

texts:
I have data whose latter half are all-zero. For example, data=[a, b, c, d, 0, 0, 0, 0], and front_half=[a, b, c, d]. Is there any way to obtain FFT(data), by some compute-efficient transform on the FFT(front_half)?

I made some work on the equations. The even items in FFT(data) are just equal with FFT(front_half). But the odd items in FFT(data) seems twisted with dot-multiply with a time-domain weight vector, which looks hard to be calculated from the FFT(front_half).


texts:
I have been reading about the non-parametric estimation of the spectral density, and I'm particularly interested in the Blackman-Tukey method. If we take the rectangular window we will have the truncated periodogram, computed on a reduced covariance sequence length $M$, where $M<N$:
$$\hat{P}(\omega)=\sum\limits_{k=0}^{M-1}\hat{r}(k)e^{-jk\omega}$$
where $\hat{r}(k)$ is the estimate of the covariance of the sample and $\omega$ is the frequency of interest. What I'm having trouble is: first, how do we choose our new sample of length $M$? could someone please explain how it does actually work without being too technical, like this explanation on how does the Bartlett method works


texts: Are radar resolution and detection capabilities not very tightly related?

texts: Radar detection capacity is the capacity to determine the presence or absence of targets whereas the resolution is the capacity to identify two closely separated targets.  If you can detect the target separately , you have resolved the targets.   If you resolved two targets, you have detected them too.  Thus are the detection and resolution tightly bonded if not the same?  I think, I am wrong some where and I want to know it.


texts: Difference between natural response and forced response?

texts:
Reference
Second post on EdaBoard.com

Time response of a system is the time evolution of the variables. In
circuits, this would be the waveforms of voltage and current versus
time.
Natural response is the system's response to initial conditions with
all external forces set to zero. In circuits, this would be the
response of the circuit with initial conditions (initial currents on
inductors and initial voltage on capacitors for example) with all the
independent voltages set to zero volts (short circuit) and current
sources set to zero amps (open circuit). The natural response of the
circuit will be dictated by the time constants of the circuit and in
general roots of the characteristics equation (poles).
Forced response is the system's response to an external stimulus with
zero initial conditions. In circuits, this would just be the response
of the circuit to external voltage and current source forcing
function... continue reading

Questions

How can there be even a natural response? Something has to be inputted to create an output? The way I see it is like turning of the main water line and then turning on your faucet and expecting water to come out.

How can we v(t) (from the link above) be solved for if we don't know dv(dt) in order to find the natural response?

If you can please expand on the 2 concepts (natural response and forced response) by explaining their differences in Layman's terms, it would be lovely.


texts:
Would I be right in saying that if a signal was sampled every 0.2ms, when converting it to digital. The sampling rate would be 5000(Hz)?

How would I go about working out the highest frequency it would have using the sampling theorem?


texts: High Level Process, Calculating Cepstrum When You Only Have Spectrum

texts:
I am not a DSP expert, so I would like someone to check my thought process:

I have a text file representing the spectrum (calculated by some FFT hardware), and I'd like to calculate a cepstrum.  I'm using Octave in the examples below, but it's not required.

My source data is two columns: frequency, amplitude, i.e.:

+----------+----------+
| 0.00E+00 | 6.93E+01 |
| 1.00E+01 | 6.95E+01 |
| 2.00E+01 | 7.38E+01 |
| ...      | ...      |
| 2.00E+03 | 6.51E+01 |
+----------+----------

Load the data in to Octave, and use ifft to put the spectrum into
the time domain.  Then use rceps to calculate the cepstrum:

rceps(ifft(my_data(:,2))); % my_data is the 2000x2 matrix from above
Plot the result of rceps.  The resulting curve should equal cepstrum that would have been produced if I had started with a time domain signal.

Is this a correct way to find the cepstrum when only spectrum (FFT) is available, or, is there a flaw in my thought process?


texts: Will the phase of the reconstructed data using a single MRI k-space point show any curvature?

texts:
Some courses tell that each point in k-space (spatial-frequency domain) represents a certain stripe pattern in spatial domain.

Reference: https://www.sciencedirect.com/science/article/pii/B9780444534859000027
Consequently, if I reconstructed the image using only a single point in k-space data, the phase of the constructed image will change periodically(Exactly speaking, it changes linearly. The periodicity comes from phase wrapping). This means there will be only straight lines in phase map.
Here is a simple MATLAB code snippet for demonstration:
I = imread('cameraman.tif');
ksp = fftshift(fft2(I));

for i=1:256
   k = zeros(size(ksp));
   k(128,i) = ksp(128,i); % choose a single point in ksp

   Ir = ifft2(ifftshift(k));
   phase_map = angle(Ir);
   imshow(phase_map,[])
   title(num2str(i))
end

But some other courses say: the phase map will show curvature if the encoding gradient has a poor linearity. For example, the content of stanford RAD229 https://www.youtube.com/watch?v=uO--lYGjvFM begin from 14:40.
The k-space data itself won't know whether the gradient is good or not, but the meaning of each point wouldn't change. If each point of k-space only represents a certain stripe pattern. The phase of the reconstructed "image" using a single ksp point will change periodically (which means no curvature in phase map) even if the gradient has a poor linearity.
Conflict: Which one is right? Is there any way to generate the phase map showed in RAD 229?
Update:
Here is a small demo in 1D case：
import numpy as np
import matplotlib.pyplot as plt

mx = np.zeros([256,1])
mx[96:128+32] = 1
plt.plot(mx)

ksp = np.fft.fft(mx,axis=0)
plt.plot(np.abs(ksp))

k = np.zeros(ksp.shape);

# voxel #2 and #3 were mis-placed using an imperfect gradient
k[3] = ksp[3]+ksp[2];

rec = np.fft.ifft(k,axis=0);
phase = np.angle(rec)
# it's a straight line after unwrapping
plt.plot(np.angle(rec))

My question is about the variable phase in this code. If the video is right, the plotted phase should be curved. But the result shows that the phase is still  a straight line( after phase unwrapping).

I've acquired some images using a poor gradient unit. The images are distorted obviously but I cannot find any curvature when analyzing these data using the above mentioned matlab code.


texts: What's wrong with this Average Magnitude Difference algorithm?

texts:
I implemented this Average Magnitude Difference algorithm in Javascript

var abs = Math.abs
var floor = Math.floor
var POSITIVE_INFINITY = Number.POSITIVE_INFINITY
function autocorrelation (data) {
  var length = data.length
  var halfLength = floor(length * 0.5)
  var summation = null
  var smallest = POSITIVE_INFINITY
  var smallestOffset = null
  for (var o = 1; o < halfLength; o++) {
    summation = 0
    for (var i = 0; i < halfLength; i++) {
      summation += abs(data[i] - data[i + o])
    }
    average = summation / halfLength
    if (average < smallest) {
      smallest = average
      smallestOffset = o
    }
  }
  return smallestOffset
}

and I use it this way

analyser.getFloatTimeDomainData(data)
var rms = rootMeanSquare(data)
var offset, frequency
if (rms > RMS_MIN) {
  offset = autocorrelation(data)
  frequency = SAMPLE_RATE / offset
}

to find the frequency of the signal input to the analyser.

Signal input is the output from an oscillator. The oscillator's frequency varies from C0 to B8 and I can't always detect the correct frequency. Can you tell me why, please?

Please, find below two images showing oscillator's frequencies and related detected frequencies


texts:
I am trying to calculate the disparity between stereo image pairs.  I'm using what appears to be the standard approach of correlating between a window of pixels from one image and a sliding window from the other.  The horizontal shift that gives the best correlation is the disparity.

However, the images contain large almost featureless areas.  In those areas, the calculated disparity is frequently wrong.  I would like to introduce a correlation confidence measure, so that the results in these areas can be discarded.

Is there a common measure of confidence that is suitable for this application?  At the moment I am struggling to distinguish between truly featureless areas, and those with low contrast that still have recognisable features.


texts: Inverse DFT to a real signal when only odd harmonics are present

texts:
There is an old paper by L.R. Rabiner, "On the Use of Symmetry in FFT Computation" which describes (among other things) an optimized method to calculate the DFT of a real signal $x_n$, $n=0,\dots, N-1$ with the property that $x_{N/2+n} = -x_{n}, \ n=0,\dots, N/2-1$. The resulting transform $X=\mathrm{FFT}[x]$ only contains odd harmonics, that is $X_k=0$ when $k \,\mathrm{mod}\,2=0$, and $X_k=X_{N-k}^*$. The method requires an $N/4$ complex-valued FFT (or, equivalently, a $N/2$ real-to-complex FFT) with some pre- and post-processing.

What I wonder is if the corresponding inverse transform is described somewhere, that is obtaining the first half of $x_n$ given the first half of nonzero $X_k$. Unfortunately, Rabiner only provides an algorithm for the forward transform, and I cannot figure it out myself.


texts: Extracting DCT coefficients from H.264/AVC bitstream

texts:
Is it possible to extract DCT coefficients from H.264/AVC bitstream without doing a full-decoding of the video?

There are a lot of papers on compressed domain video processing which are based on the assumption that DCT coefficients can be extracted through partial decoding and thus a lower computational complexity and faster than real time decoding can be achieved by using the DCT coefficients for various computer vision tasks (e.g. tracking, action recognition). However, nobody really describes the exact process of such partial decoding, and I seriously doubt it can be achieved with the recent video codecs such as H.264/AVC or H.265/HEVC. Does anybody have an insight on this one?


texts: Cross correlation, when two signals are "uncorrelated"?

texts:
Definition of cross correlation is

$$
\int_{\mathbb{R}}s_1^*(\tau)s_2(t+\tau)d\tau
$$

I wonder using such definition, when two signals are not correlated? My guess is the following...
defining
$$
s_{2,\tau}(t) = s_2(t+\tau) = \left(T_{-\tau}s_2\right)(t)
$$

We have

$$
\langle s_1,T_{-\tau}s_2 \rangle = 0
$$

for all $\tau$, namely $s_1$ is orthogonal to all the signals $s_{2,\tau}$. Is this guess correct?

This definition is taken from Wikipedia.

As assumption you can assume $s_1,s_2 \in \mathcal{L}^2(\mathbb{R})$, the definition should be then well posed by the Cauchy-Schwarz inequality.


texts: Operaion on Simple Discrete Time Signal , Very Simple Question

texts: I got this simple Discrete time signal question on which i have to perform shifting and multiplication.But I have some Doubt regarding the answer this book shows. Please see the uploaded image.


texts: Unstable frequency/phase when using external reference for Ettus B200

texts:
I am attempting to do a simple record of a CW, 250MHz signal at the Rx port of an Ettus B200 using an Anritsu MG369 signal generator. I am using the 10 MHz ref signal provided by the SG (output @ ~9dBm). The frequency/phase of the signal seems to be too unstable from what I should expect. Is this common for the B200? I am expecting a B210 soon and am just trying to get ahead of the game while awaiting the new hardware, but if this is user error I'd like to figure it out in advance if possible as I eventually will need to consider phase closely when test is in its final form. I've seen in Ettus literature that a square wave is best for reference, could a sine reference be the cause of this?
Could it be the PLL misbehaving or an amp somewhere in ref circuitry? RF front end is confirmed to be working okay and can see a clean, stable signal when running CW from Tx through cable to Rx port.
Including flow chart as well as two pics of spectrum to try to illustrate instability.
EDIT: Including better FFT sink snapshots


texts: What is the Uncertainty or error due to sampling frequency?

texts:
If I want to detect the distance between two peaks in a signal sampled at 100 Hz. Then is it right to say that the first and second peaks occurred within 0.01 seconds of uncertainty? Therefore, the distance between peaks is 0.02 seconds uncertainty?
Then, based on that, how does the uncertainty propagates if I have a group of peaks and I want to find say the uncertainty in the mean and standard deviation of distance?
Does anyone have any idea what this uncertainty is called?


texts:
I have some MP3s that are encoded at 44.1kHz with a bitrate of 160kbps. I hook these up to my car using an FM transmitter and the sound quality isn't particularly great. Low and high notes sound distorted and crackly.

I suspect that I'll need to reduce the sampling frequency, but I am not sure. Reading up on FM broadcast radio, it seems that the FM radio channels have a bandwidth of 75kHz, so I do not understand why my audio sounds crackly.

How do I get my MP3s to play without crackling over FM radio?


texts: What is the story behind the story about SIFT descriptor?

texts:
The following is from Lowe 2004 paper ( http://www.cs.ubc.ca/~lowe/papers/ijcv04.pdf ).

One obvious approach would be to sample the local image intensities around the keypoint at the appropriate scale, and to match these using a normalized correlation measure.
However, simple correlation of image patches is highly sensitive to changes that cause misregistration of samples, such as afﬁne or 3D viewpoint change or non-rigid deformations. A
better approach has been demonstrated by Edelman, Intrator, and Poggio (1997). Their proposed representation was based upon a model of biological vision, in particular of complex
neurons in primary visual cortex. These complex neurons respond to a gradient at a particular
orientation and spatial frequency, but the location of the gradient on the retina is allowed to
shift over a small receptive ﬁeld rather than being precisely localized. Edelman et al. hypothesized that the function of these complex neurons was to allow for matching and recognition
of 3D objects from a range of viewpoints.

I am trying to understand SIFT descriptor. I understand the previous stage (keypoint detector).

I don't know why it is implemented that way. I want to know the story behind the story.


texts:
For all the practicing engineers out there:

Where have you encountered a negative SNR?
How negative, in dB, was it or estimated to be?
Where would you expect to encounter a negative SNR?

Note: I am also counting interference signals as noise, so SNR can also include SIR.

In my own experience, I have seen negative SNRs in car communications. There is road noise, as well as multi-talker and music interference. I have also seen it in the output from cellular phones. Wind noise can sometimes pose a significant problem there, as well as the myriad of interferences in speakerphone mode.


texts:
Find the Discrete-time Fourier transform of $\frac{\cos(\frac{n\pi} 6)}{(n+3)\pi}$

I thought of making it to be a sinc, but at the bottom there is $n+3$ and if I replace $n+3$ then I don’t know how to get rid of $-\pi/2$ in the new $\cos((\pi/6)m-0.5\pi)$

Could someone through me a hint?


texts: Removing Gaussian Noise from a Signal to Get Minimum Value

texts:
I have a signal that has a minimum value that I'm trying to read.
The issue I'm having is that the signal is spread out by gaussian noise.
I have the signal at a lot of timesteps (and expect the function to be roughly exponentially distributed and being truncated at the minimum value), but can't work out how to remove that gaussian noise.
Any help would be appreciated!
(Also this may need transplanting to another stackexchange, but I feel like this was something which should have been solved multiple times previously by this community)


texts: What is the physical significance of negative frequencies?

texts:
This has been one of the holes in my cheddar cheese block of understanding DSP, so what is the physical interpretation of having a negative frequency?

If you have a physical tone at some frequency and it is DFT'd, you get a result in both the positive and negative frequencies - why and how does this occur? What does it mean?

Edit: Oct 18th 2011. I have provided my own answer, but expanded the question to include the roots of why negative frequencies MUST exist.