texts: How do you relate imaginary numbers with phase shift? How to imagine this?

texts:
So I found this answer on one of the questions. I wanted to ask how the complex part can be related with the phase shift. I wanted to ask this on the same question but it didn't allow me. Could anyone please help me understand this concept. Even if I imagine this as a spiral with the value of the imaginary part changing, the starting time of the wave remains the same doesn't it? So how is it related to phase shift?

"Negative frequency doesn't make much sense for sinusoids, but the Fourier transform doesn't break up a signal into sinusoids, it breaks it up into complex exponentials:

$F(\omega)=\int_{-\infty}^{\infty} f(t)e^{−jωt}dt$

These are actually spirals, spinning around in the complex plane:

complex exponential showing time and real and imaginary axes

Spirals can be either left-handed or right-handed (rotating clockwise or counterclockwise), which is where the concept of negative frequency comes from. You can also think of it as the phase angle going forward or backward in time.

In the case of real signals, there are always two equal-amplitude complex exponentials, rotating in opposite directions, so that their real parts combine and imaginary parts cancel out, leaving only a real sinusoid as the result. This is why the spectrum of a sine wave always has 2 spikes, one positive frequency and one negative. Depending on the phase of the two spirals, they could cancel out leaving a purely real sine wave or a real cosine wave or a purely imaginary sine wave, etc."


texts: Why does the amplitude of a discrete convolution depend on the time step?

texts:
I've just finished covering convolutions in my signals class, and I've been playing around with the conv function in MATLAB, but there's something I don't quite understand. Say I have two discrete signals, $a$ and $b$ sampled at $dt$. As $dt \rightarrow 0$, the amplitude of the result increases. Since the convolution integral is just
$$
y(t)=\int_{-\infty}^\infty f(\tau)h(t-\tau)d\tau,
$$

why does the resulting convolution seem to depend on what my value is for $dt$? By decreasing the sampling rate, shouldn't I just have a better approximation?


texts: Estimating the complexity by the calculation of the number of real multiplications in a general polynomial function

texts:
For the following memory polynomial equation,

$y(n)=\displaystyle\sum_{m=0}^{M-1}\displaystyle\sum_{p =1\\p\,\textrm{odd}}^{P}a_{m_p} \, x(n-m) \, |x(n-m)|^{(p-1)}$

The total number of coefficients is $ M\frac{(P+1)}{2}$

I need to calculate:

1- the total number of complex multiplications

2- the total number of real multiplications


texts: Hilbert transform too large to store (out of core processing)

texts: I have a signal (saved on disk) that I would like to take the Hilbert transform of, but it's too large to fit in memory (all at once). I would like to cut it into blocks and take the transform of each block. I'm not super familiar with the Hilbert transform and I was wondering if there was some sort of padding or windowing that needed to be done / take overlapping chunks.


texts: Plotting the magnitude response of a biquad filter

texts:
I've put together a multi-band audio EQ using biquad filters.  I'm getting the coefficients using the methods from the RBJ cookbook.

Now I want to plot the curve showing the magnitude response.  I'm using an equation from this source

Here is my function to get the coefficients and get the magnitude response at points of interest.

void GetCoefficients (double samplerate = 44100.0) {

    //from the rbj biquad coefficient cookbook by Robert Bristow-Johnson
    long double SR = (long double)samplerate;
    long double A = powl(10.0L, dBGain/40.0L);
    long double W0 = 2.0L * PI * Center / SR;
    long double alpha = sinl(W0)*sinhl( LN2/2.0L * WidthInOctaves * W0/sinl(W0));

    if (Type == "peaking") {
        b0 = 1.0L + alpha * A;
        b1 = -2.0L * cosl(W0);
        b2 = 1.0L - alpha * A;
        a0 = 1.0L + alpha / A;
        a1 = -2.0L * cosl(W0);
        a2 = 1.0L - alpha / A;
    }

    long double w;
    long double numerator;
    long double denominator;
    long double magnitude;

    for (int i = 0; i < 59; ++ i) {
        w = 2.0L*PI*FreqPoints[i] / SR;
        numerator = b0*b0 + b1*b1 + b2*b2 + 2.0L*(b0*b1 + b1*b2)*cosl(w) + 2.0L*b0*b2*cosl(2.0L*w);
        denominator = 1.0L + a1*a1 + a2*a2 + 2.0L*(a1 + a1*a2)*cosl(w) + 2.0L*a2*cosl(2.0L*w);
        magnitude = sqrtl(numerator / denominator);
        FrequencyResponse[i] = magnitude;
    }
}

My filters sound correct, but my plot seams way wrong.  For example, when I have calculated the coefficients for a peaking filter with a width of $2$ octaves, centered at $4398\textrm{ Hz}$, with $3\textrm{ dB}$ gain; my magnitude response using those coefficients at $349\textrm{ Hz}$ is about $12$.

I must be doing something wrong, but I can't quite figure it out.


texts: MSK signal recoverd though FM Discriminator?

texts:
I am attempting to write a FFSK (differentially encoded MSK) modulator.  I have found and implemented a demodulator that works with sample data taken from a radio of a FFSK signal.  The demodulator uses a FM Discriminator to transform the IQ data to a FFSK signal that can be decoded.  I am using the method described in the article "Minimum Shift Keying: A Spectrally Efficient Modulation" by Subbarayan Pasupathy to modulate a FFSK signal.  When a FM Discriminator is applied to the output of the modulator a square wave alternating between +/- 4.5 deg is produced.

Below is a snippet of my matlab code used for modulation:

% differentially encode to produce a 1-to-1 mapping between input bits and output frequency for FFSK
diffBits = [bits(1) zeros(1, length(bits) - 1)];
for i=2:length(diffBits)
    diffBits(i) = xor(diffBits(i - 1), bits(i));
end
iBits = diffBits(1:2:end);
qBits = diffBits(2:2:end);

% rectangular pulses of duration 2*T w/ Q delayed from I by T
iPulses = [kron(iBits * 2 - 1, ones(1, 2 * SYMBOL_SAMPLES)) zeros(1, SYMBOL_SAMPLES)];
qPulses = [zeros(1, SYMBOL_SAMPLES) kron(qBits * 2 - 1, ones(1,2 * SYMBOL_SAMPLES))];
t = -T:SAMPLE_PERIOD:(MESSAGE_DURATION - SAMPLE_PERIOD);
plotTime = t/T;

% baseband symbols (Parallel generation of Type I MSK, see Couch Figure 5-36)
iSymbols = iPulses .* cos(pi * t / (2 * T));
qSymbols = qPulses .* sin(pi * t / (2 * T));

Here is a graph of the output of the FM discriminator from the sample data:

Here is a graph of the output of the FM discriminator from the modulator data:

My question is what is different between the real data and my modulator that could produce this different output?  I am looking for a way to make my modulator produce data similar to the sample data.

If this helps, here is the FFT of the baseband of the sample data (derotated and resampled down):

% samples are complex int16 values read in from a file
num_samples_fft = 4096*2;
Fs = 781250;
freqOffset = -25200
shifted_samples = samples .* exp(2*j*pi*freqOffset/Fs*(0:length(samples)-1));
resampled_samples = resample(shifted_samples, 96, 3125);
resampled_samples_fft = fft(resampled_samples,num_samples_fft);
resampled_samples_fft = resampled_samples_fft([num_samples_fft/2+1:end 1:num_samples_fft/2]);
figure;
plot(f,2*abs(resampled_samples_fft(1:num_samples_fft)));
title('Sample Data FFT');

Whereas if I do the same process to data that I modulate this is the resulting FFT graph:


texts: Hilbert transform of low pass and high pass signal

texts: Why is the Hilbert transform of the product of a low pass signal and a high pass signal equal to the product of the low pass signal itself with the Hilbert of the high pass signal?


texts: How does both shifting and scaling a function affect the Fourier Transform?

texts:
I understand how shifting and scaling work separately, but I'm unsure how to put them together.

That is to say, I understand if $$x(t) = X(\omega)$$ $$x(at) = \frac{1}{|a|}X\left(\frac{\omega}{a}\right)$$ and $$x(t-t_0) = e^{-j\omega{t_0}}X(\omega)$$ But if $x(t)$ is both scaled and shifted, as in $x(at-t_0)$, how would the Fourier Transform be determined using properties of the Fourier Transform?

What I tried was along the lines of:
$$
x(at-t_0) = x\left(a\left(t-\frac{t_0}{a}\right)\right) \\
\text{let } v(at) = x\left(a\left(t-\frac{t_0}{a}\right)\right) \\
\text{and if } v(at) \leftrightarrow \frac{1}{|a|}V\left(\frac{\omega}{a}\right) \\
\text{then } x\left(a\left(t-\frac{t_0}{a}\right)\right) = \frac{1}{|a|}V(\omega)e^{-jw\frac{t_0}{a}} \\
\therefore x(at-t_0) = \frac{1}{|a|}X\left(\frac{\omega}{a}\right)e^{-jw\frac{t_0}{a}}
$$

But I feel as though my logic rewriting $x(t)$ in terms of $v(t)$ isn't quite right and would appreciate if someone could either validate my logic or explain where my mistake is.


texts: Downsampling a PSD that was generated by zero-padding - worth it?

texts:
Let us say we have a signal $y(k)$ that is of length $K$. I can compute its PSD, also of length $K$. Let us say that this length was not good for finding peaks, so I computed a PSD that was of length $10 \ K$ instead, by doing a zero-padding in the time-domain. I understand that this is equivalent to interpolating the frequency domain result.

So my question is, at this point, if I resample the actual $10 \ K$ length PSD back to be $K$ samples long, would it give me the same result as if I took a $K$ length PSD to begin with? If not, is there any advantage to doing it this way, or would I just be better off sticking to taking a length $K$ PSD to begin with?


texts: How to filter OFDM Signal with an analog filter

texts:
I am using OFDM system in Matlab, I want to use an analog filter after the DAC. Because we don't a simulation for the DAC, the generated OFDM analog signal does not have a specific frequency (they only have normalized frequency). When I design the analog filter, I have to specify the frequency (not normalized frequency as in digital filters). So I am not able to filter my OFDM signal with the analog filter. Any ideas on how to do that?
I have been trying to use slim Matlab command to do that, I managed to apply an analog filter on sinusoidal signals as follows:
clc
clear all
close all
f1 = 1000;                  % signal frequency
f2 = 2000;                  % signal frequency
f3 = 3000;                  % signal frequency
fs= 10000;                  % DAC sampling Rate
Ts= 1/fs;                   % DAC sampling time
N= 4000;                    % Number of points
n= 0:N-1;                   % sampling index
x= cos(2*pi*f1*n*Ts)+ cos(2*pi*f2*n*Ts)+cos(2*pi*f3*n*Ts);
df=-0.5:1/N:0.5-(1/N);      %frequency bins
X=fftshift(fft(x,N));
figure;plot(fs*df,abs(X)/N);    %original signal

%%
%filter design
order=14    % Filter order
Rs=30   %stopband attenuation
fc=1500; % filter cutoff frequency
[b,a] = cheby2(order,Rs,[2*pi*fc],'low','s');
figure;freqs(b,a);
% [z2,p2,k2] = cheby2(order,Rs,2*pi*fc,'low','s');
% [b2,a2] = zp2tf(z2,p2,k2);
% figure;freqs(b2,a2);
% [zeros, poles, gain] = butter(order,[2*pi*fc],'low','s'); %generate LPF zeros, poles, and filter gain.
% [b2,a2] = zp2tf(zeros, poles, gain); %convert to transfer function form of b, a coefficients
% figure;freqs(b2,a2);

%%
%apply the filter
% create system
myFilter = tf(b,a);
% apply filter to time domain signal
[y, time] = lsim(myFilter,x,n*Ts);
Y=fftshift(fft(y));
figure;plot(fs*df,abs(Y)/N);


texts: Is the Canny algorithm enough for creating a feature descriptor image for input to an SVM?

texts:
I retrieve contours from images by using the Canny algorithm.

Is this enough preprocessing to have a descriptor image for input into an SVM to find similarities?

Do I need other features like elongation, perimeter, area?

I am asking about this because I was inspired by this example. I have given my image in greyscale first, in the Canny algorithm style second, and in both cases my confusion matrix had plenty of 0s like precision, recall, f1-score, support measure, etc.


texts: Radon Transform Implementation In Matlab

texts:
I know MATLAB has a built in Radon function, but I am working on implementing the radon transform in order to perform filtered back projection.  As I started, my idea was multiple nested for loops for the summations at different theta values, this became pretty complex.  I am not looking for source code, just suggestions on an approach.  Any ideas are welcome.

Edit:
Here is what I have come up with so far, it works fairly well to perform the radon transform and create a sinogram

%%%This function takes an image, theta max and theta step  %%%
%%%and returns a 2D matrix where each row is the projection%%%
%%%of the original image at different angles               %%%
%%%by rotating the image and summing the pixels            %%%
function [R] = RadonTransform(img, theta, thetaStep)

    %Obtain the image size in the x-direction
    [x,y] = size(img);
    %Set a matrix R to hold the projection data
    R = zeros((theta/thetaStep)+1,x);
    %Set vector for the angles to take projections at
    angles = 0:thetaStep:theta;
    %Matrix to hold all the rotated images separately to prevent blurring
    rotatedImage = zeros(x,y,length(angles));

    %Loop to rotate image and add up values for the projections
    for i = 1:(length(angles))
        %rotate the image starting with theta = 0 degrees
        rotatedImage(:,:,i) = imrotate(img,angles(i),'nearest', 'crop');
        %Sum the columns of img to get projection data
        %Each row of R contains a projection at a certain theta
        R(i,:) = sum(rotatedImage(:,:,i),1);
    end

    %Convert the matrix to a gray scale image in the range 0 to 255
    R = mat2gray(R);

    figure
    imshow(R)
    title('My Sinogram')

end


texts: Why does sampling frequency affect the filter results?

texts:
I have a big issue,  basically my goal is to create a low-pass butterworth filter  around 0-35Hz  with a sampling frequency of 5000Hz.
My Matlab code is

 Fs=5000;
Wp=30/(Fs/2);
Ws=45/(Fs/2);
Rp_db=-20*log10(.95);
Rs_db=-20*log10(.05);
[order,wn] = buttord(Wp,Ws,Rp_db,Rs_db);

But it doesn't work, becouse the filter explodes

As you can see the filter is unstable.But if i change the sampling frequency from 5000Hz to 500Hz things change

with the cutt-off frequency 0.135 (33,75 Hz).

Why does the sampling frequency affect so much the filter result?
Thanks in advance


texts:
Consider the 2D signal below

I would like to find the changepoints in the signal (using a hierarchical approach). Based on our visual observation, we can see there are 2 main changepoints where the signal 'starts' and 'stops' and we could argue there is potentially another one where the red starts to come in. We could continue to look in more and more granularity if we so wished.

My question is, how could we get a computer to detect these automatically. My intuition from the way I did it was to do as follows:

Select the first point as our starting point.
Move along the time axis with another point, finding the Fourier transform of the data between the first point and this point.
As long as the transformed signal is not become too much more complex (in the information sense), we know that we have not hit any big change.
Once the signal starts to become more complex (above some threshold level), we select this as our new starting point and repeat.

After this process is finished we now have selected an array of points where our signal changes drastically w.r.t. its spectral make up.

My question then is:

Does this make sense?
What metric should I use for the complexity of the Fourier transform?
Has this already been tackled successfully and if so any references?


texts: How to solve a two variable equation of images?

texts:
I have two equations of images

$$g_1=f_1+h_2*f_2$$

and

$$g_2=f_2+h_1*f_1$$

where $*$ is convolution and $g_1,g_2,h_1,h_2$ are known.

How do I find $f_1$ and $f_2$?


texts: In finding the envelope of the I/Q data set (which is a complex data set, Inphase /Quadrature data) I cannot use envelop(x) in MATLAB, as it requires the real-valued "X" in MATLAB, so got an error. Does anyone have a suggestion for solving this, finding envelope from I/Q data? Thanks,


texts: how to detect the center frequency of a QRS complex in an ECG signal?

texts: i want to design a filter that can effectively detect the QRS complex in ECG signal(whose Fs=360Hz) and reduce high frequency noise components. i want to know as to how the center frequency is detected so as to design a digital lowpass differentiator filter with bandwidth equal to the center frequency of the QRS complex.


texts:
Follow up to the question here

This is a screen shot of an intermediate step in the middle of my calculation

The dotted line called MY is supposed to be a smoothed version of db pow y
db pow y is the magnitude squared represented in base 2 log scale, of the first half of a 128 point FFT
In the every next iteration, I can see that db pow y changes drastically (it is the sound input data, so it may be anything at every step) while the graph for MY changes very very slightly

my question is , since MY is a smoothed version of db pow y, shouldn't it be running close to the graph of db pow y? I know that it will definitely not be closer to db pow y as it changes drastically at each iteration and MY changes very slightly, but I still do not understand exactly how this is supposed to work

Also, at points such as A in the graph above, the dotted line seems to "ignore" sharp variations in db pow y (as I would expect, since MY is smoothed version of db pow y), but then again, at positions such as B, the dotted line is the one changing drastically

Then, could you please explain to me how this is supposed to work?

This is the smoothing equation used:

    pDashS(i) = 0.2 * pDashS(i) + 0.8 * ((db_pow_y(i)-pres_minima(i)) > diff_between_db_pow_y_and_pres_min);
    alphaDTildS(i) = 0.95 + 0.05 * pDashS(i);
    MY(i) = alphaDTildS(i) * pastMY(i) + (1- alphaDTildS(i)) * db_pow_y(i);
    pastMY(i) = MY(i);

where i ranges from 1 to 64, half of a 128 point FFT

the actual line performing the smoothing is

  MY(i) = alphaDTildS(i) * pastMY(i) + (1- alphaDTildS(i)) *
  db_pow_y(i);

which, from what I understand from answers to my previous questions, this is an example of a low pass IIR filter which performs smoothing on db_pow_y and alphaDTildS is the smoothing parameter

Please help

Thank you

(PS: code is in Matlab)


texts: How to extract unknown packet from collision between said packet and another, known packet?

texts:
I need to apply successive interference cancellation (SIC) to an RF signal which is the result of collisions between 2 or more unsynchronised packets. For this question let's just assume that the number of packets is 2.

In SIC, you store the collided packets until one of the packets are repeated and use the 'clean' packet to extract the other packet from the collided data.

My question is, what techniques can be used to extract an unknown packet from a collision between that packet and a known packet?

How do you deal with the packet sources not being synchronised?

Going through the possible tags for this question, it seems that 'deconvolution' is relevant.

In case it is relevant, the context is RFID tag inventory, the channel access mechanism is framed slotted ALOHA (FSA) random access, the carrier is 868 MHz (EU) and subcarrier is 256 kHz.

Thank you.


texts: How to estimate an auto-regressive model?

texts: Given a periodic impulse train and it's impulse response, how is an auto-regressive model of this system computed or estimated?


texts: How do I set window length and shift length for computing STFT on Scipy?

texts:
Does nperseg=32, noverlap=16 mean the window length is 32mS with a shift of 16mS?
Refer here for more details


texts: I'm starting to learn about automatic process control, and there are types of signals transmitted in a control system. Among that is pneumatic signal that is a pressure signal. But I still don't know what a pressure signal means? How does it work? If you could give me a simple reference to learn more about signals(not a book to read, I'm already reading a book about control..)


texts: how can i call the input data in wavelet transform and generate code for gabor wavelet manually?

texts:
I am an ECE student, and i am doing my project

I want to generate a code for gabor  wavelet transform. I have no idea  could you help me with a sample program

I have DNA as input sequences and how can use it as input data

"sample sequence  s={ACGTACGTACCCCAGGGATTT} "

thanks and regards!


texts: What factors affect the propagation delay at wireless communication?

texts:
Generally, the signal propagation delay is d/c.
d is a distance between a transmitting antenna and a receiving antenna.
c is light speed.

However in NS-3, there is Random Propagation Delay Model

Random Propagation Delay Model: The propagation delay is completely random, and changes every time the model is called. All packages, even those that are sent between two fixed nodes, experience a random delay. As a consequence, the order of the transmitted packets is not maintained.

What kind of communication environment does this model take into account?

I think the obstacle, etc is considered. But because I can't find any official document or paper, I'm not sure about this.


texts: Calculating values of frequency bins in Python

texts:
I have to use FFT to determine the period of waves inside a signal. After applying FFT on a window of 10000 point from a signal, I get something like this:

What I don't understand is that FFT is supposed to return frequencies, but if the input is a longer signal with the same frequencies, the values of frequencies returned by FFT will change.

So for an array of N length, the result of the FFT will always be N/2 (after removing the symmetric part), how do I interpret these return values to get the period of the major frequency?

I use the fft function provided by scipy in python.

Edit:

Some answers pointed out the sampling frequency. I don't understand what the number of samples per second has to do with the size of the periodic pattern, the FFT returns frequencies right? And then for a specified frequency f, I can do t=1/f and then t will be something like 300 points for example. That means we have a repeating pattern every 300 point, I'm not sure about this. To summaries I have a periodic signal and I need to identify the period T0


texts: I was searching for a tutorial on how to implement a stereo Phaser in C++. All i´ve found was sourcecode with little or no explanations which did´nt help me much. Does anyone know a Tutorial with which i can learn and understand how to implement a stereo Phaser in C++? By the way im using the Juce Plugin.


texts:
Noise can be assessed in uniform regions of an image, by subtracting a lowpass-filtered version of it. Then from the histogram of intensities, a global measure can be obtained (such as the average absolute deviation).

But do we have good means to determine noise intensity locally, on every pixel of an image, where the noise distribution varies per regions ?

(Note: we consider that random texturing of the surfaces as a noise.)

The noise we target is more of the Gaussian type.


texts: Frequency shifting of a quadrature mixed signal

texts: I've a quadrature mixed signal with 10 MHz as highest frequency available. I want to shift it to any frequency lesser than 10 MHz. I should get it by multiplying this signal by cosine of the required frequency. Right?


texts:
Wondering if someone could offer me any advice or help. Sorry if this question is too broad or anything.

I'm wanting to complete an algorithm in basic Speech analysis. The algorithm will detect whether an inputted sample is either saying yes, or, saying no.

I know that this has already been done, and I got my inspiration for this project from someone who has completed it using Zero-Crossing and in MatLab. His algorithm was as follows:

Divide the sound wave into evenly spaced blocks
Process each block for important characteristics, such as strength across various frequency ranges, number of zero crossings, and total energy.
Using this charateristic vector, attempt to associate each block with a phone, which is the most basic unit of speech, producing a string of phones.
Find the word whose model is the most likely match to the string of phones which was produced.

Now this algorithm / approach seems idealistic. But, the first point kind of confuses me. Ok, if my data sample is 4410 then how could I possibly split that into equal size blocks? For example, if the data size was 262144 then I know that multiples of 2 goes into it.

The second question is I want to use a FFT/linear predictive coding over zero-crossing but the FFT algorithm is really complicated to implement, so, would it be better to use a already built library?

My last question is this:

Do you think this project is possible, and, in under a year? I'm not completing it in MatLab, but, in C++. Also, will the above algorithm produce the results that I need? Any help would be really appreciated.


texts: Laplace transform of a finite duration signal

texts:
Consider the following signal:
$$ x(t) = e^{-2t}[u(t) - u(t-5)] $$

This signal exists only from 0 to 5 time units. Elsewhere, it is zero.

Now, let's find the laplace transform of this signal using Linearity and Time shift properties.

$$ e^{-2t}u(t) \leftrightarrow \frac{1}{s+2} \ , \ \ Re \{s \} > -2 $$
Also,
$$ e^{-2(t-5)}u(t-5) \leftrightarrow \frac{e^{-5s}}{s+2} \ , \ \ Re \{s \} > -2 $$
$$ \Rightarrow e^{-2t}u(t-5) \leftrightarrow \frac{e^{-5s}e^{-10}}{s+2} \ , \ \ Re \{s \} > -2 $$

Thus, by linearity property,
$$ e^{-2t}[u(t) - u(t-5)] = \frac{1 - e^{-5(s+2)}}{s+2} \ , \ \ Re \{s \} > -2$$

Note: The time shifting property doesn't alter the ROC;

However, the textbooks that i am refering (Oppenheim and Schaum series) both tell that the ROC of a finite duration signal is the entire S-plane, possibly zero and infinity (in some cases).

But the above signal being of finite-duration, possess ROC that is not the entire s-plane. Please help me figure this conceptual error.

Note: The above problem is from Schaum series. Here are the images of the textbook's section relevant to the above question.

Source of the Question and its solution:

Property of finite duration signals:

In Schaum's outline series:

In oppenheim:


texts: Is there any python code for applying a-law/mu-law on 3D numpy array?

texts:
I have 3D numpy array of probabilities between [0,1], I need to emphasize on some area with lower probabilities. I was suggested to apply a-law and mu-law.

I am wondering if there is python library/code that I can use for this purpose. I would really appreciate if you share some ideas here. Thanks


texts: Trade-off in sample-rate & FFT-size & Doppler

texts:
I've got a stream of digital IQ samples let's say at $F_s = 1 MSPS$ that consist of a narrowband signal, in awgn. Let's say the signal BW is ~ 100Hz. The narrowband signal's center (or base) frequency is variable in the range from -10 kHz to +10 kHz due to the doppler effect. For simplicity, it's fine to assume this is a simple linear sweep of the frequency offset.
I can imagine two simple ways of trying to visualize the frequency domain of the data. In method 1, I simply filter the data with a low-pass with cutoff of ~ 10 kHz and then perform an FFT and plot (or use welch/bartlett/etc). The FFT can be quite large (and give large processing gain) because I'm still operating at a high sample rate, and the latency of the computation won't be so bad).
In method 2, I could instead downsample (filter + decimate) to $F_s \sim 20 kSPS$. Again we perform an FFT and plot - however this time, because of the reduced sample rate we need to use a smaller sized FFT (mainly due to latency & not having enough samples available).
So my question is - does method 1 have any advantage here? Specifically - I'm interested in what would be most useful for resolving the narrowband signal when the SNR is poor & the frequency offset may be moving. In that case, it seems to me that there's a real problem with method #2 as the frequency may more easily sweep energy across multiple bins of the FFT. Taking that point further - would I be right in saying that the optimal option (ignoring computational complexity) would be to maximize the sample rate of the IQ stream, filter it to the BW I require, and perform large FFTs on that high sample rate without downsampling?


texts:
I want to downsample images to arbitrary sizes using supersampling to avoid aliasing effect.

The only two good explanations I found were on Wikipedia and everything2.com, but there are still gaps. For example:

The image should be upsampled before supersampling. But how much? Is there any special filter to be used for upsampling prior to supersampling? Is just taking interpolated color values on sub-pixel positions in source image sufficient?
What if I want to resize image to e.g. 80% of its size with supersampling? How much I have to upsample it and how to treat non-integral size ratio (e.g. downsampling from 379 pixels to 377 pixels)?
Are the multiple samples taken from the single pixel, multiple pixels or around sample point (both cases can occur)?

UPDATE:

I have tested the "Super Sampling" method in Paint.NET with test target on this page. Suprisingly, the result looked just like "Photoshop Bicubic" filter:

The only advantage can been achieved by pre-blurring input image and than using some conventional method.

I've implemented and tried ordinary "Box" and "Cubic" convolution filters with excellent results!

So now I don't see any benefit of using supersampling over the convolution-based filters. Or is there any?


texts:
Assume I have a signal that oscillates between 10KHz and 9Khz every 500msec (Change happens linearly, so at t=0, it is 10KHz and it goes to 9.5Kz at t=250msec and 9KHz at t=500msec and frequency start to increase and goes back to 10KHz at 1 sec and this goes on)

Assume I sample this signal at 50Khz and I do fft to find out what's the frequency. But due to sampling rate, I have to accumulate some samples where the interest frequency is slowly shifting.

If I were to sample at 500KHz or even 5MHz, can I get a better SNR? (The assumption here is that I can sample for a shorter duration -still several cycles of the target frequency in time domain- and this will provide a less spread signal in a given time and better fft snr. )

My gut tells me, this won't help but I like to ask the crowd.


texts: If I want to amplify a certain frequency in a digital signal, can I just take the FFT, increase the real part of the value for the frequency I want (leaving the imaginary part alone), and then take the inverse FFT?  I am wanting to do this to increase the frequency at which tones are detected, for a Morse code decoder.


texts:
We know that moments extract important features of a signal that has no redundancy. For example Zernike moment gives us rotation invariant data of a signal like image or Fourier gives us frequency of a signal to us.

But what is the theory behind it?
How a moment performs this?
How basis function of a moment is designed?

I think it has roots in many different math theory but I can't find out a good source to know.


texts:
I am new to DSP and leaning about amplitude modulation.

I am trying to demodulate a 5 Hz signal that is modulated by a 50 Hz carrier. I am trying to extract the carrier, not the the 5 Hz signal.

A simple band-pass filter at the desired frequency frequency did not work and I am not sure why. I understand that phase locked loops can also be used.

Are phase locked loops a better approach to extracting the carrier signal? What may be some other useful approaches? I am looking for an approach that makes no assumptions on the carrier and signal frequency.

Thanks

The image below depict the AM signal along with the failed attempt to extract the carrier signal. Below that is the frequency components of the signal (which indicated that the carrier is clearly not suppressed).


texts: How to compute the free distance in TCM (Trellis-Coded Modulation)?

texts:
I would like to be able to compute the so-called "free distance" for a TCM with a rate 2/3 convolutional code (two inputs, three outputs) inside that I plan to use for 8PSK. My previous assumption was that I could simply compute distance between the "null sequence" and the next closest sequence because the code is linear. But that does not seem to work because this computation gives me a squared free distance of supposedly 5.17157 for an 8-state code that actually performs worse in AWGN channel simulations than the 8-state recursive Ungerboeck code for which I compute the squared free distance to be 4.58579 (which is correct in this case).

Any pointers on how to compute the free distance for TCM would be greatly appreciated.

The TCM for which my free distance calculation seems to fail is this one:

in1 ----------*---------------*-- out2
              |               |
              |               V
in0 -*--------|--------*---->(+)- out1      (+) is a binary plus (xor)
     |        |        |
     V        V        V                    [D] is a delay element/flip-flop
    (+)->[D]-(+)->[D]-(+)->[D]-*- out0
     A                 A       |            V and A are supposed to be
     |                 |       |            arrow heads
     `-----------------*-------´

symbol mapping:
binary "out2 out1 out0" -> exp(2i*pi*out/8)
where out_k is the k-th bit of out counting from zero as the LSB


texts:
How can I generate non-stationary Gaussian noise (noise uncertainty) using Matlab? where the noise power fluctuate between $(1+p)^{-1}$ to $(1+p)$ where $p$ is the uncertainty factor in dB.

Best


texts: Calculating the numerical gradient of a volume in one direction at a time

texts:
I want to calculate the gradient of an image volume in one direction at a time.

Using the built-in function of Matlab gradient() I can get the ∂F/∂x for an F volume (the differences in the x direction) and I can get all the differences along all other directions let say (∂F/∂y and ∂F/∂z) for 3D volume.

FX = gradient(F)
[FX,FY] = gradient(F)
[FX,FY,FZ,...,FN] = gradient(F)

The point is that I need the gradient in just one direction lets say (along the z direction) and I can't do that using this function (to my knowledge and according to the documentation) plus calculating the gradient in all direction is CPU and memory intensive for large volumes (like my case).

I come across the snippet of code  below that calculate the gradient along one direction at a time, but when I compared the results of this with the built-in function of Matlab I didn't get the same results!

function D = gradient3(F,option)
% Example:
% Fx = gradient3(F,'x');

[k,l,m] = size(F);
D  = zeros(size(F),class(F));

switch lower(option)
case 'x'
    % Take forward differences on left and right edges
    D(1,:,:) = (F(2,:,:) - F(1,:,:));
    D(k,:,:) = (F(k,:,:) - F(k-1,:,:));
    % Take centered differences on interior points
    D(2:k-1,:,:) = (F(3:k,:,:)-F(1:k-2,:,:))/2;
case 'y'
    D(:,1,:) = (F(:,2,:) - F(:,1,:));
    D(:,l,:) = (F(:,l,:) - F(:,l-1,:));
    D(:,2:l-1,:) = (F(:,3:l,:)-F(:,1:l-2,:))/2;
case 'z'
    D(:,:,1) = (F(:,:,2) - F(:,:,1));
    D(:,:,m) = (F(:,:,m) - F(:,:,m-1));
    D(:,:,2:m-1) = (F(:,:,3:m)-F(:,:,1:m-2))/2;
otherwise
    disp('Unknown option')
end

Does this code calculate the gradient properly and the one that comes with Matlab calculate it differently? or is there is a better way to do it?

Illustrations of both methods results on the x direction on a volume and displaying a slice from that volume and inspecting some of the same pixels from both images, they both obviously calculate the gradient but the central values aren't the same!

Using Matlab's gradient function gradient():

Using the above code:


texts: How to sketch output PDF given the transformation?

texts:
Question:
Let Random variable $X$ with $PDF$ = $f_{X}(x)$ be the input to device with input output characteristics as shown below then sketch the $PDF$ of $Y$ i.e, $f_{Y}(y)$

My attempt:

for  X>0

,$Y=X+1\implies  f_{Y}(y)=f_{X}(y-1)$

for X<0

,$Y=X-1\implies  f_{Y}(y)=f_{X}(y+1)$

but at

X=0 there is $2$ units jump from $-1$ to $1$ and derivative of jump discontinuity is impulse so i thought there should be presence of impulse in PDF of Y but i'm not sure about it .

any help in sketching O/P PDF Y  will be greatly appreciated, and it is not a homework problem but from local author textbook


texts:
I have started learning about signals and I am interested in sound signals.

There are some questions that I need to resolve. For example in music, difference of notes like 'sol' and 'la' are about difference in frequency. But which features of signals reveal differences between piano and guitar. What sound features distinguish between two different syllables?

Can you give me a good learning source about audio processing?


texts: Projecting a 3D point into new camera coordinates

texts:
Given I have:

a camera with estimated rigid motion 3x4 matrix $P = [R|t]$ that starts from the origin of the reference coordinate system
an intrinsics 3x4 projection matrix $K$
a 3D point $X$

How would I find its projection in the second camera/image? Is the following correct?

$x = K*[R|t]*X$


texts: Bandwidth of the Derivative of a Message

texts:
If I have a message signal $m(t)$ and it has a bandwidth $B$. I know that the bandwidth of $m^N(t)$ is $NB$. But what is the bandwidth of $\frac{d m(t)}{dt}$?
Thanks!


texts:
Can somebody please provide an intuitive answer or reference for the following questions?

Q1: Dependence of estimation performance on number of data points -- I could not find any information whether the estimation performance of Adaptive filters such as Least Mean Square (LMS), Constant Modulus Algorithm (CMA) and Kalman Filters depend on the number of data points or not. Is there any information whether the mean square error between the actual and estimated parameters reduces with the increase in the number of data points or not?

Q2: Dependence of convergence on number of data points -- For instance, information such as if convergence of these adaptive filters (or in general) depends on the number of data points i.e., if these require a large number of data points to have good estimation performance.


texts: Why the calculated value of power is not match?

texts:
I am trying to calculate the power of a signal by using following two methods one is a power of a signal and another one is using the periodogram in Matlab as shown in the code.But why I am getting a different answer for the power?

x=[1 2 3 4 ];

s=0;

for i=1:length(x)
    s=s+x(i).^2;
end

p=s/length(x);

D=fft(x);

P= sum((abs(D).^2)/length(x));

p=7.5,
P=30

These are the formulas for both methods.


texts: Mathematically expressing FFT and STFT on a matrix

texts:
I have a matrix $q(m,n)$, where $m$ represents the vertical direction and $n$ is the horizontal direction. I need to perform the following three operations:

take FFT of matrix $q$ in the vertical direction,
take STFT of the output of the FFT performed in step 1 in the horizontal direction,
For each STFT output, sum the output of STFT in the vertical direction.

I have implemented the above three steps in Matlab. I am trying to mathematically express these steps. Kindly check if I am mathematically presenting it in the correct way. Kindly suggest if the expressions really explain the aforementioned operation.
Approach 1

$Q_n(k) = \sum_{m=0}^{M-1} q_n(m)e^{-j2\pi \frac{k}{M}m}$ for $0\le n \le N-1$, where n is the columns of matrix $q$. The output of this FFT operation is arranged as $Q(k, n)$, where $k$ stands for the NFFT bins.

$P_{k}(z,l)    = \sum_{n=0}^{N-1} w(n)Q_k(n+lH)e^{-j2\pi\frac{z}{N}n}$       for $0\le k \le K-1$. I take STFT on each row of $Q(k, n)$. The output is arranged as 3-dimensional, such as $P(k,z,l)$.

$P(l,z) = \sum_{k=0}^{K-1} P_k(z,l) $

Approach 2

$Q(k,n) = \sum_{m=0}^{M-1} q_n(m, n)e^{-j2\pi \frac{k}{M}m}$ for $0\le n \le N-1$, where n is the columns of matrix $q$.

$P(k,z,l)    = \sum_{n=0}^{N-1} w(n)Q_k(n+lH)e^{-j2\pi\frac{z}{N}n}$       for $0\le k \le K-1$. I take STFT on each row of $Q(k, n)$.

$P(l,z) = \sum_{k=0}^{K-1} P_k(z,l) $


texts:
Harris and Stephens writes about the interest window of Moravec:
"The response is noisy because the window is binary and rectangular", and suggests applying a Gaussian window.
My Question: Why is the response not noisy after applying a Gaussian window? Is it because a Gaussian filter removes noise from a picture, or because a circular window is better for sampling somehow?
Thank you.


texts:
I'm surveying for feasibility techniques for a potential future project that's rather out of my past areas of expertise, and I have a fairly basic question. Of course if it looks feasible I will have to learn a whole lot more on the topic.

What is the equation to compute the number of FFTs/IFFTs per sample required, given the number of samples in the FFT n, the number of samples in the FIR m, and the number of samples of audio data this is applied to at a time x?


texts: Basic PLL theory: voltage-controlled oscillator confusion

texts:
I am trying to write my first PLL in Python, and I've been making use of this excellent tutorial:

http://www.pythonpowerelectronics.com/contents/tutorials/tutorial1/pll_tutorial.pdf

Reading through the math on pages 7 and 8 (very minimal- it's just a few lines), I have one point of confusion:

Let's assume, like they do in the tutorial, that the reference (power grid) voltage signal to be tracked is $V_{r}\sin(\omega_{r}t)$ and that our VCO voltage can be expressed with the two components $\sin(\omega_{v}t)$ and $\cos(\omega_{v}t)$. We integrate the incoming grid voltage to get a cosine term of $V_{r}\cos(\omega_{r}t)$, and then combine our four sinusoidal terms together in a way that reduces to $V_{r}\sin(\omega_{r}t-\omega_{v}t)$. According to the tutorial, we feed that function into the VCO, which then changes $\omega_{v}$ until the frequencies are equal and the term in the sine is zero for all $t$.

That all seems well and good when the initial phase of the incoming reference wave is 0. In that case, $V_{r}\sin(\omega_{r}t-\omega_{v}t)$ is positive when $\omega_{v}$ is less than $\omega_{r}$ and it is negative when $\omega_{r}$ is less than $\omega_{v}$. But what if the grid voltage is actually at some initial phase offset relative to the VCO? Let's say the true equation of our input to the VCO is, for example, $V_{r}\sin(\omega_{r}t-\omega_{v}t+\pi)$. Then $\omega_{v}$ could be less than $\omega_{r}$ and $V_{r}\sin(\omega_{r}t-\omega_{v}t+\pi)$ would still be negative. The VCO would falsely interpret this as a "you're ahead of the reference frequency, slow down" command, $\omega_{r}$ and $\omega_{v}$ would separate even further over the course of the wave's negative half-cycle, and I don't think a PI frequency controller would ever recover from that.

I'm not seeing a way around this problem. We don't have access to the actual frequency difference, only to the value of the combination sine function we've created. We also can't make any claims about the initial phase angle of the reference voltage, since we could have started our PLL at any point in its cycle and it could have any initial phase relationship to our VCO. If anyone could help me understand how we get past this issue, it would be a huge help. Thanks in advance!

EDIT: PLL block diagrams such as the one in the link below have a low-pass filter on the input to the VCO, but I don't believe that has anything to do with my question. Unless I'm mistaken, that LPF is just there to remove the high frequency component $\omega_{r}+\omega_{v}$ that results from the phase detector, i.e. the "combine VCO and reference signal" block. The LPF then leaves us with a pure (in the ideal case) sine wave $V_{r}\sin(\omega_{r}t-\omega_{v}t)$. If I'm wrong about that, though, please let me know!

https://www.google.com/search?q=pll+diagram&tbm=isch&source=iu&ictx=1&fir=BxBgiyvYxsuLiM%253A%252CgtPdFL-0ZhSHZM%252C_&usg=AI4_-kQbgUQu5HbOzaiSAkInzcAP8kbYQw&sa=X&ved=2ahUKEwju9dr_ztbdAhWOFTQIHRobD64Q9QEwAHoECAAQBA#imgrc=ZTkMCllE8hHDZM

EDIT 2: Had a helpful exchange with Dan, who gave me some pointers on more efficiently modeling a PLL. He also pointed out that it would be helpful clarify that my confusion is regarding how to implement a PLL. I am assuming that I don't know the phase or the frequency of the incoming reference signal ahead of time. In fact, that's why I'm building a PLL in the first place: I have a sinusoid of unknown phase and frequency, and I am trying to determine both of those quantities by locking a VCO to it and then just querying the VCO.


texts: Active noise cancellation using kalman filter

texts: I am doing signal processing on audio data sampled at 8Ksps in matlab but it is corrupted with random noise.  Therefore,  I decided to use LMS and RLS ANC algorithms to remove overlapped frequency noises and I have found RLS performance was better than LMS and NLMS. But now I want to use kalman filter so that I can achieve better result. I know kalman filter and have used in many basic applications but don't know how to use it for ANC. I would be grateful if anyone give me some idea .


texts: How to correct phase using arctangent as Phase Detector

texts:
I have a DPLL that's trying to lock to a DSB-SC input signal with a carrier whose phase is $\theta$. So after some mixing and filtering (Costas Loop), I have these two signals ($\hat{\theta}$ is the estimated phase by the DPLL):

$$
s_I(t) = 0.5x(t)cos(\theta-\hat{\theta})
$$
$$
s_Q(t) = 0.5x(t)sin(\theta-\hat{\theta})
$$

And the output of my phase detector is:
$$
q(t)=atan\left(\frac{s_I(t)}{s_Q(t)}\right)=atan\left(\frac{sin(\theta-\hat{\theta})}{cos(\theta-\hat{\theta})}\right)=atan(tan(\theta-\hat{\theta}))
$$

But as you know, $atan(tan(\theta-\hat{\theta}))=\theta-\hat{\theta}$ only if $-\frac{\pi}{2}\leq(\theta-\hat{\theta})\leq\frac{\pi}{2}$.

I know how I could adjust $\theta-\hat{\theta}$ so that they fall within the accepted range. The thing is, I don't have access to $\theta-\hat{\theta}$ but to $s_I(t)$ and $s_Q(t)$.

What could be done to guarantee there's no phase ambiguity? I mean, I can adjust only $\hat{\theta}$ since I'm generating it, but adjusting that one doesn't mean that $-\frac{\pi}{2}\leq(\theta-\hat{\theta})\leq\frac{\pi}{2}$ will be true.


texts: Find B given A and impulse response of B/A

texts:
Here is a small MATLAB function that computes B in B/A given A and the impulse response h of B/A

function b = numf(h,a,nb)
%NUMF   Find numerator B given impulse-response h of B/A and denominator A
%   NB is the numerator order.

nh = max(size(h));
impr = filter(1,a,[1 zeros(1,nh-1)]);

egqs = toeplitz(impr,[1 zeros(1,nb)]);

b = h/egqs';

Could someone help me understand why these steps give B.

I get what filter() and toeplitz() do, but not the last line : b = h/egqs'

Thanks for any help,

Jeff


texts: What's the frequency transform of a random matrix?

texts:
Assume the following:

img = 255*rand(512); %Generating a 2D matrix with random numbers between 0 to 255.

fftimg = abs(fft2(img)); %FFT of the image.

The frequency transform of this image is a single high value at the top left corner of the image. This means the 'energy' or the frequency response is the highest and concentrated at the lowest frequency

Can you explain why this happens?


texts: How to represent half of equilateral triangle signal?

texts:
How to represent the signal in above image ?

I know a ramp signal can be represented by

$$x(t) = t\cdot u(t)$$

but here amplitude of that signal is not same with $t$


texts:
I have a file that is composed of n data records with a sample rate s. Each of these records has a duration d. Now due to postprocessing I have to change the duration to d=d/3, thus afterwards I'll have 3*n data records stored in the file.
I'm now wondering if there is some signal processing rule that says that I also have to change the sampling rate as well (e.g. if the duration changes by 1/3 then the new sampling rate is s=s/3?). I don't want to up/down sample the signal, just change the duration of each record.


texts: Pywavelets CWT returning 0 after scale 64

texts:
I am running continuous wavelet transform in mexican hat wavelet basis on a data set (with millions of samples) using pywavelets. The command used is pywt.cwt(data, scales, wavelet). It works well for scales less than or equal to 64 but above 64 I am getting 0 as output for all coefficients. Any idea what is happening (I am assuming some truncation to 0 due to limited number of bits to store the data)? And how to fix it, if there is any solution.
Also above scale 64, the computation is getting really infeasible in terms of memory and runtimes, so even if I could fix it, I would actually prefer staying within scale 64. And of course in reality we would need infinite number of scaled daughter wavelets to complete the entire spectral range which is impossible. What are my other solutions, is it possible to have something like a low pass for the lower frequencies not covered using the mother and daughter wavelets, so I can visualize the continuous wavelet transform of high frequencies along with the short time Fourier transform of lower frequencies in one graph?


texts: Detecting delay and sample drift in audio files (wav, mp3, etc.)

texts:
In my application, I have an audio recording with background music. I know which song is playing in the background and have a copy of the original song (wav, mp3, etc.). The goal is to align the original song and the song in the recording with a high degree of accuracy so that I can subtract out the song from the recording. Unfortunately, most recorded songs will have some amount of time stretching due to sample drift in the playback device (e.g. up to $1-2\%$ in older CD players, meaning typical length songs can be $\pm 3\text{ to }5$ seconds longer). In addition, the background music will often overlap with other sounds (voices, noise, etc.).

I have a fairly robust solution for roughly estimating the time delay using image processing techniques on the spectrograms of the input signals (see code from this blog). Basically I take smaller chunks of the spectrogram from the original song (e.g. $10$ seconds) and slide it across the recording, looking for peaks in the normalized cross-correlation. I generally find a strong peak, as shown below, even with lots of voices talking, noise, and reverberation.

However, when it comes to estimating the relative time stretch between the signals, I'm at a loss.

How do I know if peaks correspond to the correct portion of the song (and are not just caused by correlation between sections of the song)?
How do I find secondary peaks with enough confidence that I can use those to calculate sample drift?
How do I (with high confidence) know if there is even a song playing (there will possibly be recordings where the song isn't playing for long durations).
Are there simpler time-domain techniques I'm missing here?


texts: Interpolate DFT Coefficient of a Frequency That Is Not in the DFT Bin

texts:
I'm using the Jacobsen interpolation to get a more precise frequency of my signal. To get the corresponding DFT coefficient I'm doing:

$$X_{f} = \sum_{n=0}^{N}{x_{n}  e^{-2\pi ifn}}$$

Where $x_{n}$ is the samples of my signal and $f$ is the frequency found by the interpolation (that is not one of those in the DFT bins).
This is a quite heavy computation for large signals.

Is there a method to interpolate the coefficient corresponding to that frequency without having to compute the sum?


texts: redundancy of sin and cos waves with real data

texts:
I have the following question. Isn't it true that when applying a fourier transform to a real function (i.e. computing a characteristic function for a density), we only ever need one of the two waves: sin or cosin, to capture it's behavior.

I did a numerical exercise of moving back and forth between a probability density and a characteristic function, and every time it seems like either of the two waves is enough. Here are the waves:
Here are the original real data histogram (yellow), estimated smooth density (red) and the same density reconstructed separately from the sin (green) and cosine (blue) waves of it's own characteristic function.

Maybe for the complex input, the two waves are really necessary, but there is clearly some redundancy when the input is real.

Has anyone seen this before?


texts: Help in designing filter for DUC (Digital Up-Converter) and DDC (Digital Down-Converter) using the built-in DUC and DDC blocks in MATLAB Simulink

texts:
Can anyone please help me in simulating a simple BPSK transceiver system that correctly receives a signal through a DUC and DDC? I have attached the screenshot of my Simulink system along with constellation diagrams, spectrums and DUC and DDC filter responses. Below are the specs used in the system:

Binary Generator Specs

Probability of zero - 0.5

Initial seed - 61

Sample Time - 1/10e3 (10 KHz Sampling Frequency)

Samples per frame - 44

Digital Up-Converter Specs

Interpolation Factor - [1 16 2] (Total Interpolation factor - 32)

Here, 3x1 Matrix elements indicate the interpolation factor of the three individual stages of interpolation. Simulink DUC block uses a FIR interpolation filter, followed by a CIC filter and a CIC compensator.

Minimum order filter design - Yes

Two-sided Bandwidth of the input signal - 2e3 (2 KHz)

Source of stopband frequency - Auto

Passband ripple of cascaded response - 0.1 dB

Stopband attenuation of cascaded response - 80 dB

Type of oscillator - Sine wave

Center Frequency of output signal - 100e3 (100 KHz)

Input sample rate - 10e3 (10 KHz).

Digital Down Converter Specs

Decimation factor - [2 16 1] (Total decimation factor - 32)

Minimum order filter design - Yes

Two sided Bandwidth of the input signal - 2e3 (2KHz)

Soure of stopband frequency - Auto

Type of Oscillator - Sine wave

Center Frequency - 100e3 (100 KHz)

Input Sample Rate - 10e3*32=320 KHz

As you can see, I do not get correct BER, which means my signal is getting aliased as I receive through the DDC. As seen from the spectrums, I receive correct frequency translation and correct output sampling rates, which means the signal is getting correctly up-converted.

Please help me in debugging where the problem lies. I presume the problem is with the filtered response. The simulink block allows to modify the filter orders of the FIR interpolator, CIC interpolator and CIC compensator. If anyone could help me in correctly design the system, I would be beholden to you. Thank you


texts: Remove unwanted object of image in MATLAB?

texts:
I am trying to remove the unwanted object. I have an image that includes a house and the trees. I am trying to remove the trees. I am using 'imsubtract' to remove small edge. But the result is not good. The tree on wall still exist. How can I remove the tree in front of the building?

This is my code:

clear;

I = imread('Frame02.png');

BW = im2bw(rgb2gray(I), 0.5);figure;imshow(BW);

BW1 = BW;

CC = bwconncomp(BW);

numPixels = cellfun(@numel,CC.PixelIdxList);

[biggest,idx] = max(numPixels);

BW(CC.PixelIdxList{idx}) = 0;

figure, imshow(BW);

figure, imshow(BW1);

Ir = imsubtract(BW1,BW);

figure;imshow(Ir)


texts: Complex filters can be used in low IF architecture especially in DSP in order to phase out (reject) the image signal. How are complex filters implemented in the analog domain?


texts: Is there a technical term for this simple method of smoothing out a signal?

texts:
Firstly, I am new to DSP and have no real education in it, but I am developing an audio visualization program and I am representing an FFT array as vertical bars as in a typical frequency spectrum visualization.

The problem I had was that the audio signal values changed too rapidly to produce a pleasing visual output if I just mapped the FFT values directly:

So I apply a simple function to the values in order to "smooth out" the result:

// pseudo-code
delta = fftValue - smoothedFftValue;
smoothedFftValue += delta * 0.2;
// 0.2 is arbitrary - the lower the number, the more "smoothing"

In other words, I am taking the current value and comparing it to the last, and then adding a fraction of that delta to the last value. The result looks like this:

So my question is:

Is this a well-established pattern or function for which a term already exsits? Is so, what is the term? I use "smoothing" above but I am aware that this means something very specific in DSP and may not be correct. Other than that it seemed maybe related to a volume envelope, but also not quite the same thing.
Are there better approaches or further study on solutions to this which I should look at?

Thanks for your time and apologies if this is a stupid question (reading other discussions here, I am aware that my knowledge is much lower than the average it seems).


texts: Why is a bandpass filtered analog PM signal still PM and not AM

texts:
I know, that in theory a sinusoidally phase modulated (PM) signal with an expression like $\Re(e^{\mathrm{j}k\sin(\omega_s t)} \cdot e^{\mathrm{j}\omega_ct})$ with the signal frequency $\omega_s$, the modulation index $k$ and the carrier frequency $\omega_c$ has frequency components at the frequencies $\omega_c \pm n\cdot\omega_s$ with amplitudes calculated from the bessel functions of the first kind.
This means, that for no noise and for an infinite timespan, the fourier transform of such a PM signal consists only of a carrier and (an infinite number of) symmetric spurs around the carrier.
Now when I filter this PM signal using a bandpass with center frequency $\omega_c$ and bandwidth slightly larger than $2\omega_s$, I get a signal with a carrier and a single pair of sidelobes/spurs that are symmetric around the carrier. When I try to demodulate this signal (either using a dsp simulation or using a signal generator and a signal analyzer), I get almost no amplitude modulation and a roughly sinusoidal phase modulation.
I am wondering about two things, I don't understand:

Why is the bandpass filtered signal still a PM signal and not an AM signal? AFAIK, a sinusoidally modulated AM signal consists of the (optional) carrier at $\omega_c$ and two sidelobes at $\omega_c\pm\omega_s$. But this seems to be exactly the spectrum of the filtered PM signal. What am I missing here?
How are AM sidebands/spurs different from PM sidebands/spurs? Given I have a pair of spurs around the carrier at $\omega_c$ with offset $\pm\omega_s$, how can I determine if those spurs are a sinusoidal amplitude modulation or a sinusoidal phase modulation?

Edit 1:
Based on Fat32's answer, I played a little bit with different phase angles between spurs. In particular, I created one-sided frequency vectors with a (single-bin wide) carrier at one frequency and two (single-bin) sidebands with fixed and equal distances left and right to the carrier. The carrier has a mangitude of 1 and an angle of 0. The spurs have a magnitude of 0.5 each and can have independent angles.
If I am not mistaken, a $\cos(\omega t) - \sin(\omega t)$ type of expression should have spurs with phase angles of $\pm \frac\pi2$ relative the carrier (coming from the identity $\sin(\omega t) = -\frac{\mathrm{j}}{2}(e^{\mathrm j \omega t} - e^{-\mathrm j \omega t})$. When I configure my spurs with said angles of $\pm \frac\pi2$ and take the inverse fft of my frequency vector, the resulting analytic signal has zero imaginary component and a sinusoidal magnitude. Which means, it is pure AM modulation.
Did I get the phase angles for the $\cos - \sin$ expression wrong?
And what are the general rules here? When I have a carrier (with an angle of 0 w.l.o.g.) and a pair of symmetric spurs with relative angles $\phi_1$ and $\phi_2$, when exactly is the resulting (analytic) signal only AM or only PM?
Edit 2:
Another attempt of mine was to approach this mathematically. Looking at the analytic baseband signal of the demodulated signal from the first edit, it should have an expression of the form $A_1 + A_2 \left(e^{\mathrm j(\omega_s t + \phi_1)} + e^{\mathrm j(-\omega_s t + \phi_2)}\right)$.
As $A_1$ and $A_2$ are constants, I thought I can simply focus on the sum of the exponentials and determine

For which $\phi_1, \phi_2$ is $\frac{\partial}{\partial t}\left|e^{\mathrm j(\omega_s t + \phi_1)} + e^{\mathrm j(-\omega_s t + \phi_2)}\right| = 0$ (no AM)
For which $\phi_1, \phi_2$ is $\frac{\partial}{\partial t}\angle\left(e^{\mathrm j(\omega_s t + \phi_1)} + e^{\mathrm j(-\omega_s t + \phi_2)}\right) = 0$ (no PM)

Unfortunately, for general angles $\phi_1$ and $\phi_2$, I was not able to derive any general conditions for purely AM or purely PM modulation from a single pair of spurs with equal amplitude and distance and independent angles.


texts:
I am doing some simulations on the performance of OFDM systems in multi-path channels and I am confused about something. It is explained below:

Assume that we have a multi-path channel with a number of taps equal to $L$. Each tap has a power of $\sigma$, hence, the total power in the multi-path channel in time domain is $\sigma\:L$. If the generated channel in time domain of length $L$ is denoted as $h$, then the channel in frequency domain of length $N$ is $H = \rm{FFT}(h,N)$, where $N$ is the number of OFDM subcarriers.

If we have $X \sim N(0,\frac{\sigma^2}{2})$ and $Y \sim N(0,\frac{\sigma^2}{2})$, then $h = \sqrt{X^2 + Y^2} \sim \rm{Rayleigh}(\frac{\sigma}{\sqrt(2)})$.
Additionally, if channel in frequency domain $H\sim \rm{Rayleigh}(\frac{1}{\sqrt{2\lambda}})$, then $|H|^2 \sim e^{\lambda}$? In this line correct? Is $\lambda = \frac{1}{\sigma^2}$?

I am confused about the transition from $h$ to $|H|^2$ and the relation between their means and variances.

I appreciate your help in advance.


texts: Bandpass filtering with passband changing with time

texts:
Is it possible to implement some sort of filter which adapts as a function of time?

Specifically, say I have a "noiseless" model of some signal which has the same frequency components at the same times as the signal I expect to measure, but with different phase and amplitudes (thus invalidating simple matched filtering).

So, in other words, the absolute value spectrograms (built by STFT, though I suppose any other time-frequency analysis such as CWT would be similar) of both signals will be similar in shape, though one of the acquisitions will be noisy, with different phase and amplitudes.

I guess I could do some filtering window by window, but I'm not entirely sure if this won't produce nasty artifacts when reconstructing in the time domain. Also, I wonder if there might be a smarter way of going about this problem.


texts:
I want to convolve two discrete functions $f$ and $g$ using convolution stride size $a$ to get the result as $s_{a, i}$:

$$s_{i,a} = \sum_i g_k f_{ai-k}$$

I know that simple convolution with $a=1$ can be calculated via FFT. I can do it even now, but I have to drop out all the points except $ai$. I think this way is not the best.

Cannot you advice me something better?


texts:
I want to learn how to compute linear coefficient, but to be honest - I can't.
I know how to use them if i have it and why I want them.

Suppose this toy example:

A signal $x=[-1, -2, 0, 1]$

According to matlab function lpc(X,p) if I want to compute the 2th order coefficients of this signal the result is $a = [1.0, -0.50, 0.50]$ and $ g=1.0$

I Know how to compute the g using $A(k)$ formula and that $a_0=1$ always, but can someone explain me why $a_1=-0.5,  a_2=0.5$ how to compute them without using matlab or any other software.

P.S It there any method which allow me using  $A(k)$ to compute directly the coefficients?

thanks


texts: How to filter a white noise or random noise in Matlab Simulink?

texts:
I am working on a sun-synchronous satellite Simulink model wich determines its attitude from a Sun sensor and a star sensor whom measure the sun and star direction in the satellite body reference frame. I have to introduce measure errors on both sensors using a "white noise" Simulink block, but I prefer to generate the noise through a Matlab function block using the function "rand" (or shoul'd I use the "randn" function?).

My issue is that I have to filter the noises on the measurements before sending them to a block who compute the attitude quaternion error to feed it to a PID controller blockset which commands a Reaction Wheels Assembly. Without noise the satellite flies smoothly.

I have tried some solution such as lowpass filter, Butterworth filter, mean on peaks and downs, but nothing seems to work properly.

I cannot figure out, for example, which should be the cut off frequency to set up on a lowpass filter ( I cannot figure out if the lowpass filter is the correct choice for such a problem, too).


texts:
I've got this task:

A traffic policeman standing on the highway notices a change in tone of exactly one major third (f2/f1 = 4/5).
What speed can he infer? Speed of sound c = 340 m/s

I've got this attempt: 340 m/s * (1+√5/4) = 765m/S = 2754 km/h
Can someone tell me if this is correct or if I'm completely wrong?


texts: Methods for aligning FFT bins with an FSK signal

texts:
Say I want to demodulate some FSK modulation. My (novice) understanding is a pretty good way to do this is by taking the FFT, with the length chosen such that the bin spacing is equal to the tone spacing. In the common case of the tones being spaced at the reciprocal of the symbol duration, this just means taking the FFT over the symbol period. Symbol detection could then be as simple as looking for the bin with the highest magnitude.

Let's assume timing issues are already solved: there's still the problem of frequency alignment. If the receiver's frequency is a little bit off then some of the tone power will bleed into adjacent bins, degrading accuracy.

What are some basic algorithms for addressing this?


texts: Least Squares Linear Phase FIR Filter Design

texts:
In explication ''the geometric interpretation of least squares'' Typically, the number of frequency constraints is much greater than the number of design variables (filter coefficients). In these cases, we have an overdetermined system of equations (more equations than unknowns). Therefore, we cannot generally satisfy all the equations, and are left with minimizing some error criterion to find the ``optimal compromise'' solution.'

What is meant by ''constraints''
What is the relation between constraints and the number of design variables (filter coefficients).

In this case must be using a least-squares approximation.But, are there other cases when constraints less than or equal to the number of design variables?


texts:
Is there a numerically robust method for calculating the poles and zeros of a discrete-time causal LTI SISO system given its response to a unit-step input?
In the specific example I'm working on all poles and zeros are real, and I would like to calculate them using the exponents and coefficients of the exponentials in the step response (for which I have numerical values).


texts: Correlated signals separation with reference

texts:
I have a signal S, which needs to be split into two components Sx and Sy.

And I have a signal X, which is a reference signal corresponding to Sx.

I need to perform this split of S and check that resulting Sy is ~Y and Sx ~X (I can use X in the process of filtering\separation, but not Y).

This sounds like a typical denoising task, that can be accomplished with LMS\RLS filters, but in my case signals X and Y are correlated and their BW are overlapping.

They are also non-stationary:
- sometimes X amplitude can decrease to almost 0, then Sx is also 0 and Sy should be estimated as simply S.
- sometimes both X and Y are 0 for a short period of time.
- most of the time X and Y are approx sinusoidal signals with similar central frequencies, one might be slightly shifted w.r.t another.

I tried regular LMS\RLS approaches - assume Sx is noise -> S = Sy + noise, but due to crosscorrelaton between S,X and Y the algorithms best guess is S = Sy.

1) How would you try to solve this?
2) What if we can use Y as well, at least for the beginning? Would it make it simpler?

3) More specific question. Now I have S,X,Y amplitudes in arbitrary units (adc counts). Is it better to scale them? Otherwise, I assume, choice of Sx and Sy will be dependent on amplitude ratios of the signals, or not?


texts: GNU Radio | Packet Encoder/Decoder | Unwanted bytes added to the transmitted stream

texts:
(A follow up question can be found here: link)

In an attempt to understand how the packet encoding blocks work I tried to mimic the experiment performed by Aaron, published in this post, but reduced the flowgraph to the components that interested me the most, namely the Packet Encoder, the Packed to Unpacked and the Packet Decoder. I have also used a text file in_strings.txt instead of the cat_in.png.

Follows the flowgraph I have  implemented:

My expectation: I was hoping that out.txt (File Sink) would be equal to in_strings.txt (File Source).

What really happened: out.txt is very similar to in_strings.txt but it contains additional unwanted x characters that show up after 65535 expected characters.

Follows a preview of the diff side by side between the input and the output:

Follows the in_strings.txt file: https://pastebin.com/NWa7NEww

I wonder why those x's show up in the output?
Thanks in advance!


texts:
I have couple of  audio recordings of length 5 -7 min. I also have corresponding text to each audio file.
I am not subject matter expert on speech to text but I am vaguely aware that much smaller audio files (10 sec) are used to fine-tune speech recognition model .
So I want to split audio files into meaningful partitions .
Correct me if I am wrong in assumption that I cannot train model with large audio files.


texts: Poor convergence/generalization with few-shot learning object detection with "efficientdet"

texts:
Tensorflow's 2x object detection library utilizes a toy example for few-shot transfer learning using a few rubber ducky images (which is not a class in the original trained dataset....nor are ducks in general).  The colab can be found here and is very easy to implement.  Various models can be used from TF model zoo with the example using "ssd_resnet50_v1_fpn_640x640_coco17", but I also tried with "ssd_mobilenet_v1_fpn_640x640_coco17" and got good results after training 100 batches.  However, all versions of efficientdet, which is supposedly SOTA, do very poorly in that the loss doesn't approach anywhere near the others even after 1000 batches or more.  I tried a different loss function (CIOU) as well as ADAM optimizer instead of SGD, but still no improvements (again these worked fine for the other two models tried).
Any ideas if "efficientdet" is just over-rated (i.e., the paper just had more funding behind it to make it fit the dataset under consideration better), or if there are actually ways to do effective transfer learning with efficientdet?  I feel like if it doesn't work for this toy dataset then it's likely not as good as advertised.


texts: Why the angle of a real signal in frequency is continuous?

texts:
This original signal is shown below (time domain):

It is a real signal. According to the signal processing theory, the form part of the angle is conjugate to that of the latter part. That is, $\sphericalangle X(e^{j\omega}) =\sphericalangle X^*(e^{-j\omega})$ when $x[n] \in \mathbb{R}$.

However, I implement X = angle(fft(x)); and plot(X) in MATLAB. The figure is shown below:

The phase is continuous! Could anyone explain the reason? Thanks in advance!


texts: Pixel Binning: Effect on SNR for Hardware vs. Software Binning

texts:
Is there a difference in SNR (or any other measure of image quality) between using 2x2 pixel binning in the camera and shrinking the full resolution image in software (cv::INTER_AREA) to the same size (w/2, h/2) ?

I imagine that SNR is higher with binning if pixel binning is done "in hardware" but I'm not sure how binning is actually implemented or if it does make a difference, to what extent the difference is measurable/negligible.


texts: Using Matlab/Simulink to build Reader based on Software Define Radio

texts:
I am a student. I want to learn about Software Defined Radio to build a Reader for Saw tag and simulate them on Matlab/Simulink.

These bocks below is what I want to build in Matlab/Simulink

I found I could simulate RF front-end block using AD9361 because they are supported by Analog Device.

And I want to ask, can I build the digital blocks of Tx/Rx side and connect it to Tx/Rx AD9361 model to run the loop-back test like this (connect Rx to Tx) ?


texts: GCC-PHAT always peaks at zero when estimating delay offset

texts:
My question is that when I used gcc-phat to estimate delay between two audio signals, it always returns zero offset. However normal cross correlation Xcorr gives a good result. I don't know the reason.
It is the same case as below two:
GCC-PHAT (Generalized cross correlation MATLAB)
GCC-PHAT (Generalized cross correlation) always peak at delay=0 on real audio signal

I have tried to remove the DC part of signals but it doesn't work.
Any suggestion is appreciated!


texts: What framesize is usually used for audio effects?

texts:
I want to implement an audio effect that reacts to an external parameter that varies over time. The book I have describes an effect in a function that processes a certain framesize of the audio input. But using 1024 samples or more might be too slow to react on the external parameter, since it would only change all 1024 samples. In the MATLAB simulation I am passing a pre-computed array to the function. Now I want to implement this on a DSP.
One solution I can think of is using a global variable and a multihreaded application. One thread writes the current paramenter to the global variable and the other thread processes the effect filter only with that current variable. That way I would not have to pass an array every time and always have the up-to-date parameter.
Another way would be calling the function every few samples. Since it is based on a second-order filter, the minimum I need is three samples. This would also be more than enough for the parameter.
Is there a standard way to go about in digital audio processing?


texts: Word-length optimization of a fixed point chain of multipliers

texts:
Let's suppose a chain of 6 multipliers: $b = a_1*a_2*a_3*a_4*a_5*a_6*a_7$, where $b$ is the output, and $a_i$ the inputs with 16 bits. How can I optimize the word lengths of the output of each multiplier in order to minimize the fixed point error against a full precision implementation?
Let's also suppose that the output $b$ shall be some reasonable word length, for example 35 bits.


texts: I realize that matlab fft is twice as fast for real input. But does matlab fft take the fact that the transform will be conjugate symmetric into consideration? Since the input is real, it would have half as much information as a complex input, so this can explain the factor of 2. I was thinking that it perhaps should be a factor of 4. 2 for conjugate symmetry, 2 for having no complex component. Am I thinking wrong?


texts: Simulate butterworth filter with initial condition of state vector in R

texts:
I'm working in R with the packages signal and control (don't know wether these are even the best for my use case).
I have a high pass filter (butterworth, of order 1, some chosen cutoff frequency) and a (onedimensional) signal $s$.
I would like to filter $s$ using my high pass filter in a way, that pretends, that my high pass filter has previously seen the input $s[0]$ for an infinite amount of time.
I got a Python script, that does this using functions from the package signal. The procedure is as follows:

Create the filter (in tf-representation)
Switch to state space representation Calculate the initial condition for the state vector
Pass the filter, the input, the initial condition for the state vector to the function lsim2 of Python's signal package.
There you have the results

In R I can accomplish all but the second to last step.
Using the lsim function of control package doe not give the same results as in the Python scripts. I also tried the filter function from the package signal but this doesn't seem to allow me to provide an initial condition for the state space vectors.
Any hints on how to achieve this would be greatly appreciated.
I'm coming over from math.stackexchange so this is my first question.
Please be gentle, if due to my lack of experience here, the question is not perfectly posed.
Thanks in advance!


texts: Enforcing size to match Convolution using 'same' property & Enforcing Circulant Matrix (Like DFT Based Convolution)

texts:
The original problem was from this link about coding de-noising an audio signal.

Because my reputation points disabled me to comment, I have to ask a separate question here.

I don't quite understand the codes about formulating a circulant matrix.

% Enforcing size to match Convolution using 'same' property
mBlurKernel     = mBlurKernel(1:numSamples, :);
mGradientKernel = mGradientKernel(1:numSamples, :);
% Enforcing Circulant Matrix (Like DFT Based Convolution)
mBlurKernel(1, (end - 3):end) = vBlurKernel(1:4);
mBlurKernel(2, (end - 2):end) = vBlurKernel(1:3);
mBlurKernel(3, (end - 1):end) = vBlurKernel(1:2);
mBlurKernel(4, (end - 0):end) = vBlurKernel(1:1);
"

What's the meaningfulness of doing the following steps?

mBlurKernel     = mBlurKernel(1:numSamples, :);
mGradientKernel = mGradientKernel(1:numSamples, :);

Originally, I thought it was to match the matrix dimension of both mBlurKernel and mGradientKernel.

So I tried the following code.

h = 10;
a = [1 2 3 4 5];
b = [1 2];
A1 = convmtx(a, h);
A2 = convmtx(b, h);
size(A1) = 10 14
size(A2) = 10 11

Next, I tried to imitate the following steps:

A3 = A1(1:h, :);
A4 = A2(1:h, :);

It turned out that nothing happen to A3 and A4. It seems that A3 and A4 are the same as A1 and A2 respectively.

In addition, I don't understand the following code:

% Enforcing size to match Convolution using 'same' property
mBlurKernel     = mBlurKernel(1:numSamples, :);
mGradientKernel = mGradientKernel(1:numSamples, :);
% Enforcing Circulant Matrix (Like DFT Based Convolution)
mBlurKernel(1, (end - 3):end) = vBlurKernel(1:4);
mBlurKernel(2, (end - 2):end) = vBlurKernel(1:3);
mBlurKernel(3, (end - 1):end) = vBlurKernel(1:2);
mBlurKernel(4, (end - 0):end) = vBlurKernel(1:1);

Why must I do so in order to enforce a circulant matrix? Is there another way for me to enforce a circulant matrix?

I'll appreciate if someone could clarify my doubts.


texts: Extract same in phase signal from 3 different sources with shared delayed noise?

texts:
If I have 3 signals coming from 3 microphones with noise $n$ delayed like this:

$S_1(t) = x(t) + n(t+\phi_1)$

$S_2(t) = x(t) + n(t+\phi_2)$

$S_3(t) = x(t) + n(t+\phi_3)$

Their shared feature $x(t)$ is in phase and exactly the same. $x(t)$ is a voice and the noise can be anything different from $x(t)$.

EDIT 1: To be more precise, the different noises also share similar features but with different phases:

$n_1(t) = \sum_{0 \to n} m_1(t+\tau_1) + m_2(t+\tau_2) + ... +m_n(t+\tau_n)$
$n_2(t) = \sum_{0 \to n} m_1(t+\tau'_1) + m_2(t+\tau'_2) + ... +m_n(t+\tau'_n)$

$etc$

I approximately know what $x(t)$ is, a voice call like "Hello Robot".

How can I extract and detect $x(t)$ from these three signals?


texts: Statistical significance of coherence values

texts:
I have two signals sampled at $100\textrm{ Hz}$ during $3\textrm{ seconds}$. So I have $300$ sample points at each signal series.
I want to calculate coherence values between these two time series and would like to know whether this coherence value is statistically significant. I found two resources online.

In the first resource, there is a parameter $n$ (it is the sample size as I could interpret). A significant coherence value for that $n$ is:
$$c = \sqrt{1-\alpha^{1/(n-1)}}$$

and this formula does not include any frequency component, unless $n$ is related to frequency instead of sample size.
In the second resource, the function returns degree of freedom and significance level at each frequency. However I am not sure whether this function returns the correct computation or not. Besides I couldn't interpret the results of this function.

My question: How can I find the significance of my computed coherence value at a certain frequency (or frequency band) preferably using MATLAB in the light of the above resources?


texts: Does $\cos(bt)\cdot u(t)$ have a Fourier Transform?

texts:
If it does,
$$\int_{-\infty}^{\infty} \cos(bt)\,u(t)e^{-j\omega t} dt = \int_{0}^{\infty} \cos(bt)\,e^{-j\omega t} dt = \int_{0}^{\infty} \frac{e^{jbt} + e^{-jbt}}{2}\,e^{-j\omega t} dt$$
Then how do we carry on from this point?
$$ \frac{1}{2} \int_{0}^{\infty} \left[e^{j(b-\omega )t} + e^{-j(b+\omega )t}\right]dt$$
Thank you.


texts: The Effect of a Kernel on an Image By Filtering

texts:
I am going through an old exam paper and trying to understand this question where they ask us to tell them what effect the following image filter would have if its convolved with an image:

     0     0     0     0     1     0     0
     0     0     0     0     0     0     0
     0     0     0     0     0     0     0
     0     0     0     0     0     0     0
     0     0     0     0     0     0     1
     0     0     0     0     0     0     0
     1     0     0     0     0     0     0

Now by using Matlab I can easily tell that this blurs the image. But what I am wondering is how would one know by just looking at this filter that the image will get blurred when this filter is applied?

Here's the image I'm working with in its original form:

Here's the same image after being convolved with the kernel in Matlab:

I would appreciate an explanation here or if someone can point me in the right direction as to a reading online I'd appreciate that too.


texts: Upsampling very large data sets efficiently

texts: I have gigabytes worth of seismic ground data, that I wish to upsample by a factor of 2 or 3. I wanted to ask what efficient way might there be for me to upsample such a big file? Is there a way to break it down and do it in mini-files? (I am using MATLAB for my software, I think the resample command might take too long though). Thank you.


texts: Is there an equivalent time-domain operation to the spectrum averaging in Welch's method?

texts:
In Welch's method a time-series is segmented and then the subsequent FFTs of the segments are averaged. Is there an equivalent time-domain operation?

I guess doing the the Welch estimate and producing an impulse response using an FIR filter might do what I want, but I'm looking for a way to do it in the time-domain directly (getting rid of noise, keeping signal properties)...


texts: Can you please suggest some books to get how guitar effects: distortion, overdrive, phaser and so on are achieved ?


texts: Will the resulting spectrogram from this algorithm be 1D or 2D?

texts:
I'm implementing a spectrogram algorithm and I get the basic concepts, however, I'm struggling with something.

Let's say I have a 1D vector:

data = [0.36, 0.58, ...., 0.25]

I then compute a STFT of this data (with an overlap of say 128) this then produces a 2D array. I then compute the log of these values in order to compute the spectrogram.  Would the resulting vector be 1D or 2D? Since the STFT is 2D (as it is split into blocks), I'm guessing that the spectrogram will be a 1D representation since I'm calculating the logs.


texts: comparison between frequency offset estimators

texts:
I have been working frequency offset estimation in OFDM. The objective was to compare different frequency offset estimation techniques. By using MATLAB, I have simulated three different estimation techniques, namely:

By using Pilot tones
Using phase difference between two repetitive symbols (proposed by Moose)
and by using a blind method (Cyclic Prefix)
The comparison between these methods is done by simulating the mean square error (MSE), and below is the output figure

However, my supervisor highly recommended to do the comparison between the CFO estimation methods using another parameter rather than the MSE(without suggesting another way). Therefore, I would like to request from the respected members to suggest me alternatives that I can do the comparison.

I hope that I'm not violating the rules of this forum by asking this general question.


texts: How to interpret a spectrum with FFT mirroring?

texts:
I have this code which interprets a few data points on magnetic field strength into a spectrum, as shown below:
c = fft(magfield);
c = c*2/n;
ca = abs(c);
dt = 1/fs;
f = (0:n-1)/(500*dt);

for i = 1:length(ca)
    if ca(i) > 0.002608
        ca(i) = 0;
    end
end

spectrum = fftshift(ca);
plot(spectrum)

Where fs is 5e5 and n is 50000000. what i get is a graph which looks like the one below:

I have no idea how to interpret the spectrum, where the peak frequencies are and why this mirroring effect is happening. Could you guys please shed some light on what's going on?
Thanks!


texts:
I have a PCM signal recording of UART data after high-pass filter. The recording looks like this:

I know baud rate and parity setting beforehand. What algorithm could help me recover actual binary data from the recording automatically?


texts: Can Kalman Filter be used to track Randomly Moving Target?

texts:
i want to track random moving object with a camera using kalman filter...i have the following questions...

Randomly moving target means $Corelation(t) = E[ x(T)x(T+t) ]$ is very low...where $x(T)$ is the position of the target at time = $T$ along an axis say $x$ axis..eg...moving hand...moving bird..moving ant..what will be my state transition matrix $F(k)$ in $x(k+1) = F(k)x(k) + w(k)$ because i cannot describe it randomness...
is there any standard model to represent any random moving target?

any suggestion is welcome....i am aware that any object can be determined in a given image frame using its characteristics by image processing techniques and hence tracked....but is it  possible to use Kalman Filter?


texts: Simulating musical instruments using their impulse response

texts:
I studying DSP and trying to find the limitation of 'teaching' a software to emulate a musical instrument by sampling its notes at different velocities and building an LTI system for simulating it.

Is that feasible? is that even LTI? is that limited to certain instruments only? what are the problems I'm about to encounter trying to do that?

Thank you


texts:
I got the concept of Convolution in signal processing from a video lecture that it is method to get the area overlapped between two signals when one signal is flipped over and traversed over another signal and that it allows for getting combined effect of two signals during that traversal. But how this concept is applied in image processing.

How a function of some arbitrary window size is used to be traversed over the image in order to get effect and how convolution is actually taking place there ?


texts: How do you model a rolling shutter in the frequency domain

texts:
Say you have an image in time domain:
$$a(x, y, t)$$

The Fourier transform is then:
$$A(k_x, k_y, f)$$

So far so good. What if we now introduce a rolling shutter. How would one model that. I'd expect the rolling shutter to have an effect similar to a rect window, albeit a 3 dimensional one. Any references on this? It would be nice if I can avoid deriving it all.


texts: Velocity estimation knowing acceleration and displacement from measurements using Kalman filter

texts:
I am having a hard time in trying to use a Kalman filter to obtain velocity
from acceleration and position measurements. I think the main reason is that
I am not familiar with Kalman filters (I had only a couple of lectures about it
and I implemented it only once).

To start I had a look to some questions here and also on a paper I found...
and now I am confused.

This is what the paper says: the noisy acceleration measurement is the driving input
and the measurements are the measured noisy states.

The equations for the measurement dynamics can be written as:

$\begin{bmatrix}\dot{x} \\ \ddot{x}\end{bmatrix} = \begin{bmatrix}
0 & 1 \\ 0 & 0 \end{bmatrix}\begin{bmatrix} x \\ \dot{x}\end{bmatrix}+
\begin{bmatrix}0 \\ 1\end{bmatrix} \ddot{x_a} +
\begin{bmatrix}0 \\1\end{bmatrix}\eta_a$

$y = x_a = [1 \ 0] \begin{bmatrix} x \\ \dot{x} \end{bmatrix} + \eta_d$

The $\eta$ terms take into account the bias and noise errors.

In matrix form:

$\dot{x} = Ax+Bu+v$

$y = Cx+w$

$v$ and $w$ describe the noise in the accelerometer and displacement.

The feedback estimation formulation for the state estimates \hat{x} is

$\dot{\hat{x}} = A \hat{x} + B u - L (y-C \hat{x})$

where $L = [l_1 \ l_2]^T$ represents the desired feedbagk gains

Then it keeps going talking about the dynamics of the error signal $\epsilon = x-\hat{x}$
and analysing the steady-state error $\epsilon_{SS} = - [A-LC]^{-1}(v+Lw)$ it
comes to the conclusion that the state vector needs to be augmented:

$\begin{bmatrix}\dot{x} \\ \ddot{x} \\ \dot{\eta}_a \end{bmatrix} =
\begin{bmatrix}0 & 1 & 0 \\ 0 & 0 & 1 \\ 0 & 0 & 0 \end{bmatrix}  \begin{bmatrix} x \\ \dot{x} \\ \eta_a \end{bmatrix} +
\begin{bmatrix}0 \\ 1 \\ 0 \end{bmatrix} \ddot{x}_a + \begin{bmatrix}0 \\ 0 \\ 1 \end{bmatrix} \dot{\eta}_a $

$y = [1 \ 0 \ 0] \begin{bmatrix} x \\ \dot{x} \\ \eta_a \end{bmatrix} + \eta_d$

What I do not understand is where the velocity (which I need to estimate) comes into play in this formulation.

Therefore I had a look at this question Estimating velocity from known position and acceleration, but I do not get how to write the state matrix $A$.

In fact, if the state vector is $[x \ \dot{x} \ \ddot{x}]^T$ (as said in the answer) then I should write

$\begin{bmatrix} \dot{x} \\ \ddot{x} \\ \dddot{x} \end{bmatrix}= \begin{bmatrix} & & \\ & &  \\ & &  \end{bmatrix} \begin{bmatrix} x \\ \dot{x} \\ \ddot{x} \end{bmatrix} + B u$

First question, what are the equations I have to use to fill matrix $A$?

What are $B$ and $u$ in this case?

Why 2 such different approaches to model this problem?

Then, once I have found the correct formulation of the problem I have to compute the matrix $L$ and this can be done using the Matlab function kalman (knowing the covariance matrices of $v$ and $w$). After that do I have to integrate the equation of the observer
$\dot{\hat{x}} = A \hat{x} + B u - L (y-C \hat{x})$ to get my estimated state?


texts:
The wikipedia article on continuous-phase modulation states the following:

  For instance, with QPSK the carrier instantaneously jumps from a sine to a cosine (i.e. a 90 degree phase shift) whenever one of the two message bits of the current symbol differs from the two message bits of the previous symbol. This discontinuity requires a relatively large percentage of the power to occur outside of the intended band (e.g., high fractional out-of-band power), leading to poor spectral efficiency.

I want to know how this is true since in M-ary PSK the amplitude is constant so isn't the power constant too?


texts:
Quantization of Continuous-Amplitude Signals

This point is not clear to me:

"The smallest quantization levels ($\pm\Delta$) correspond to the least significant bit of the binary code word."

Could someone explain it please?


texts: Output of Zero-forcing equalizer doesn't match theoretical calculations

texts:
Let's say I have a sequence $x[n]$ (signal) and perform convolution with another sequence $h[n]$ (channel), so:
$$
y[n] = h[n]*x[n] = \sum_{k}{h[k]x[n-k]} \leftrightarrow Y(z) = H(z)X(z)
$$

I'm looking for $C(z)$ such that:
$$
C(z)= \frac{1}{H(z)}
$$

So that I can compensate the channel:
$$
c[n]*y[n] = \sum_{k}{c[k]y[n-k]} \leftrightarrow C(z)Y(z) = \frac{1}{H(z)}Y(z) =
 \frac{1}{H(z)}H(z)X(z) = X(z)
$$

Let's assume I know the channel $h[n]$ and I use that to obtain $c[n]$ using Zero-Forcing equalization.

My question is, if I do:

x = [1 2 3 4 5 6 7];
h = [1 0.9 0.3];
c = zeroforcing(h); % c=[-4.7619, 4.2857, -1.4286]

y = filter(h,1,x);
x_d = filter(c,1,y);

Shouldn't x_d be a delayed version of x ? But I don't seem to get that in my simulations.

(The way I obtain c is converting h to a toeplitz matrix and doing $c[n]=H^{-1}\delta [n]$ as explained here:

$$
\begin{bmatrix}
c_1 \\ c_2 \\ c_3
\end{bmatrix}
=
\begin{bmatrix}
h_2 & h_1 & 0 \\
h_3 & h_2 & h_1 \\
0 & h_3 & h_2
\end{bmatrix}^{-1}
\begin{bmatrix}
0 \\ 1 \\ 0
\end{bmatrix}
=
\begin{bmatrix}
0.9 & 1 & 0 \\
0.3 & 0.9 & 1 \\
0 & 0.3 & 0.9
\end{bmatrix}^{-1}
\begin{bmatrix}
0 \\ 1 \\ 0
\end{bmatrix}
$$


texts: Calculating the complex signal's average power

texts:
$$x(t) = \cos(\pi i t/20+\pi/4) - 2je^{j \,12\pi i t} + 5\sin(2\pi i t/3+\pi/3) $$

I need to find the signal's average power.
How can I do that?
The $i$ index (represented in red in the below image) just denotes a random integer.


texts: Gaussian Blur In MATLAB and Connection to Image Resolution

texts:
I am calling fspecial() in MATLAB to create a Guassian blur of an image.

For example,

%Create Gaussian Filter
G = fspecial('gaussian', [5 5], 2);

% Blur Image
blurredImage = imfilter(nonBlurredImage,G,'same')

The parameter [5 5] is hsize which defines the extent to which the Gaussian filter is applied ... which according to user "Try Hard" ... "In the case of a gaussian filter, the intensity at each pixel around the central one is weighted according to a gaussian function prior to performing a box average over the region."

The parameter 2 is sigma ... with units of pixels.

Say the size of nonBlurredImage is 200x200. And that the side of each pixel represents a length of 0.25 mm. Then the image could resolve objects with a "resolution" of 1 line pair/mm without aliasing.

If I pass G = fspecial('gaussian', [5 5], 1) to the filter function, and then produce the blurred image. What would be the "resolution" of this image? How does it relate to hsize? If I instead used [10 10] or [1 1], how would that affect things?

Thanks!


texts: Which digital modulation scheme would be suitable for transmitting digital data through the output of a PC soundcard

texts:
I need to output a data stream at $40\textrm{ kbit/s}$ or faster out of a computer system whose only accessible output peripheral is the audio interface. This interface has reasonable specs, $96\textrm{ kHz}$ sample rate, with $24$-$\textrm{bit}$ resolution, but the output stage is AC-coupled. Only one output channel is available. A good assumption would be that it behaves like a band-pass filter with a $4\textrm{ Hz}$ to $40\textrm{ kHz}$ pass-band with less than $-1\textrm{ dB}$ attenuation; and that it has a $90\textrm{ dB}$ SNR. I don't have any other complexity constraint on the emitter.

I do not expect additional noise / attenuation on the cable connecting the emitter to the receiver.

The receiver is an embedded system with a $120\textrm{ MHz}$ Cortex-M3 MCU. If necessary, similar audio acquisition performance can be assumed. An additional dedicated demodulation chip (if there exists such a thing for such low frequencies) could be an option.

Which digital modulation scheme would be suitable for this situation?
Are there already code libraries (software defined radio libs?) that would prevent me from reinventing the wheel?
Are there existing applications with similar constraints at which I could look for inspiration?


texts:
So I'm reading the datasheet for MAX98357A.
It's an audio amplifier that receives digital signal using I²S bus and has integrated digital low-pass filters of the IIR and FIR types.

In addition to the usual -3 dB and -6.02 dB cut-off points, it also has the "Ripple limit cutoff". This is a term I did not see during my education, and I'm not sure exactly what it means.

Here's an example of the specification:

Ripple limit cutoff 0.43 x Fs
-3dB cutoff         0.47 x Fs
-6db cutoff         0.5  x Fs
Stopband cutoff     0.58 x Fs


texts: Why is the state space representation, $dx/dt = A x(t) + B u(t)$ linear?

texts:
One thing puzzles me about the state space representation and that is why is it claimed that such systems are linear and time-invariant but particularly why are they claimed to be linear?  The right-hand side of $dx/dt = A x(t) + B u(t)$ does not seem to obey superposition? Is it because the solutions to these systems are linear?

For example:

$y_1 = A x_1 + B u $

$y_2 = Ax_2 + B u$

$y_3 = A (x_1 + x_2) + B u $

Therefore $y_3 \neq y_1 + y_2 $

I'm I doing something wrong?


texts:
I suppose that an image is affected by a multiplicative noise (or additive noise and etc.). I want to quantify and measure the rate of noise (for exemple 1%, 2%, ...,25%) present in an image. I used the snr and psnr but they give me the values measured in dB (decibel). Also, how can I implement this in MATLAB?

Can I use the mse or the average between the noisy image and the original image mean?

After the answer of Mr. Tolga Birdal, I put the following code in matlab:

I=rgb2gray(imread('lena.png'));
J=imnoise(I,'speckle', 0.1); % 0.1 is the variance of the noise
Sigma1 = estimate_noise(I)

Its give to me :

  Sigma1 = 6.9360

Sigma2= estimate_noise(J)

and

  Sigma2= 10.1409

this mean that the level of noise present in the image J equals to 10.14 % ?


texts: Finding minimum in the middle of a histogram

texts:
I'm building an image processing pipeline and one step in the process requires thresholding the image based on saturation.

Example code using OpenCV-Python:

H, S, V = cv2.split(img)
mask = cv2.threshold(S, low, 255, cv2.THRESH_BINARY)

I know how to set the low value manually, if I look at the histogram:

(the red arrow indicates the value I would pick)

My question is: how can I programatically find that value?

Some non-rigorous descriptions of the problem:

find the lower boundary of the right-most "hump"
find the minimum value that's not at the edges