texts: Estimate transfer function from Bode curve

texts:
I have measured the magnitude response Y_mag(f) and phase response Y_phase(f) of an unknown physical system.

Is it possible to estimate the s-domain transfer function without a priori information about the order of the polynomials in the numerator or denominator?

I am more or less looking for an out-of-the-box approach that estimates the transfer function in a sufficient way. Performance and computing time are not an issue.

Python and MATLAB (Signal Processing Toolbox, Control System Toolbox) are available.


texts: What is the reason for getting negative snr value when calculating Signal to noise ratio of speech signal using matlab function SNR()?


texts: Getting the power of a signal from its Fourier transform?

texts:
I have a non-periodic signal that contains the sinc function in the time domain and so it is a bit difficult to calculate its power (because of the integral) through:
$$ {P_x} = \lim_{T \to \infty} \frac{1}{T} \int_{-T/2}^{T/2} |x(t)|^2 dt $$
This is my signal: $x(t)=A\cos(\omega_1t)+B\,\textrm{sinc}(\omega_2t)$. I wonder whether one can calculate the power in the frequency domain, since (Rayleigh's Theorem):
$$ \int_{-\infty}^{\infty} |x(t)|^2 dt = \int_{-\infty}^{\infty} |X(f)|^2 df $$


texts: Measure similarity between quantized grayscale images

texts:
I want to measure the similarity between quantized grayscale images (8 levels) that mostly depict organic patterns found in nature, say pigmentation patterns in animals (zebra pattern, leopard spots,..). I cannot use some kind of trained model, and I need a continuous similarity value. Feature scale tolerance is not important, but differences in rotation and density of the features could be large. Ideally two different flat textures of zebra patterns should have a similarity of 1.0 and say zebra-tiger a similarity of 0.7. I understand how impossible that sounds, but I hope someone could point me to relevant current research or methods somewhat suitable to what I'm looking for.

EDIT: More info about the desired usage.

Examples of images undergone grayscale conversion and quantization:
(512x512 pixels, 8 gray levels). I do not own these images.

These are then used as templates for a procedural pattern generation technique I am developing. Images are randomly generated, generation settings that produce high similarity are kept to be further tweaked. The procedurally generated images could be anything from random pixels to intricate shapes, slowly converging at the image of highest possible similarity.


texts: Can anyone suggest good algorithms for CBIR?

texts:
Project: Content Based Image Retrieval - Semi-supervised (manual tagging is done on images while training)

Description

I have 1000000 images in the database. The training is manual (supervised) - title and tags are provided for each image. Example: coke.jpg Title : Coke Tags : Coke, Can

Using the images and tags, I have to train the system. After training, when I give a new image (already in database/ completely new) the system should output the possible tags the image may belong to and display few images belonging to each tag. The system may also say no match found.

Questions:

1) What is mean by image fingerprint? What is the image fingerprint size expected ? (important because there will be millions of images to be inserted in database)

2) What is the field format of that fingerprint in the database ? (important because a fast search is needed … script should search in a 1M images database in less than 1 second)

3) What is the descriptors (algorithms) we use to analyze them ?

Thanks in advance


texts:
Problem statement
I am starting a project soon where I need to create a method to automatically create landmarks on a set of images of human hands. I do not have a sample image but the images are taken with the same background and stable lightning conditions. The images probably look similar to this one, (but should be the other side of the hand).

My colleagues have defined some landmarks, but I would like to first just detect the tips of the fingers and the inner most part between the fingers. I was looking into potential solutions and active shape or active appearance models look like a good idea, although they might also be an overkill. I was also thinking about just creating a template of a hand with landmarks, segmenting the hand with foreground/background segmentation (probably thresholding, PCA or even MRFs if the others fail a lot), and then do an affine + non-rigid registration to transfer the landmarks.
What I am asking is:

Are the methods that I mention for solving this task appropriate?
Is there any solution out there that already solves this problem?
Referrals to code to do some of this is appreciated.
Do you have other better suited ideas to solve this problem?

Note
I am going to play around with the images in this dataset, which already have lots of annotated landmarks.
I'm new
Yes, this is my first post, so if you have ideas for other tags to include let me know. Also if you need further clarifications, don't hesitate to ask!


texts: Difference between applying a window to a whole signal and frames.

texts:
I'm going to do feature extraction using a speech signal.

The first step is the windowing of the signal using Hamming window.

I'd like to know if I should apply one single window to the whole signal or if I should apply several windows to different frames of the signal?

What are the differences between them?

Thank you.


texts: How to calculate the time delay of a signal by a first-order filter

texts:
lets assume following signal
$$x=a_1 \sin(2\pi f_1 t) + a_2 \sin(2\pi f_2 t).$$
This is passed through a simple single-pole filter with cut-off frequency $f_c$. How is $x$ delayed by the filter (peak of the cross-correlation)?

In the case $a_2=0$, the time delay between the original and the filtered frequency is
$$T_1=\arctan(f_1/f_c)/(2\pi f_1).$$

In the case $a_1=0$, the time delay between the original and the filtered frequency is
$$T_2=\arctan(f_2/f_c)/(2\pi f_2).$$

But how can we calculate the time delay $T_{12}$ in the case $a_1\neq0$ and $a_2\neq0$?

It is not the group delay: It must depend in some way on the values of $a_1$ and $a_2$, because if $a_1>>a_2$, then $T_{12}\approx T_1$.

Any light on this would be greatly appreciated!


texts: cancellation controller transfer function design

texts:
This chapter offers a free overview on cancellation controllers, https://link.springer.com/chapter/10.1007%2F978-3-662-02319-8_6
However, i did not get equation (6.4),  how the transfer function of $G_R$ is determined?


texts:
As I know, if we want to know the LTI system output, then we do convolution between input x[n] and impulse response h[n].
but actually,in this question, I want to know what does convolution has the behind meaning.

Why do we do convolution(sum of products) not just using adder or multiplier for calculation between input signal and impulse response?


texts: I have recently seen some code written in modelling tool like Simulink, ASCET which uses PT1 filter? Why do we use a pulse train filter? What is the difference between FIR, IIR, Chebyschev, Butterworth and a Pulse Train filter? When a signal continuous passes through a pulse train what happens?


texts: Correlation (or something similar) analysis between data with different sampling rates

texts:
I tried to do correlation analysis on the data with different sampling rates.

For example, I have two sensors, A and B. Each sensor collects data with different sampling rates, e.g., A: 10Hz, B: 1Hz.

I turned on and off these two sensors at the same time, and collect data for 2 minutes.

Then, sensor A will give 1200 samples of data, and sensor B will give 120 samples.

I want to know the relation of these two data samples, like the values or trends from sensor A and sensor B are very similar.

Correlation may be one method to show such a relation, but how can I do correlation analysis in case of different sampling rates between two data?


texts: How to generate the coefficients of an itu-r 2k filter when all I know is my 0 dB point is at 2 kHz and my maximum of 6 dB is at 7 kHz


texts: FFT- based frequency offset estimation algorithm

texts:
I am trying to understand and implement FFT based recovery algorithm suggested me in the post and it was also discussed here
Let assume rx_signal -signal at the receiver'input with frequency offset. according to the posts i do the following steps in matlab:
% fft

fft_rx = fft(rx_signal)

% [peak p] = max(abs(fft_rx))

I don't understand what my next step is?


texts: Is there an equivalent of Parseval's theorem for wavelets?

texts:
Parseval's theorem can be interpreted as:

  ... the total energy of a signal can be calculated by summing power-per-sample across time or spectral power across frequency.

For the case of a signal $x(t)$ and its Fourier transform $X(\omega)$, the theorem says:

$$
\int{|x(t)|^2 \; dt} = \int{|X(\omega)|^2 \; d\omega}
$$

For the case of discrete wavelet transform (DWT), or wavelet packet decomposition (WPD), we get a 2D array of coefficients along the time and frequency (or scale) axis:

        |
        | c{1,f}
        | ...
freq    | c{1,2}
        | c{1,1} c{2, 1} ... c{t, 1}
        |______________________________
                 time

Can a sum of this series somehow be understood as a signal's energy? Is there an equivalent rule to Parseval's theorem?


texts: Check the stability of the system, $y[n]=u[n]$

texts:
How do I check the following system
$$
y[n]=u[n]
$$
is BIBO stable or not ?

$u[n]$ is the unit step function

My Attempt:

For the BIBO stability, the necessary and sufficient condition is $$\sum_{n=-\infty}^{+\infty} |h[n]|<\infty$$.

Let $x[n]=\delta[n]$, so $y[n]=h[n]=u[n]$
$$
\sum_{n=-\infty}^{+\infty} |h[n]|<\infty=\sum_{n=0}^{+\infty} |u[n]|=1+1+1+......=\infty
$$

which proves it is an unstable system. Is it the right way to approach the problem or do I need to first write $u[n]$ in terms of the delta function ?


texts: How to compute camera pose from Homography matrix?

texts:
Say I use only one calibrated camera. From this camera, I get images A and B. I know the homography between A and B, computed through OpenCV's findHomography().
I know the pose (rotation matrix R and translation vector t) of image A, and I need the pose of image B. Once I get it, I suppose I'll be able to compute every further poses of following images.
Do you know an implementation of computing B's pose? I found several articles on the web, but I couldn't find an easily implementable solution...

I found a nice implementation, using OpenCV: http://nghiaho.com/?p=1298


texts: Real time slope and peak detection and calculation

texts:
I have a signal that I sample at 500khz. I am trying to detect a rise, fall and the peak in the incoming data. The base of the peak could be  for 250 usec or 2.5msec, amplitude could be 6db or 15db above the noise floor. I don't have good snr unfortunately.  The dc level of the signal is not constant but move much more slower  than the ac component.

At the decision point, I need to know the slope of the rise and fall. This is a hard realtime system and I really need to make a decision in the 100usec after the downward slope reach to dc level.

I am looking for suggestions how can I efficiently implement an algorithm that is decent.

Currently I do a running average (past 25 data points added together) and try to detect the trend. Once I detect the trend up I start seeking trend down and once I do that I collect perhaps another 50 samples and start calculating.

Noise now easily screws this algorithm, hence the question.

UPdate

For the benefit of others, I have end up implementing a Moving Average followed by integrator. Moving average of past 64 data smoothed enough but lost rise to a degree, integrating last 8 values gained back the rise and I simply seek for rise and fall, later I did a linear regression for the slope. Works ok, not great but ok.


texts:
Consider a noisy image g(x,y) formed by the addition of noise n(x,y)
  to an original image f(x,y); that is

g(x,y) = f(x,y) + n(x,y)

  where the assumption is that at every pair of coordinates (x,y) the noise is
  uncorrelated and has zero average value.

What does it mean for noise to be uncorrelated and have zero average value. I know the term uncorrelated for random variables, and mean of probability distribution function, but I can't understand these concept for images.

How can noise have zero expected value at every pair of coordinates (x,y), or be uncorrelated ?


texts:
I greatly appreciate the opportunity afforded by this forum to submit a query.

It has been suggested that for a sinusoidal input, represented as 2 phasors, into a Linear Shift-invariant system, the output...

...can also be written as follows:

where $$H(\Omega) = \int_{-\infty}^{\infty} h(\lambda) e^{-j\Omega\lambda} d\lambda$$

Accompanying brief comment suggests the above to be on account of "polar form representation of H".

Although I am cognizant of polar form representation of complex numbers i.e.

$$z = |z|(\cos(\theta)+i \sin(\theta)) = |z|e^{i \theta}$$

...I am completely unable to fathom the alternative above.

All advice would be greatly appreciated.

Best regards,

wirefree


texts:
I have a filter with the transfer function

$$H(z) = 1 - 2z^{-2} + z^{-4}.$$ The task is to find the phase function $\theta (\omega).$

My attempt is to start by expressing the frequency response
\begin{align}
H(\omega) &=H(z)\big\vert_{z=e^{j\omega}}\\
&= 1 - 2e^{-2j\omega} + e^{-4j\omega}\\
&=  e^{-2j\omega}( e^{2j\omega} - 2 + e^{-2j\omega})\\
&=  e^{-2j\omega}(2\cos(2\omega)-2)
\end{align}

I think there is a relation of the sort $$H(\omega) = e^{j\theta (\omega)}|H(\omega)|$$

which in my case would give me $$\theta (\omega) = -2\omega.$$

The correct answer is $$\theta (\omega) = -2\omega + \pi.$$ How do I get the extra term?


texts: Kalman filtering in image processing, resources?

texts:
I'm looking for a good resource (book, tutorial, lesson etc.) that explains the usage of Kalman filtering in image processing applications.

I'm aware of the fact that Kalman filtering is an optimal estimator which is a tool not a concept in image processing because of that I didn't find a book that explains the usage of Kalman filtering for real applications (from a technical perspective).

I use OpenCV (Matlab will be fine), so I prefer resources that handle image processing in OpenCV.


texts: stretch factor in SOLA time stretch methods

texts: I notice that in the general Synchronous Overlap and Add (SOLA) algorithm, we need to obtain the best overlapping start index using, for example, cross-correlation. But won't that start index change the desired stretch factor? After all, the factor is determined by Rs/Ra (Rs is the synthesis hop and Ra is the analysis hop).


texts: Should A/D resolution affect EEG signal properties and how?

texts:
I encounter a curious situation wherein the recording device of my EEG data appears to affect how many transients of definition "x" I find, especially strange since the amplitude criterion is relative (standard score instead of voltage).

One crucial difference is that the devices use different A/D resolution (12 vs. 22 bit) although they both encode the data in 16 bit (I already do not understand the difference between resolution and encoding, why both bit, but both different?).

To get to the point? How adjust for that difference? Also I excluded difference in sampling rate being crucial, because my current script adjusts for that based on two other devices I had to compare in the past, but which used the same A/D resolution...

Thank you dearly in advance!


texts: K-Fold Cross-Validation With Only a Low Identification Accuracy for the First Fold

texts:
I am using K-Fold cross validation from sklearn.model_selection for evaluating the performance of my model. K=10 and the K-fold cross-validation is set as:

kfcv=Kfold(n_splits=10, random_state=0, shuffle=True)

The result of the first fold is 70% while remaining 9 folds are 100%. I have set random state to another value (such as 50), the same problem.

Why is the high discrepancy only with the first fold? I have used 5 fold and the same problem with the first fold. I expect that other folds should also reflects a decrease since the division is random and I also set shuffle to be true.

Is there anything am doing wrongly? If not, what would be the likely explanation for this?

Thanks.


texts:
Is there an inherent connection between complex time domain signals and QAM?

Given a complex time-domain signal is it always implied that this is a QAM-demodulated form of a real time domain signal?

Are there any other commonly used ways of converting a real time domain signal to a complex time domain signal that don't imply QAM?


texts: Find output of digital filter given input and transfer function?

texts:
Hey guys so I have an input sequence that are real values that represent intensity of a column of an image. I also have the transfer function in the Z domain of a 2nd order high pass filter. I have the following transfer function using the bi-linear transform estimate.

Say my input signal is defined as x[n] = 27, 588, 1013, 255, 38. How can I determine the output y[n]?

There are two options, one being I determine X[z] then multiply it by H[z] and take the inverse transform.

The other being I transform H[z] into h[n] and then I convolve it with x[n] using the following scheme .

How would I implement either of these solutions in code (eg. coding an automatic way to generate X[z] from an arbitrary x[n] OR programming a convolution function that implements FOIL for the second option)?

Is one easier than the other? Keep in mind that my signal is 512 samples in length as well, so convolution may be very expensive.


texts: What is conceptually happening in this modulation function?

texts:
I know this is a programming question but i am trying to understand the logic of this. I have come across below function which is basically written in the groovy, which i think is BPSK modulation function.
private final int SAMPLES_PER_SYMBOL = 150
private final float NFREQ = 1/15

private float[] bytes2signal(byte[] buf) {
  float[] signal = new float[buf.length * 8 * SAMPLES_PER_SYMBOL * 2]   // 8 bits/byte, 2 floats/sample
  int p = 0
  for (int i = 0; i < buf.length; i++) {
    for (int j = 0; j < 8; j++) {         // Not sure what is the significant of this ?
      int bit = (buf[i] >> j) & 0x01      // Not sure what is the significant of this ?
      float f = bit == 1 ? -NFREQ : NFREQ
      for (int k = 0; k < SAMPLES_PER_SYMBOL; k++) {
        signal[p++] = (float)Math.cos(2 * Math.PI * f * k)
        signal[p++] = (float)Math.sin(2 * Math.PI * f * k)
      }
    }
  }
  return signal
}

My question is what is significant of this two lines?
 for (int j = 0; j < 8; j++) {         // Not sure what is the significant of this ?
    int bit = (buf[i] >> j) & 0x01     // Not sure what is the significant of this ?

Can someone please explain this to me ? What is logically happening with this buffer shifting by 8 bit and And-ing with 0x01. Below is the test function for iteration i=0
------------------------------------------------------------
i = 0
j = 0
1 >> 0 = 1
1 & 0x01 = 1
f = -0.06666666666666667
------------------------------
j = 1
1 >> 1 = 0
0 & 0x01 = 0
f = 0.06666666666666667
------------------------------
j = 2
1 >> 2 = 0
0 & 0x01 = 0
f = 0.06666666666666667
------------------------------
j = 3
1 >> 3 = 0
0 & 0x01 = 0
f = 0.06666666666666667
------------------------------
j = 4
1 >> 4 = 0
0 & 0x01 = 0
f = 0.06666666666666667
------------------------------
j = 5
1 >> 5 = 0
0 & 0x01 = 0
f = 0.06666666666666667
------------------------------
j = 6
1 >> 6 = 0
0 & 0x01 = 0
f = 0.06666666666666667
------------------------------
j = 7
1 >> 7 = 0
0 & 0x01 = 0
f = 0.06666666666666667
------------------------------
------------------------------------------------------------


texts:
Does anyone know of any resources that explain simply, these are the data objects and variable definitions involved when doing sound processing?

I took a class on image processing where we learned about various kernels and how to apply those to images, this process is very simple and clear as can be seen by the pencil and paper used in this video https://www.youtube.com/watch?v=ySAEWNk5Il4

Image processing is very straightforward to me. Two 2-d arrays of pixels, one kernel, this is how to apply the kernel to one 2-d array to get the resulting 2-d array. A kernel that looks like this will function like this. . .

Sound processing is either much more complicated or the people that understand it don't like pencils and paper.

Does anyone know of any resources that explain simply, these are the data objects and variable definitions involved when doing sound processing?

So far I've found a lot of python libraries and snippets of code with very convoluted variable names. Looking for something more psuedo-code and basic, preferably some pencil and paper examples.


texts: Lighting for computer vision automisation

texts:
Currently I am working on a computer vision project where we want to gather data from a composite material production environment.

I have an example picture here:

What I learned so far that my lighting is not good. It's coming from a fluorescent lamp from that's right above the camera. Apparently I would have to diffuse the light with some sort of material. The reflections of the light are not doing us well.

The red and blue tape was placed there as a test to see if I can segment the image, remove the rest of the image outside of the tape. So that way I can analyse the area inside the tape. I got that working by converting the image to 8 bit and drawing a thick black line and then make a bounding box around that. But with the tape it's not working, presumably due to the reflection. The best outcome would be that the tape is recognized as somewhere between values 0-10.

Basically what I did here:

How can I recreate this in the first image I showed?


texts: how can we align wto signals with a time lag in between?

texts:
I have two signals from two different sensors. I cropped the area i am interested in from both sensor signals. The problem is that the signals start at different time instants. I am searching for a way to align the signals just like below. It is technically just moving the blue signal to align with orange one. I tried using cross correlation but it gave a weird result. Any help please.
 first image:  this is the result of cross correlation of two signals
Second image :after applying code on cross correlation to align


texts: How to model the noise in Kalman Filter?

texts:
Background:

I am a newbie in DSP. I am implementing a simple Kalman Filter that estimates the heading direction of a robot. The robot is equipped with a compass and a gyroscope.

My Understanding:

I am thinking about representing my state as a 2D vector $(x, \dot{x})$, where $x$ is the current heading direction and  $\dot{x}$ is the rotation rate reported by the gyroscope.

Questions:

If my understanding is correct, there will be no control term, $u$ in my filter. Is it true? What if I take the state as a 1D vector $(x)$? Then does my $\dot{x}$becomes the control term $u$? Will these two methods yield different results?
As we know, the main noise source comes from the compass when the compass is in a distorted magnetic field. Here, I suppose the Gaussian noise is less significant. But the magnetic distortion is totally unpredictable. How do we model it in the Kalman Filter?
In Kalman Filter, is the assumption that "all the noises are white" necessary? Say, if my noise distribution is actually a Laplacian distribution, can I still use a Kalman Filter? Or I have to switch to another filter, like Extended Kalman Filter?


texts: Finding fundamental particles of sound In ASR systems?

texts:
Q1. Can we divide phonemes which are specific to a language into some more fundamental entities same across all languages ?

Q2. Will this help us in achieving language independent acoustic modelling ?

Q3. What are the challenges, If any in above technique ?

Q4. Is there any project using this stuff currently ?


texts: How to Combine / Fuse 2 Least Squares Estimates?

texts:
Say you want to compute the least squares estimate of $w$ from a data-set:
$$
\begin{bmatrix}d_1 \\d_2 \\\vdots\\d_N \end{bmatrix} =\begin{bmatrix} x_1 \\x_2 \\ \vdots \\x_N\end{bmatrix}w + \begin{bmatrix} q_1 \\q_2 \\ \vdots \\q_N\end{bmatrix}
$$
Note: $q$ is white noise.
This can be compactly written as
$$
\mathbf{d}= \mathbf{H}w + \mathbf{q}
$$
The least squares estimate of $w$ which I shall call $w^*$ is given by
\begin{align}
w^* =&  (\mathbf{H}^T\mathbf{H})^{-1}\mathbf{H}\mathbf{d}\\
   =  & \Big(\sum_{i =1} ^{N}x_i^2 \Big) ^{-1} \Big(\sum_{i =1} ^{N}x_id_i \Big)
\end{align}

The Problem:

I have $N/2$ of the sample and my friend has the other half of the data set. We compute the least squares estimate separately. How do we now combine our estimates of $w^*$ besides 'averaging' it?


texts: This is an expression for the computation of kurtosis.

texts: However, I don't understand what the subscript '4x' or the parameter (0,0) stand for. Could anyone explain ?


texts:
With regards to multirate processing, what are the benefits of having a 'slower' sampled signal?

Let's say I have a continuous signal

$$x(t) = \cos(2\pi\cdot3t) + \cos(2\pi\cdot 7t)$$

and it is sampled at $10\textrm{ kHz}$. Obviously the sample rate is overkill for the underlying signal. I've started reading into multirate processing, and it often states that the usefulness of resampling (decimation or interpolation) can come in the form of lower processing requirements.

What would be the benefits if we subsampled this $10\textrm{ kHz}$ sampled signal?
So my question:

How exactly do we save processing effort?
Is it simply due to the fact that we can subsample a discrete signal, obtain a new signal with lower time resolution (but still adequate frequency resolution and range), and then only have to perform operations on a smaller set of data?

Also, do the benefits of multirate processing differ depending on whether or not we're doing realtime or offline processing? It seems like in the case of real time processing, subsampling would allow you to use DSPs that operate at slower frequencies.

Please feel free to offer any insight to the topic!


texts:
I'd like to build a color difference metric that will be invariant to small changes in lighting conditions. In other words, I should be able to tell that a red shirt is not the same as a blue shirt, even if one image is lit differently (brighter / darker, outdoors / incandescent).

Moving to YUV space and ignoring the luminance component I can deal with changing brightness conditions by considering the metric:
$$d = \sqrt{\Delta U^2  + \Delta V^2}$$
But this metric still gives large "distances" when different light sources are used, due to the change in chrominance along the Planckian locus.

My question is:

Is there a color difference metric that is invariant to temperature differences? in a sense, I'm looking for a color space in which one of the three axes is temperature. Does such a space exist?


texts: (How to ask a Homework Question): Define poles by using proportional controller

texts:
Given is a process with the transfer function

$$G(s) = \frac{s - 1}{s^2 + 3s + 2}$$

I want to create a controller so that the poles of the controlled system are

$$p_{1,2} = -4 \pm i$$

Is it possible to do this using a proportional controller?

I already calculated the transfer function of the closed loop system, which is:

$$G_1(s) = \frac{k \cdot (s-1)}{(s+1) \cdot (s+2) + k \cdot (s-1)}$$

Then I tried to figure out whether there exists a value for k which leads to the wanted poles and saw that there exists no such value, so my answer would be that it is not possible to use a proportional controller. Please correct me if my solution is wrong.


texts:
Is $x(t) = \cos t + \sin\left(\frac{1}{2}t\right)$ a periodic signal?

The answer provided by the book is different from my answer. Book says its not a periodic signal. Can you guys tell me why is it not a periodic signal?

My answer:

  $\cos(t)$ is periodic as $2\pi f_1 = 1 \Rightarrow f_1=\frac{1}{2\pi} \Rightarrow T_1=2\pi$

  $\sin\left(\frac{1}{2}t\right)$ is also periodic as $2\pi f_2 = \frac{1}{2} \Rightarrow f_2=\frac{1}{4\pi} \Rightarrow T_2=4\pi$

  Therefore $\frac{T_1}{T_2} =  \frac{2\pi}{4\pi} = \frac{1}{2}$  is rational number

  Therefore the given $x(t)$ is a periodic signal.


texts: How can I break a filter down into second order sections?

texts:
This is a follow-up question of How do I apply a Chebishev filter? I designed a filter in Scipy:

import scipy.signal as signal
fs = 240
signal.cheby1(8, 0.05, [0.1/(fs/2), 10.0/(fs/2)],btype='band', analog=0, output='ba')
/usr/lib/python2.7/dist-packages/scipy/signal/filter_design.py:268: BadCoefficients: Badly conditioned filter coefficients (numerator): the results may be meaningless
  "results may be meaningless", BadCoefficients)
(array([ -3.64482771e-08,  -3.98755170e-23,   1.27568970e-07,
     3.98755170e-23,  -2.55137939e-07,  -2.09346464e-22,
     3.18922424e-07,   1.48536301e-21,  -2.55137939e-07,
    -2.79128619e-22,   1.27568970e-07,  -3.98755170e-23,
    -3.64482771e-08,   0.00000000e+00,   4.55603463e-09]),
array([  1.00000000e+00,  -1.53699059e+01,   1.10865293e+02,
    -4.98175837e+02,   1.56087517e+03,  -3.61582779e+03,
     6.40630344e+03,  -8.85525782e+03,   9.65121227e+03,
    -8.32140081e+03,   5.65721533e+03,  -3.00062986e+03,
     1.21729735e+03,  -3.65135628e+02,   7.63720484e+01,
    -9.95191544e+00,   6.08648759e-01]))

The first array should contain the b coefficients, the second array should contain the b coefficients of the filter.

The result of this filter is oscillating and seems to be wrong. Hilmar wrote that this filter "is a numerically challenging filter, since you have poles very very close to the unit circle" and I must "break the filter down into second order sections and apply those sequentially".

Since I have no background in signal processing and found nothing about that anywhere I wanted to ask here how I can do that.

edit: The zero-pole-gain ('zpk') representation is

signal.cheby1(8, 0.05, [0.1/(fs/2), 10.0/(fs/2)],btype='band', analog=0, output='zpk')
/usr/lib/python2.7/dist-packages/scipy/signal/filter_design.py:268: BadCoefficients: Badly conditioned filter coefficients (numerator): the results may be meaningless
"results may be meaningless", BadCoefficients)
(array([ 0.95041122+0.63504447j,  0.95041122-0.63504447j,
    0.77688699+0.32179713j,  0.77688699-0.32179713j,
    0.72152481+0.14352021j,  0.72152481-0.14352021j,
    0.70710678+0.j        , -0.95041122+0.63504447j,
   -0.95041122-0.63504447j, -0.77688699+0.32179713j,
   -0.77688699-0.32179713j, -0.72152481+0.14352021j,
   -0.72152481-0.14352021j, -0.70710678+0.j        ]), array([ 1.19049737+0.j        ,  1.16303520+0.1084667j ,
    1.16303520-0.1084667j ,  1.08874047+0.19530989j,
    1.08874047-0.19530989j,  0.99220878+0.25677213j,
    0.99220878-0.25677213j,  0.93226615+0.2765259j ,
    0.93226615-0.2765259j ,  0.87852354+0.22994371j,
    0.87852354-0.22994371j,  0.83333317+0.15993377j,
    0.83333317-0.15993377j,  0.80434290+0.08130729j,
    0.80434290-0.08130729j,  0.79450811+0.j        ]), -3.6448277062436296e-08)


texts: How to select the sign of the square root of each element of a DFT in obtaining the square root of a polynomial?

texts:
I want to find the square root of a polynomial by the following process:

Compute the N-element DFT of its coefficients, maybe padded with zeros.
Compute the complex square root of each of the N elements of the DFT.
Take the inverse DFT of the resulting array.

For the time being, I am assuming that the polynomial is a perfect square, so that it will have a polynomial as its square root.  I have checked that the foregoing process works fine in some cases.

My problem is that there are two choices (+/-) for each of the N square roots.  Only if I make correct choices will I get the correct phase spectrum so that the IDFT will give me the correct polynomial as solution.

How can I correctly choose the sign of each square root, other than (for example) by working through the 2^N possibilities until I find one that gives a polynomial as the result?

I have tried making use of the fact that the DFT should be 'smooth' if N is large relative to the order of the polynomial, but without getting anywhere.

[An example: if the polynomial has coefficients (1,2,3,4,3,2,1), its square root polynomial will have coefficients (1,1,1,1)]

Added

(1) I wonder if the problem can be solved by something analogous to the spectral factorization method used to find a minimum phase signal having a given autocorrelation function?

(2) The square root of a polynomial can be found without using the DFT, by long division. Algorithm for finding the square root of a polynomial…


texts:
I was watching a
video
in time 24:48
I would like to know where you got the value

.9 (1.14z + .941) and 1.0232 + .757

Does anyone explain how he got those numbers?


texts: What is the maximum dynamic range of an N bit signal?

texts:
In this presentation on slide 15 there is a corollary:

  Rule of thumb: the dark noise must be larger than 0.5

  Corollary: With a N bit digital signal you can deliver no more*) than
  N+1 bit dynamic range.

  *) You can if you use loss-less compression

They give an example:

  Example : A 102f camera with 11 bit dynamic range will deliver only 9
  bit in Mono8 mode. Use Mono16!

Why N+1?
How can an 8 bit signal deliver 9 bit dynamic range?


texts: Cyclic prefix vs. guard interval. Why use one over the other?

texts:
I'm currently studying some OFDM techniques, and have found that in order to avoid Inter-Symbol Interference (ISI), there needs to be some space in between symbols. Lets assume this length to be $\mu$. This can either be done by adding a cyclic prefix to the beginning of the OFDM symbol, or by adding a simple guard interval (no transmission).

It seems to me like a cyclic prefix is typically used, but I'm not sure why this is used over a guard interval. using a guard interval would save power, and since the first $\mu$ points of the received signal will be ignored anyways, wouldn't it be better to save power? I'm not sure what the advantages of using a cyclic prefix are. Thanks for any insight!


texts: Understanding 2D FFT result of an image having a pattern

texts:
I have created Fast Fourier Transform (FFT 2D) of the following image (without pattern angle markers) using ejectamenta online tool.

Input (Original image is here)

Output I got is the following

As well as input pattern 66 deg gives output with 48 deg maximum magnitude line. (angles are measured approximately). But I believe Fourier pattern should be perpendicular to the input image pattern. But it has a difference. How this happens and what is the problem here. Could someone please explain? I'm trying to derive pattern direction using it's FFT result. Thank you.


texts: Downsampling and filtering (convolution)

texts: I have a discrete $2N$length signal $y[n]$ which I want to downsample by a factor of $F=2$. In order to avoid aliasing (since I assume that my original sampling rate is exactly equal to $2f_{max}$,i.e., there is no oversampling) I use anti-aliasing filter before downsampling. Filtering corresponds to convolution in time domain,i.e., $\bar{y}[n]=y[n]\star g[n]$. Since convolution changes the size of input signal what should be the size of my filter $g[n]$ in order to get in the end downsampled signal whose length is a twice the length of $y[n]$, i.e., $\frac{2N}{2}=N$. In other words it is possible that signal length stays the same after filtering?


texts: Understanding PSD: Why Does Power at High Frequencies Affect Low Frequencies?

texts:
I'm trying to wrap my head around power spectral density on a conceptual level, but I am having some difficulty. Suppose I have a communication system where I am receiving and sampling white Gaussian noise, which has a uniform PSD. Increasing the bandwidth of my receiver results in greater noise power across all frequency components. I can follow the math of how this occurs: integrate the PSD across more frequencies and you will increase the total power, which is uniform for white noise. However, how does it conceptually make sense that letting in higher frequency power components directly increases the power of the low frequency components?

EDIT: Some commentators have pointed out that my question was worded poorly. I apologize. I will try to clarify what I mean by turning it into a concrete thought experiment. Suppose I have a LPF with bandwidth $B_1$. Then, the variance of the DC component in the DFT domain after sampling WGN will be some $\sigma_1^2$. Now, compare that with a wider LPF with bandwidth $B_2$, where $B_2 > B_1$. Then the DC component variance would be greater, $\sigma_2^2  > \sigma_1^2$. Now, what if instead I implemented this second LPF filter a different way, with a parallelized structure: the sum of 2 different filter paths. The first filter path is the LPF with bandwidth $B_1$ and the second is a bandpass filter with passband $[B_1, B_2]$. This is followed by sampling. This is an equivalent structure to the LPF with bandwidth $B_2$, so the output statistics should be the same. However, notice that the second path is DC blocking, so it will never have a DC component. This should mean that the variance of the DC of the sum of the paths is equal to just the variance of LPF path, $\sigma_1^2$. But clearly, despite this being an equivalent filter structure, the output statistics are not the same. Why?


texts: Nyquist Frquency isn't what it is supposed to be

texts:
I am new here and also am not very knowledgeable about DSP so this might be dumb and easy. I am aware of the fact that in order to reconstruct a signal, I need to sample it at a frequency that is more than twice its highest frquency.

In the example below, I use N=50 samples and expect the reconstruction to fail if I use freq = 25 or so (perhaps due to numerical round-off). But I get that the reconstruction breaks around freq = 12.5. I feel I am missing something fundamental.

Here are plots and the code to generate them:

from numpy.fft import rfft as rfft
from numpy.fft import irfft as irfft
import numpy as np
import matplotlib.pyplot as plt
import math

def interpolant( f_hat, pts ):
    '''
    This is the trigonometric polynomial interpolating
    the signal that is encoded in the values of f_hat.
    it is evaluated at the points pts

    The commented part is the true calculation to be done,
    the uncommented just does it more accurately.
    '''
    N = len( f_hat )
    f = f_hat[0]
    for k in range( 1, N/2 ):
        f = f + 2 * f_hat[k].real * np.cos( k * pts )
        f = f - 2 * f_hat[k].imag * np.sin( k * pts )
        #f = f + f_hat[k]             * np.exp( 1j * k * pts )
        #f = f + f_hat[k].conjugate() * np.exp(-1j * k * pts )
    f = f + f_hat[N/2] * np.cos( N/2 * pts )
    return f / N / 2

def f( pts, freq ):
    '''
    this is "the conitinuous" signal, evaluated (sampled)
    at pts
    '''
    return  np.sin( freq * pts )

# Number of sampled points
N = 50

# Where we sample the signal
pts = np.linspace(0, 2 * np.pi, num = N, endpoint = False )

# A much finer grid, used solely to display results
oversampled = np.linspace( 0, 2 * np.pi, 20 * N, endpoint = False )

# The grid we use for the plotting
grid = oversampled

# The frequncy of the sine wave below
freq = 7

# Do the FFT on the sampled signal
f_hat = rfft( f( pts, freq ) )

plt.plot( grid, interpolant( f_hat, grid )  , color = "g" )
plt.plot( grid, f( grid, freq )      , color = "r" )
title1 = str(N) + " samples. Signal frequency is " + str(freq)+" \n"
title2 = "Red is true, green is interpolant. Reconstruction succeeds"
plt.title( title1 + title2 )
plt.show()

# The frequncy of the sine wave below
freq = 12.9

# Do the FFT on the sampled signal
f_hat = rfft( f( pts, freq ) )

plt.plot( grid, interpolant( f_hat, grid )  , color = "g" )
plt.plot( grid, f( grid, freq )      , color = "r" )
title1 = str(N) + " samples. Signal frequency is " + str(freq)+" \n"
title2 = "Red is true, green interpolant. Reconstruction fails"
plt.title( title1 + title2 )
plt.show()


texts:
Can anybody suggest me the highest speed DSPs available in the market now.
Also, what would be the best for a filer design application a DSP or an FPGA?


texts: These two images are very similar. Why doesn't SSIM reflect that?

texts:
Here are two aligned images (greyscale, but same applies to RGB) that I want to compare using SSIM:

Clearly, these are very similar images. It seems that the first image is more blur rr However, the SSIM is only 0.52. I would expect it to be higher. Is SSIM not a good metric for measuring similarity in this case? Why is this the case?


texts: s-Domin or z-Domain - What to Use for Mixed systems

texts:
I recently had to deal with a power electronic system where I had to implement a dynamic model of a power converter in order to design a suitable controller for that converter. The control will be implemented on a DSP which reads in the digitize values (voltages and currents) from some ADCs. The plant itself consists of a PWM modulator and a 4th-order LC filter. Since ADCs and control are digital systems, I can describe them using the z-transform, whereas the LC filter is an analog system which I usually describe using the Laplace-transform.

The question which now arises for me is: should I discretize the time continuous transfer functions of the filter and work out the whole system dynamics using z-transform, or do I describe the digital controller in s-domain and describe the whole system as a time continuous system?

During my studies I always worked with Laplace transform. I heard that there is z-transform too, but I never really worked with it. This was usually working fine, however, in most of the papers I find the authors are using z-transform and I don't really know when I should use one or the other for mixed systems. As far as I know, it doesn't really play a role in which domain I work as long as the frequencies I'm concerned about are "low enough" compared to the sampling frequency of the system. Is this true?

Another problem I face: when I'm working with these dynamic models in s-domain in matlab and let the program calculate transfer functions, the models which result exhibit insanely high orders (e.g. order 100 for a system which should have order 7). I know that this is numerical issues and that most of those system poles are cancelled out by zeros laying extremely close to the poles. There is a matlab command ("minreal") which eliminates some of those pole-zero combinations but not all. Could I reduce this issue by switching into z-domain? If not: how trustworthy is the "minreal" command? Do I risk loosing important information if I apply this command on every transfer function?


texts: DAPSK bit assignment for the amplitude difference

texts:
I am studying DAPSK(Differential amplitude phase shift keying) at the moment. I have a 64-DAPSK. We are using 4 concentric rings and 6 bits per symbol. The first two bits contain the information of amplitude difference and the rest contain the information of the phase difference. I am having trouble understanding how the table on the bottom left of this example is filled out:

[]


texts: 2D IIR filter design (x-axis width proportional to y-axis)

texts:
I want to design a 2D IIR filter (that is, created line-by-line progressively, in this case from left-to-right).  What is the best way to go about this?

I would like the response to look something vaguely like this:

The actual shape in the x-axis (time) isn't important - what's important is that the response's width for the x-axis is proportional to the y-axis position.

Any ideas?


texts: What is the algorithm to do frequency modulation?

texts:
I'm familiar with audio synthesis, oscillators etc. I'm now trying to implement my own software algorithm to do FM as described by https://en.wikipedia.org/wiki/Frequency_modulation.

What I have implemented outputs the following (spectrogram produced with sox):

This was produced by my algorithm set with a property of:
A 1200hz sine wave modulated by a 12hz sine wave.

However, I don't think this is actually 'correct' in what FM should do. I'm assuming I would see a 'signal' increasing and decreasing in frequency.

Is this correct? Or am I doing something wrong?

The way I am calculating the amplitude for each time point (code is written in Haskell):

fmSine :: Frequency -> Signal' -> Signal'
fmSine (Frequency hz) (Signal sng) = Signal (\t -> sin ( (sng t) + (hz* 2 * pi * t)))

Essentially I'm doing sin ((amplitudeOfModulationFrequency t) + hz * 2pi * t)
Where hz is the frequency and amplitudeOfModulationFrequency t is the amplitude at time t of the modulating frequency.


texts:
definations

$x(t)$ is a function of time. Physically, it can be voltage, displacement, magnetization and so on. It can be real, complex, vectors or more fancy numbers.

$C(t)$ is the auto correlation function of $x(t)$ , defined as:

$$ C(t)=\langle x(t) x^*(0) \rangle := \lim_{T\rightarrow \infty}\frac{1}{T}\int_0^T x(t'+t) x^*(t') dt' \tag{1} $$

$I(\omega)$ is the spectrum of $x(t)$, it is the  Fourier transformation of $C(t)$, or it is the square  of Fourier transformation of $x(t)$. These two definition are equivalent  (apply convolution theorem):
$$ I(\omega)= \int_{-\infty}^{+\infty} C(t) e^{-i\omega t} dt \tag{2} $$

$$
I(\omega)=
\begin{vmatrix}
\int_{-\infty}^{+\infty} x(t) e^{-i\omega t} dt
\end{vmatrix}^2 \tag{3} $$

non-negativity of $I(\omega)$

We can show that, spectrum is non-negative:
$$
I(\omega)=
\begin{vmatrix}
\int_{-\infty}^{+\infty} x(t) e^{-i\omega t} dt
\end{vmatrix}^2 \geqslant  0
$$
And physically it makes sense, because $I(\omega)$ means the energy density within frequency range  $[\omega , \omega+d\omega) $.

Energy density shouldn't be negative.

Question (1): what function $C(t)$ makes its Fourier transform $I(\omega)$ non-negative?

In practice, definition equation (2) is used rather than equation (3).

$C(t)$ is the inverse Fourier tranform of non-negative function $I(\omega)$.

I know some basic law like this:
$$
\text{FT}[real,even]=real, even
$$
$$
\text{FT}[real,odd]=imag, odd
$$

I have no idea what should $C(t)$ be?
$$
\text{FT}[???]=real, non \ negative
$$
Understand the function class of $C(t)$ might help us solve Question (2), because later on, you will see, I'm doing a transformation to $C(t)$ (essentially it's a discretization), then perform Fourier transform. This discretization transformation might take $C(t)$ out of that class, therefore makes $I(\omega)$ no longer non-negative.

subtlety in numerics: $I(\omega)$ is no longer non-negative!

In numerical calculations, things become finite and discrete.

Equation (2) is modified to its numeric version:

$$
\int \xrightarrow{\text{numerics }} \sum
$$
$$
\qquad \quad t \xrightarrow{\text{numerics }} t_i \quad i=0,1,2,\cdots,L
$$

$$
\qquad \quad \omega \xrightarrow{\text{numerics }} \omega_n \quad n=0,1,2,\cdots,L
$$
Or, an alternate way to understand numerics is to keep the continues integration, but sample the function $C(t)$ discretely and finitely:
$$
C(t) \xrightarrow{numerics} C(t) \times \sum_{i=0}^{L-1} \delta(t-t_i)
$$

Under this change, $I(\omega)$ is no longer non-negative.

I did some experiments, those negative value of $I(\omega)$ can be as large as 10% of the positive peak value of $I(\omega)$. Adding window function makes things better, but still have 0.1% negative spectrum density.

Only in some commensurate case, $I(\omega)$ is non-negative.

Question (2): is there any natural way to make $I(\omega)$ non-negative, in numerics?

I find adding absolute value might help
$$I(\omega)\rightarrow |I(\omega)|$$
but don't see any reason, such as conservation of energy, so on

So, is there a natural way, to generate non-negative spectrum density, in numerics?


texts: Does receiver always know about the noise level in real world application?

texts:
In many research articles, the effect of measurement noise on estimation performance is often reported. But it is not clear to me what is the proper way of using the signal to noise ratio (SNR). For example, the variance of measurement noise which is assumed to be Additive White Gaussian Noise( AWGN) is varied to obtain different SNRs. Then for each SNR the mean square error (MSE) between the parameter estimates and the known parameters are calculated. When SNR is high, it means that the amount of noise is less.

The following code in Matlab is based on my understanding that SNR is defined after the input to a system is passed and we get the output from the system, then we add noise for a particular SNR. Also, please correct me if I have put any incorrect information. Thank you.

In the code, I first generate some data $x$ consisting of $N=100$ data points. Then I have randomly generated 3 coefficients representing the impulse response of an FIR system. The data $x$ is passed through the FIR system to obtain $y$. I then add AWGN of SNR = 40dB.

Question1: My question is which step of the estimation stage is the SNR defined?  Can somebody please confirm if this is the correct approach or not?

Question2: If SNR = 40dB, how does one know the variance of the noise at the receiver end? In practice (in industry application) does the receiver end always know about the level of SNR and the variance of the noise?

N=100;
x = randn(1,N); %generating random data
h = rand(1,3); %some unknown parameters representing impulse response
y=filter(h,1,x); %FIR filter
z = awgn(y,40,'measured'); % adding AWGN measurement noise at SNR = 40dB
%Run some estimation method to estimate h_hat


texts:
I'm working on extracting the phase information in a given signal in MATLAB. I've the following vector;
signal = [exp(1i*10) exp(1i*100) exp(1i*1000) exp(1i*10000)];

When I use angle function in MATLAB to calculate the phase value, it returns the following result.
angle(signal) = -2.5664   -0.5310    0.9735   -2.8310

I want to calculate the original phase values, as follows,
  [10 100 1000 10000];

How to find the original phase values above interval [-π,π] in MATLAB?


texts: SNR relation with modulation index and noise power

texts:
What is the relation between the AM modulation index and the SNR? (I plotted this and it came as the shape of the exponential graph)

Also what is the relation between the channel noise power and the SNR?
I plotted this and  I got the shape as this graph:

(ignore the labels of the axis)


texts: How is non-integer upres downres (1080p game on a 1440p screen etc) calculated

texts:
Please redirect me if this is not the right place to ask.
I was unable to find a straightforward answer to this question. What I am wondering is, if I am playing a 1080p game on a 1440p display, what values will be actually displayed on the screen?
A very simplistic solution would be some form of interpolation, like bicubic. Seems reasonable enough, but is it actually what they do? What if I am playing a 1080p game on a 2160p screen (factor of 2)? Is there any significant difference between integer and non-integer scaling factors?
What if I am forcing the game to render more pixels than the display can show, which some games allow (run the game at 1440p but connect a 1080p display). You can set the render scale to 133%. If you do something like this, the rendered image will have more pixels and more fidelity, but almost none of them will have a 1:1 correspondence to the display. You could still interpolate the 1080p pixel values based on a 1440p rendered image, but intuitively, this seems like a huge disadvantage, but when you do this in practice, the image indeed looks better than when you have 100% render scale where every displayed pixel has a 1:1 correspondence to the rendered image.
If I rendered 2160p and displayed this on a 1080p screen, you could average every 2x2 pixels and display it on a single pixel, this seems simple enough, but is it actually what is done or is it indeed optimal?
Essentially I am asking if there is any genius trick to upresing and downresing images
Another heuristic question: Which would look better? A native 1080p 27" screen displaying a 1080p game, or a 1440p 27" screen displaying a 1080p game? Surely the native 1080p screen must look better? But by how much?


texts: Effect of Sampling frequency on RMS estimation

texts:
I have a simple, but interesting question for you.
I have to compute the RMS (root mean square or standard deviation) value of a time signal which represents in my case a velocity mesasurement over time, of course sampled an stored in a computer. In your opinion, does the sampling frequency have a strong impact on the RMS value or it is just the TOTAL number of samples that matters the most?
Can you please, if possible, refer to some books where this topic is dealt with?

Thanks a lot, I'm looking forward to reading your answers.

Bye

E.


texts: Achievable rate for MIMO channel with estimated channel matrix

texts:
In a MIMO system, if the receiver has perfect CSI, i.e. knows that channel matrix $\boldsymbol{H}$, then the achievable rate is:
$$ R = \log \left|\boldsymbol{I}+\frac{P}{N_RN_T}\boldsymbol{H}\boldsymbol{H}^H\right|\tag1$$
where $P$ is the transmit power and $N_R,N_T$ the number of receive and transmit antennas respectively.
What happens if I don't know the channel, but estimate it?
Will it simply be
$$ R = \log \left|\boldsymbol{I}+\frac{P}{N_RN_T}\boldsymbol{H}\hat{\boldsymbol{H}}^H\right|\tag2$$
where $\hat{\boldsymbol{H}}$ is the channel estimate?

I'm interested specifically in LMMSE estimation (and Gaussian channel).


texts:
I am approaching to the Oxford Buildings dataset which contains already computed SIFT descriptors from affine detected keypoint locations.

Usually SIFT detector provides to its detected keypoints with scale and orientation information.

In the case of affine keypoints is clear that they don't have a single scale parameter but three corresponding to the ellipse (the affine covariant region) they belong to, but what about orientation, do they have any? if not can I say it is zero?


texts: How to get coefficient of the discrete fourier Series from the fourier transform

texts: Given $X(v)$ the Discrete Fourier transform of a discrete periodic signal $x(n)$, it's possible to arrive to the $c_k$ of the Fourier series $$x(n)=\sum_{k=0}^{n-1} c_k \exp(2\pi i k t) $$  directly?


texts: Discrete time aperiodic signal: Concept of frequency?

texts:
Is concept of frequency to a-periodic signal whether it is continuous or discrete time is valid?

I am bit confused, since discrete time sinusoids have frequency $-\pi<\omega<\pi$ or $-\frac{1}{2}<f<\frac{1}{2}$, how can I relate these to discrete time a-periodic signals?

Also how is this relation $f=\frac{F}{F_s}$ applied to a-periodic signals?


texts:
For my source code witten in c ,in visual dsp++ 5.0 for a forward error correcting code on adsp 21062 sharc family platform. i want to plot a graph between different data sets. when i tried to use the plot window, it is showing the data sets which are in assembly.so how to plot a graph between the input and output in the tool?please help me out.

phani tej


texts: Difference between diversity gain and coding gain

texts:
I am reading about space-time codes. They break down further into 2 sub categories called space-time trellis codes and space-time block codes. It says that trellis codes offer both diversity and coding gain. However, block codes only offer diversity gain. I don't quite understand this.

I understand the general forms of diversity gains such as time, frequency, site, etc. However, how exactly is space-time codes different from space-diversity or even MIMO?

Further more, what exactly is the criteria for coding gain? My intuition is that if we are actually decoding the original message which was encoded using parity bits, etc, then this is coding gain. This confusion carries over when I am trying to understand the distinctions between trellis and block codes.


texts:
In ZP-OFDM, The convolution is linear. it's different from CP-OFDM which is circular convolution leading to have one tap equalizer in frequency domain.
if I have a ZP-OFDM system, and we have a signal to transmit $X$ of length $M$ x $1$, after adding the zero padding, the resultant transmitted signal will be  $x$ of length $N$ x $1$.  where the received signal is:
$y = h*x + v$, where $h$,$x$,$v$,$*$ denote multi-path channel of length $L$ x $1$, transmitted signal of length $N$x$1$, AWGN, and convolution operation,  respectively.
to recover the transmitted signal from the received signal $y$, let the matrix $G$ to be the MMSE equalizer built based on the toeplitz matrix $H$ equivalent to $h$. so estimated signal $x$ = $Gy$.
The question which I couldn't get a clear answer for it, Is it better to built the matrix $G$ of size $M$x$N$ and multiply it directly with $y$ which is $N$x$1$,  resulting the transmitted signal of size $M$x$1$. OR, I start discard the part equivalent to the zero padding from $y$ to have the length of $M$x$1$ and then build the matrix $G$ of size $M$x$M$ to be multiplied with $y$ after removing the part equivalent into the zero padding?
In simulation, the first option gives slightly better performance and more stable. Why ? what is the explanation of each case?
EDIT
1- The length of the received signal $y$ is considered to be $N$x $1$, it means that the delay of channel is already discarded.
2- We considered the length of the guard interval to be longer than the channel delay
3- The toeplitz matrix $H$ and $G$ was built as following,
C = [h;zeros(N-L,1)];
R = [h(1), zeros(1,N-1)];
H = toeplitz(C,R);
G = inv((1/SNRv(i))*eye(N) + (H')*H) * (H');


texts:
From audio file [y,FS]=something.wav

So the y is typically N cross 2 matrix

I want calculate energy so i.e  sum(abs(y.^2))

So when I apply these I end with two answer for each column. So I want only one energy for whole signal what to do???


texts: How to determine number of observations based on measurement frequency?

texts:
So I'm working on a problem where I'm measuring a signal with two different instruments -- one is a low frequency measurement system (1 Hz), and the other is a high frequency measurement system (200 Hz). I am interested in the maximum of the signal (peak). Please see attached image.

Now it's obvious that there's a loss of information when we're using a low freq measurement system than when using a high freq measurement system. However, if I take the maximum (peak) of both the signals, I only end up with 1 single observation. The peak could be impacted by noise.

But in reality, the maximum of the signal is a random variable itself. Therefore, the high frequency signal, should in reality be giving me multiple observations of the same quantity -- the max of the signal. This begets the question, how do I decide on the number of observations that I have from this high frequency signal? Am I supposed to take all the observations within some region? If yes, then how do I decide that region? Is there any relationship between the frequency of measurement and the number of observations of the maximum?

My knowledge of signal processing is limited, but I am well acquainted with Bayesian statistics.


texts: I read a wav file in MATLAB and it has a sampling rate of 16kHz. I want to pass it through a filter I designed which has a sampling rate of 44.1 kHz. So, I thought I would use resx=resample(x,44100,16000) first in order to make them have the same sampling rate. I can see that I will have more samples in time now, but what is the expected change of the fft of my signal? I thought that the fft of the resampled signal would be the fft of the initial signal (0-8kHz) stretched to (0-22.05kHz) but according to the MATLAB plots it is not. Is it logical?


texts: FFT/PSD/IFFT analysis on single axis piezoelectric accelerometer signals for curb impacts

texts:
I'm trying to denoise the signal by performing PSD analysis and followed by IFFT. Ultimately, I want to generate Force and Displacement plots from the denoised acceleration signal.
Noisy Acceleration Signal($a_z$ vs t):

PSD analysis of the signal:

Setting a PSD > 0.001 in the code to filter out frequencies having less power than 0.001.
After IFFT($a_z$ vs t):

The denoised signal makes sense since I'm recording z-acceleration on curb impacts which comes out to be a series of impulses.
I'm a novice in signal processing and I don't know whether a windowing would have given a better result or not?
Further questions: Is it possible to find force distribution from the acceleration signal? I've been searching to find answers but none have given me a good idea.


texts:
E.g. when having 2 signals $x(t)$ and $y(t)$ and transforming each one with adding their spectra, the operation is linear, as the result would be the same as the transformation of $(x + y)(t)$.

Even when looking at the sampling series, each of the infinite elements adds up linearly.

But how is aliasing a non-linear operation and how is it proven mathematically?


texts: If a second order system has 2 poles/zeros that are conjugate symmetric, how does this affect the phase response? I know that if there are 4 zeros/poles that are conjugate reciprocals, then it is a zero phase system.


texts: In filter design, why isn't it possible to have a frequency response with phase 0?

texts:
A linear phase filter will cause a delay in the output signal of the filter.

If I'm not mistaken, a filter with phase equal 0 would cause no delays in the output signal.

Can someone explain me why isn't it possibly to generate a 0 phase response filter? I mean, theoretically...

I'm studying for a test and I can't find the answer in textbooks.


texts: Calculating the Fourier transform of shifted scaled unit step function

texts:
I have $x_1(t)$ here. To get $x_2(t)$, I need to differentiate $x_1(t)$. Express $x_2(t)$ as $2u(t+2)-4u(t)+2u(t-2)$.
From Fourier transform definition integral, I got $X_2(j\omega)=\frac{2e^{j\omega 2}}{j\omega}-\frac{4\pi \delta(\omega)}{j\omega}+\frac{2e^{-j\omega2}}{j\omega}$.
Is this correct? It seems weird and would be complicated to calculate the magnitude and phase spectrum. Thanks!


texts: Fourier transform of triangular function

texts:
Determine $X(\omega)$.

$g(t)$: I understand how to create a box from [-1,1] of amplitude 1/2.
$x(t) = g(t) * g(t)$
$X(\omega) = G(\omega)G(\omega)$

the solution I am seeing says that $G(\omega) = \frac{2\sin(\omega)}  {2\omega}$

I don't understand where $\sin$ came from and that the values of the 2s correlate to. I've seen proofs, but can someone provide a simple explanation of what the variables are. Thanks


texts: How do I create a frequency vs time plot?

texts:
I'm a chemical engineer, not an EE, so this is a bit difficult.

I'm trying to figure out how to take amplitude vs time data and transform it into frequency vs time.  My first instinct is to slice my data into chunks, perform the FFT on each chunk, and then plot that.  Unfortunately, as the time duration of each slice approaches zero, there is no longer enough information to get accurate frequency information (low frequencies require more than a very small time slice).  So... how do I do this?  I'm sure this is some sort of famous problem that someone's already solved.

Here is the kind of transform I'm looking for, illustrated with a sound wave (piano note G).  As you can see, this graph as three axes, with the third one being represented by color.

Thanks!


texts: GPS - Compute travel time satellite-receiver

texts:
I'm working with a MATLAB Software-defined Radio, and I need to compute the travel time of the satellite signal, in order to get the pseudo range of the receiver (the direct distance between the satellite and the receiver position) before compute the receiver position.

I've already done sucesfully the acquisition and tracking of the signal, but I'm having problems about computing the travel time of the signal (since it multiplied by the light speed is the range). I can easily obtain the transmitted time from the navigation data, but I don't know how I can get the received time.

Form Kai Borre's book "A Software-Defined GPS And Galileo Receiver" On Pg 121, I've read:

"For software receivers the situation is a little different. The time tcommon common to all pseudorange observations is defined as the time of transmission at the satellites. Hence the computation of position of satellite k is done at:

t_k=tcommon-dt_k

The only “receiver time” used is the relative time of reception from each of the satellites and which makes the individual pseudorange. A consequence of this time definition is that the computed satellite coordinates immediately refer to the ECEF system, and therefore satellite coordinates are not to be rotated about the Z-axis by an angle equal to the travel time times the Earth’s rotation rate. "

So, what I'm asking is how I can compute the travel time (or how I is usually done) between the satellite and the receiver (to get the pseudorange), since in software receivers there is "no time" references (as it happens with hardware receivers).


texts:
I am confused while writing code to implement Fisher’s F-ratio.

Suppose I have 4 speakers, each speaker pronounces 2 words and each word has 3 frames and each frame has 30 sub-bands.

$u$ is mean of all speakers.

Suppose $x_{ij}$ is one sub-band energy of the $j$th speech frame of
speaker $i$ with $j= 1\ldots N$, and $i = 1 \ldots M$. $u_i$ and
$u$ are the sub-band energy averages for speaker $i$ and for
all speakers, respectively, which are defined as
$$
u = \frac{1}{MN} \sum_{i=1}^{M}\sum_{j=1}^N x_{ij}\\
u_i = \frac{1}{N} \sum_{j=1}^N x_{ij}
$$
I have written following MATLAB code:

U=mean(mean(mean(mean(spectr1(:,:,:,:)))));
for subband=1:N
nominator=0;
for speaker=1:speaker_number
   nominator=(mean(mean(spectr1(speaker,:,:,subband)))-U).^2+nominator;
end
denaminator=0;
denaminator=(mean(mean(mean(spectr1(:,:,:,subband))))-mean(mean(spectr1(speaker,:,:,subband)))).^2;
F_ratio(subband)=((1/speaker_number)*(nominator))/((1/(speaker_number*phonem_number))*denaminator);
end


texts:
I am looking to calculate the signal energy of real, sampled acoustic data. According to this source, the energy of a continuous signal is:
$$\tag{1}\hspace{1cm} E_x = \int_{-\infty}^{+\infty}|x(t)|^2dt $$
This is intuitive as we are often taught that the energy is given by the area under the curve, for a power curve. Certainly the equation 1 can easily be approximated by the Riemann Sum which still retains the differential
$$\tag{3}\hspace{1cm} S = \sum_{i=1}^{n} f(x_i)\Delta x_i $$

However, according to this source, the discrete energy calculation is given below as:
$$\tag{2}\hspace{1cm} E_x= \sum_{-\infty}^{+\infty} |x(n)|^2$$

My question is why do we drop the differential ($dt$)?


texts:
According to definition of decibel it’s “logarithmic unit of measurement used to express”

So in audio we often convert linear value from range 0 to 1 to logarithmic scale for example like that:

double result = 20.0 * log10(valueInRange_0_1);

(of course we need to menage situation when valueInRange_0_1 = 0, but leave it now, it’s not the case)

So for example for valueInRange_0_1 = 0.5 result will be about -6 and we can call it “-6 decibels”.

But the question is how we can call valueInRange_0_1 = 0.5:

“0.5 OF WHAT” ?

I know in audio we can call it “0.5 gain”, or “0.5 of linear value”. But is there any general term to use as opposite to decibel?


texts: High order IIR Comb Notch Filter with small Bandwidth - Low atenuation of harmonics

texts:
Im filtering an EMG signal, more precisely the 50 Hz frequency and its harmonics. For that, I've constructed a comb notch filter (on filterdesigner in Matlab), with its fundamental frequency being 50 Hz, sampling frequency of 10kHz, and notches's bandwidth of 0.1 Hz. That means i have a filter order of 199.

Given the filter specifications, its magnitude response is bellow. I don't understand why the first two notches almost aren't attenuated. I've read that high quality factors (Associated with low bandwidth) are related with low attenuation rate, but i don't know in what extense it explains the low attenuation of the first two harmonics. Can you explain?


texts: Inverse FFT of complex exponential with time delay - window leakage?

texts:
I am working in MATLAB with a frequency domain signal that is a sum of complex exponentials, e.g.

$X(\omega) = \sum_i e^{-j\omega t_i} $ where $t_i > 0$ $ \forall $ $ i $

I expect the output to be a sum of delta functions, e.g.
$x(t) = F^{-1}[X(\omega)] \approx \sum_i \delta(t_i)$

I have noticed that when the time bin lines up exactly with the $t_i$, I get an excellent $\delta(t_i)$ function. However when the time bin is off slightly, there is significant energy spread throughout the rest of the time axis, as below:

Does anyone have a clearer idea why this happens? Or even better, a solution? (Perhaps a window that better treats these delta functions?, or a better way to do this IFFT?) Code used to generate image is below

Nfft = 2^12;
Tend = 20e-9;%20 ns of runtime
t = linspace(0,Tend,Nfft); %time
Ts = t(2) - t(1); %sampling rate, s
Fs = 1/Ts; %sampling rate, Hz
f = (-Fs/2):Fs/Nfft:(Fs/2 - Fs/Nfft); %frequency

%create complex exps. with delays 4ns, 6ns, 10ns
%4 ns exists as a time bin
ts = [4e-9 6e-9 10e-9];

%create exponentials
exps = zeros(length(ts),length(f));
for k = 1:length(ts)
    exps(k,:) = exp(-1j .* 2*pi.*f .*ts(k));
end
X_f = sum(exps); %create f-domain signal

x_t =real(ifft((X_f))); %ifft

plot(t.*1e9,20.*log10(x_t)); %plot
xlabel('Time, ns'); ylabel('dB');


texts: Frequency Hopping Spread Spectrum Synchronization Methods

texts:
Frequency-hopping spread spectrum waveforms change the carrier frequency at some interval.

I can see if the frequency is constant for the duration of an entire packet, the pilot symbols could be used for synchronization but what happens in the case of "burst-by-burst carrier frequency hopping"? As mentioned in this paper, it is possible to change the carrier frequency within a symbol duration.

In order for the receiver to perform coherent demodulation (like for PSK), how would phase synchronization occur in the case where the carrier frequency changes at the symbol rate (ie each symbol is transmitted at a different carrier frequency)?


texts: Find autocorrelation of exponential signal $a^nu[n]$

texts:
I need to find the autocorrelation of the following discrete signal $$x[n]=a^nu[n] $$ So I tried finding the convolution of $x[n]$ and $x[-n]$.
\begin{align}
\phi_{xx}[n]&=\sum_{m=-\infty}^\infty x[m]x[m-n]\\
&=\sum_{m=-\infty}^\infty a^m u[m]a^{m-n}u[m-n]\\
&=\sum_{m=n}^\infty a^m a^{m-n}\\
&=a^{-n}\sum_{m=n}^\infty  a^{2m}\\
&=a^{-n}\sum_{l=0}^\infty  a^{2(l+n)}\quad\tag{with $m-n=l$}\\
&=a^{-n}a^{2n}\sum_{l=0}^\infty  a^{2l}\\
&=a^{n}\sum_{l=0}^\infty  \left(a^2\right)^l\\
&=a^n\frac{1}{1-a^2}
\end{align}

However the result should be an even function of $n$ and instead of $$\frac{a^n}{1-a^2}$$ I should have found $$\frac{a^{\lvert n\rvert}}{1-a^2}$$


texts: Power spectral density of sigma-delta modulator

texts:
I am simulating a 3rd order SDM and I want to plot the PSD of the output.

As you may know, the output is a sequence of pulses ranging from -3 to +4.
The number of samples is $N$.

The way I approached the problem is the following:

Use fft on the output sequence
normalize (divide by $N$)
Square the above signal.
multiply by 2 ( because I need the one-sided band -- not sure about this ).

The plot should then be $10\log_{10}(signal)$ if I am not mistaken.

Problem is that I get a big deviation from the ideal curve of the expected noise.

Am I doing something wrong?


texts: What does boundary discontinuity in DFT imply?

texts:
I have been studying about boundary discontinuity in DFT and why it is not used as transform in image compression. What i understand is that DFT is N periodic and that causes a discontinuity at the boundary. This means that more number of terms are needed to represent the function and the rate of convergence is slow.

Can somebody explain as to what does it mean when they say that "more number of terms are needed to represent the function?" . And how does it help to use DCT which is 2N periodic?

Reference article is at : http://en.wikipedia.org/wiki/Discrete_cosine_transform

Thanks!


texts: Why is a feedback loop not represented by the least order transfer function?

texts:
I have a feedback loop with transfer $L(z)= \frac{H(z)C(z)}{1+H(z)C(z)}$.

$$H(z) = h\quad \text{and} \quad C(z) = \frac{K}{z-\alpha}.$$

If I manually calculate the transfer function, I get:

$$L(z) = \frac{Kh}{z-\alpha + Kh}$$

But if I let MATLAB do the calculation I get:

$$L(z) = \frac{z-\alpha}{z-\alpha}\frac{Kh}{z-\alpha + Kh}$$

$L(z)$ is unstable with $\alpha=2$ and $K=\frac{1}{h}$. The second transfer function (calculated with MATLAB) has two poles $(1,2)$ of which one is outside the unit circle. So the second one seems to be correct. What is wrong with the first one?


texts: Partitioning the frequency axis with shifting resolution

texts:
I am calculating the sum of the signal energy in different frequency bands for music in Matlab. At the moment I have calculated the FFT for a music signal and then split this frequency vector in N partitions. This gives me the sum of the energy for N parts which is all good.

The problem with this is that music most often is concentrated around some frequencies and since my partitions are of uniform length this does not give a good representation of the original signal.

What I would like to do is to be able to give a frequency value f0 and the number of partitions N. This should then give me N partitions but where the partition lengths are shorther around f0 and increasingly longer when farther away from f0. How could one do this?

My idea is that the end result would be a normalized length vector.

Any help would be appreciated.


texts: Repeated Fourier transform - what happens?

texts: I have a Fourier transformable complex function that is a function of independent real variable a.  Now I take the Fourier transform of it, giving me a complex function of real variable b.  Now I treat the resulting function as if it is in the original domain of a and again take Fourier transform of it - in stead of inverse Fourier transform as is usually done to get the original fucntion.  May be I will do this repeatedly.  What are relations between the original function and the transform function at various stages?


texts: How can I make a mmWave frequency selective channel in matlab?

texts:
$$H_d=\sum_{\mathcal{\ell}}^{N_p}\alpha_\ell p(dT_s-\tau_\ell)\mathbb{a}_R(\phi_\ell)\mathbb{a}^*_T(\theta_\ell) $$

I'm trying for simulation of a frequency selective channel in matlab. my problem is the raised cosine filter. without the raised cosine filter the matlab code is as follows. but in presence of pulse shaping filter I confused. can any body help me?

EDITED:

I've done all of Mr. Carlos Danger advises and this is my final code. but I got some errors. can any body help me?
 this is my RRC code:

function [res]=Root_Raised_Cosine(Sample_Rate,Roll_Off_Factor,time)

Sample_Interval = 1/Sample_Rate;
a = Roll_Off_Factor;
index = [-30*Sample_Interval:Sample_Interval:30*Sample_Interval];
%This can be increased or decreased according to the requirement

p = zeros(1,length(index));
for i = 1:1:length(index)
    if index(i) == 0
        p(i) = Sample_Rate*((1-a)+4*a/pi);
    else if index(i) == Sample_Interval/(4*a) || index(i)==-Sample_Interval/(4*a)
           p(i) = Sample_Rate*a/sqrt(2)*((1+2/pi)*sin(pi/(4*a))+(1-2/pi)*cos(pi/(4*a)));
          else
            p(i) = Sample_Rate*((sin(pi*index(i)*(1-a))+4*a*index(i)...
                .*cos(pi*index(i)*(1+a)))./(pi*index(i).*(1-(4*a*index(i)).^2)));
         end
    end
end
response = p./sqrt(sum(p.^2)); %Normalization to unit energy
t = find(abs(index-time)== Sample_Interval) ;
res = response(t);
end

and this is my channel.

clc; clear all;

%--------------------------System Parameters------------------------------%

Num_BS_Antennas = 16; % BS antennas
Num_BS_RFchains = 4;  % BS RF chains
BS_Antennas_Index = 0:1:Num_BS_Antennas-1; % Indices of the BS Antennas

Num_MS_Antennas = 16; % MS antennas
Num_MS_RFchains = 4;  %MS RF chains
MS_Antennas_Index = 0:1:Num_MS_Antennas-1; % Indices of the MS Antennas

Num_Qbits = 7; % No. of Quantization bits
Step = 2^Num_Qbits;
Step_Index = 0:1:Step-1;
PS_Quantized_Angle = Step_Index*(2*pi)/Step; % Quantized angles in PSs

%---------------------- Hybrid Precoders and Combiner---------------------%

for i = 1 : 1 : Num_BS_Antennas
for j = 1 : 1 : Num_BS_RFchains
    uniform_index = ceil(length(PS_Quantized_Angle)*rand);
    F(i,j) =
sqrt(1/Num_BS_Antennas)*exp(1j*PS_Quantized_Angle(uniform_index)); % Hybrid
Precoder
end
end
clear i j
for i = 1 : 1 : Num_MS_Antennas
for j = 1 : 1 : Num_MS_RFchains
    uniform_index = ceil(length(PS_Quantized_Angle)*rand);
    W(i,j) =
sqrt(1/Num_MS_Antennas)*exp(1j*PS_Quantized_Angle(uniform_index)); % Hybrid
Combiner
end
end

%--------------------------Channel Parameters ----------------------------%

Delay_Tap_Length = 4;
Sample_Rate = 1760*10^6; % Sampling rate set to be 1760 MHz
Sample_Interval = 1/Sample_Rate;
delay = 0 : Sample_Interval : (Delay_Tap_Length-1)*Sample_Interval;
Num_paths=3; % Number of channel paths
Roll_Off_Factor = .8;
% Channel parameters (angles of arrival and departure and path gains)
AoD=rand(1,Num_paths); %Sin of AoD in the range og [0,1)
AoA=rand(1,Num_paths); %Sin of AoA in the range og [0,1)
alpha=(sqrt(1/2)*sqrt(1/Num_paths)*
(randn(1,Num_paths)+1j*randn(1,Num_paths)));

% Channel construction
 d = 3;
Channel=zeros(Num_MS_Antennas,Num_BS_Antennas);
for l=1:1:Num_paths
Abh(:,l)=sqrt(1/Num_BS_Antennas)*exp(1j*pi*BS_Antennas_Index*AoD(l));
Amh(:,l)=sqrt(1/Num_MS_Antennas)*exp(1j*pi*MS_Antennas_Index*AoA(l));
res = Root_Raised_Cosine(Sample_Rate,Roll_Off_Factor,d*Sample_Interval-
delay(l));
Channel=Channel+
  (sqrt(Num_BS_Antennas*Num_MS_Antennas)*alpha(l)*Amh(:,l)*Abh(:,l)');

end


texts: Preamble generation of narrowband signals

texts:
I have to generate a complex sine wave with a sampling frequency of 1.92MHz and subcarrier spacing of 3.75kHz. The number of FFT points is 512. The narrowband frequency is 180kHz.
I also have to generate a preamble. The preamble looks like this:
pattern = (1:48); % In this way you have all the 48 sub-carriers;
q = diag(pattern);
n= repmat(0:L-1, 48,1);
X_ref = exp(1i * 2 * pi * q * n/ L); % symbol
ofdm_ref = [X_ref(:,L-N_CP + 1: L) repmat(X_ref,1,5)]; %SG

Can anyone help me with this?


texts: Determine Phase Difference and Time Delay Between Two Pulsed Sinusoidal Signals

texts:
I am working on a code that generates two signals: A pulsed sinusoidal signal ($1\textrm{ MHz}$) beginning at $0$ phase, and lasts for say $5\ \mu\text{s}$, then trails zeros. The other signal has the same pulse width and frequency ($5\ \mu\text{s}, 1\textrm{ MHz}$), but begins at a different time ($1\ \mu\text{s}$ later for example), and with a different phase ( $\pi$ radians).

If either the phase or time delay were consistent between the two, then I would be able to solve this problem, but how do you go about solving this when both variables differ between the signals?  Any feedback on this is greatly appreciated.


texts: How to compute 2D displacement vector for binary image registration?

texts:
My inputs are several binary images like:

They have globally the same content but may be unregistered as they are produced from a hand camera. What I would like to compute is the 2D displacement vector from the first image to the second. I use OpenCV and my first attempt was to compute feature points (SURF algorithm) and the affine transform between both images. But of course, feature description are kinda poor on a binary image, therefore the matching is difficult and the matching map very inaccurate.

Does anyone has an idea how I could do this?


texts: Should the input of a Kalman filter always be a signal and its derivative?

texts:
I always see the Kalman filter used with such input data. For example, the inputs are commonly a position and the correspondent velocity:

$$
(x, \dfrac{dx}{dt})
$$

In my case, I only have 2D positions and angles at each sample time:

$$
P_i(x_i, y_i) \qquad \text{and} \qquad (\alpha_1, \alpha_2, \alpha_3)
$$

Should I compute velocities for each point and for each angle to be able to fit the Kalman framework?


texts: Interference Distribution Assumption in NOMA IoT Scenario

texts:
I am assuming a NOMA IoT Uplink scenario, which is interference marred. I have to ascertain the SINR at the Access Point (AP) for the NOMA users. A sub-channel is allocated to various users and interference is considered at each sub-channel. What is the realistic and best assumption for Interference Distribution at each sub-channel?

The interference intensity is different at each sub-channel but varies with same distribution.


texts: What does this mean? The elliptical constellation in the QPSK constellation diagram?

texts:
Can you explain what kind of signal is this or what can you characterize when you see QPSK constellation like this? to get a better signal it needs to be near 1 and be a round circular constellation. What can be represented by the elliptical kind of constellation in this QPSK?
many thanks,
Sam


texts: What is meant by "omega suppression" in a lock in amplifier context?

texts:
Can anyone explain what is meant by "Omega suppression" in lock-in amplifier discussions or specifications. I'm usually very good at web-searching, but have been unable to find anything that explains rather than mentions this term. I find it mentioned in some manuals but never explained.
Omega and 2 Omega sound like fundamental and 2nd harmonic, but ...?
Some mentions:
In passing only here Setting up a Digitally Tunable Resonator using the HF2LI
Many mentions here MFLI User Manual but meaning uncertain from context.


texts:
We use OQPSK because of envelope of signal but my question is

"In Phase Shift Keying(or QPSK) the amplitude of the transmitted signal is constant then how the envelope will change in OQPSK"??


texts: A mp3 file is reeoncoded in a video software (shotcut), which bitrate (Audio Bitrate vs Lame Bitrate) do I need to use?

texts:
I have downloaded a .mp3 file from the internet. "Right click" and "Properties" on Linux does not show up any bitrate (N/A) in the "Audio" tab.
Then, I executed following command in the terminal: exiftool ambient.mp3, which prints a lot of information into the terminal:
File Type Extension             : mp3
MIME Type                       : audio/mpeg
MPEG Audio Version              : 1
Audio Layer                     : 3
Audio Bitrate                   : 320 kbps
Sample Rate                     : 44100
Channel Mode                    : Stereo
MS Stereo                       : Off
Intensity Stereo                : Off
Copyright Flag                  : False
Original Media                  : True
Emphasis                        : None
Encoder                         : LAME3.99r
Lame VBR Quality                : 4
Lame Quality                    : 1
Lame Method                     : CBR
Lame Low Pass Filter            : 20.5 kHz
Lame Bitrate                    : 255 kbps
Lame Stereo Mode                : Stereo
Duration                        : 0:45:22 (approx)

Is the Lame Bitrate the correct one or the Audio Bitrate?
Extra: lame is on Ubuntu a mp3 lib called libmp3lame.


texts: Problem with simulation of the desired shape of the signal

texts: I am trying to generate a signal with specific frequency and shape. I have accomplished to get a time domain signal with the specified frequency, however the shape does not match. Is there any method to get the desired shape. Will phase be any helpful?


texts:
I’ve built a circuit with an analogue sensor (70 Hz bandwidth) connected to a 24 bit ADC, which is oversampling the signal at 10 kHz. Nyquist sampling theorem implies I should sample by at least 140 Hz to reconstruct the signal.

Currently (if I’ve understood oversampling correctly) I’m oversampling by a factor of $N = \frac{10000-140}{140} = 70$. As the minimum sampling frequency is the Nyquist rate, and oversampling is a factor $N$ times this minimum rate. My questions are:

Does this oversampling only reduce the noise introduced from the output of the analogue sensor (given the low bandwidth of the sensor) to the end of the ADC process?
How much can I reduce the oversampling (which introduces a processor overhead) by for a negligible increase in the amount of noise to the signal?
Could I do anything else to reduce the amount of oversampling, e.g increase the ADC resolution?


texts:
I am trying to determine a "simple" way to compute which inputs of a FFT need to "butterfly" together for its various stages. I am looking at a diagram like this:

In that diagram of a $16$ point FFT,

For stage 1: 0 butterflies with 8, 4 butterflies with 12, and so on.
For stage 2: 0 butterflies with 4, 8 butterflies with 12, and so on. Of course stage 2's inputs are stage 1's outputs.

My hope is that for each stage of the FFT, I can just have a simple counter going from $0$ to $N-1$ (FFT length $N$), and I can do very inexpensive bit manipulation to form the correct indices in the correct order.

Stage 1's pattern is fairly obvious: Have a 4 bit counter going from 0 to 15, and completely reverse the bits in the counter:

$0000 (0)$ with $0001\longleftrightarrow 1000(8)$
$0010\longleftrightarrow 0100(4)$ with $0011\longleftrightarrow 1100 (12)$
and so on.

I believe stage 2 is like this: bit reverse the counter, then swap the 2 leftmost bits.

Is there a generic formula for any stage of any FFT?


texts:
If I have a signal with frequencies up to 2000 Hz but I'm only interested in the frequency range up to 500 Hz, is it correct to sample at 1000 Hz $(f_\mathrm s \geq 2 \cdot f_\mathrm{max})$? Or do I have to apply an analog lowpass filter with cut-off frequency 500 Hz first?

I read this similar post, but didn't understand it well:
Ignoring Nyquist


texts: minimum frequency in periodic components

texts:
Suppose we have the following signal model

$y(t) = A_1\sin(\omega_1 t+\phi_1) + A_2\sin(\omega_2 t+\phi_2) + ... + A_p\sin(\omega_p t+\phi_p) + z(t)$

When we are sampling at sampling frequency $f_\mathrm s$ we know that the sampling frequency must be at least 2 times the maximum frequency, but what about a condition for the minimum frequency (largest period)? Is there any reasonable limit below which it is useless existence of frequency? Suppose that the sampling frequency is $100\,\text{Hz}$, then the maximum frequency can be $50\,\text{Hz}$, but what about the minimum frequency?


texts: How does cascading low pass modules affect pass band ripples?

texts:
This question 10.21 is taken from GATE IN paper 2015.

I don't understand the answer given,

I mean why is the frequency response at the pass band frequency considered to be $(1-\delta)$, isn't the ripple equally distributed on both sides, so shouldn't the average be One?

Finally why is effective ripple calculated by subtracting from one?


texts: Understanding how the Kinect v1 works with Structured Light to compute disparity

texts:
I am reading this description here concerning calibration of the Kinect v1. I am trying to get an understanding of how it all works.
From what I understand, the kinect has an near-infrared projector and a near infrared camera. From the description:

The IR camera and the IR projector form a stereo pair with a baseline of approximately 7.5 cm. The IR projector sends out a fixed pattern of light and dark speckles, shown below. The pattern is generated from a set of diffraction gratings, with special care to lessen the effect of zero-order propagation of a center bright dot (see the PrimeSense patent).
Depth is calculated by triangulation against a known pattern from the projector. The pattern is memorized at a known depth. For a new image, we want to calculate the depth at each pixel. For each pixel in the IR image, a small correlation window (9x9 or 9x7, see below) is used to compare the local pattern at that pixel with the memorized pattern at that pixel and 64 neighboring pixels in a horizontal window (see below for how we estimate the 64-pixel search). The best match gives an offset from the known depth, in terms of pixels: this is called disparity. The Kinect device performs a further interpolation of the best match to get sub-pixel accuracy of 1/8 pixel (again, see below for how this is estimated). Given the known depth of the memorized plane, and the disparity, an estimated depth for each pixel can be calculated by triangulation

I do not understand the statement: Depth is calculated by triangulation against a known pattern from the projector. The pattern is memorized at a known depth.
What is the known pattern and what does the author mean the pattern is memorized at a known depth? I'm imagining the projector is projecting some kind of pattern to an object, and then the NIR camera looks at the pattern at a given patch, and tries to match it to some patch in the original pattern (as if the original pattern were projected on a flat plane with no distortion). Then I am not sure what mathematical techniques are used to relate the distorted pattern to the original pattern to compute disparity (and hence depth).
Any insights appreciated.


texts:
This question has been asked in GATE 2019. I am unable to understand how MAP criteria is "applied" here. I've read about MAP but I'm unable to get how they're solving it by graphical method.
Please explain what they are doing here, and also what do they mean by "optimum threshold exists here" ?

Thank you.


texts: decomposition of a function to piecewise functions

texts:
Is the next answer correct:
$$a\left(z\right)=\sum _{\left\{k\right\}U\left\{k'\right\}:f_k\le \:z,\:z\:\in R,\:f_{k'}\ge z\:;\:z\ge 0}1-\frac{f_k}{z},\:b\left(z\right)=\sum _{\left\{k\right\}:f_k>z,z<0}f_k-z\:$$
Which mean I want to iterate over all the $f_k$'s in the $a(x)$ equation by the k's which their $f_k$s are smaller then $z$ for all real $z$, and then for positive $z$ only on the $k'$ which $f_k'$ is bigger then z, and the $b(x)$ all other, so their sum is exactly the original $g_i(z)$
Is this mathematically correct ?
P.S:
My try isn't correct, so I will be glad to the right way to do this.


texts: Performing image equalisation and then Jpeg compression

texts:
I'm trying to estimate what would be the result of first performing an histogram equalisation on an image, and then compressing it using JPEG.

I know that histogram equalisation increases the contrast in the image.
I also know the jpeg reduces the size of the image by removing the high frequencies from the frequency domain. Thus, it seems reasonable to me that performing histogram equalisation first would result in loosing more information, as it would increase the higher frequencies in the photo only for them to be later removed by jpeg.

Am I correct? If no, what am I missing?


texts: How to express STFT and ISTFT as a 1d convolution and 1d deconvolution in tensorflow/keras

texts:
I'm trying to implement this paper in tensorflow and keras. At the end of section 3 it says.

Note that although weighted SDR loss is a time-domain loss function,
it can be backpropagated through our framework.
Specifically, STFT and ISTFT operations are implemented as 1-D convolution
and deconvolution layers consisting of fixed filters initialized
with the discrete Fourier transform matrix.

How would I go about implementing an STFT and an ISTFT as a 1-D convolution and 1-D deconvolution respectively? For example how would the window size and the hop length correspond to parameters of a convolution?

Conversely, could I just use tensorflow's built in STFT and inverse_STFT ops instead?


texts: what is the significance of pilot carriers in ofdm

texts:
in an OFDM system having a radix two FFT (Say N=64) . all of these sub-carriers are not utilized. while some of the carriers are nulls to prevent leakage in to adjacent bands, say a four to five carriers will be pilots. and the remaining will be the data carriers. what is the significance of pilot carriers in OFDM system

regards,
phani tej


texts: Fast calculation of normalization factor for normalized cross correlation

texts:
There has been a number of posts here I've browsed through that explain implementations of normalized cross-correlation in Python. One such implementation that is frequently cited is found below.
def normxcorr2(template, image, mode="full"):

template = template - np.mean(template)
image = image - np.mean(image)

a1 = np.ones(template.shape)
# Faster to flip up down and left right then use fftconvolve instead of scipy's correlate
ar = np.flipud(np.fliplr(template))
out = fftconvolve(image, ar.conj(), mode=mode)

image = fftconvolve(np.square(image), a1, mode=mode) - \
        np.square(fftconvolve(image, a1, mode=mode)) / (np.prod(template.shape))

# Remove small machine precision errors after subtraction
image[np.where(image < 0)] = 0

template = np.sum(np.square(template))
out = out / np.sqrt(image * template)

# Remove any divisions by 0 or very close to 0
out[np.where(np.logical_not(np.isfinite(out)))] = 0

return out

https://github.com/Sabrewarrior/normxcorr2-python/blob/master/normxcorr2.py
My understanding is that the normalization term is the square root of the autocorrelation of the two input images.
\begin{equation}C=\frac{\sum_{i=1}^{n}(I(i)-\bar{I})(J(i)-\bar{J})}{\sqrt{\sum_{i=1}^{n}(I(i)-\bar{I})^{2} \sum_{j=1}^{n}{(J(i)-\bar{J})^{2}}}}\end{equation}
for two images $I$ and $J$ respectively. I am having difficulty understanding this line:
image = fftconvolve(np.square(image), a1, mode=mode) - \
        np.square(fftconvolve(image, a1, mode=mode)) / (np.prod(template.shape))

Is this a clever way of calculating the autocorrelation of one of the input images? Why not take the autocorrelation like the 'template' image?


texts: Why does the control effort increase if the bandwidth of the system is higher then the bandwidth of the plant?

texts:
I am studying control systems and I am focusing on the control effort.
I have seen that if I place a pole at higher and higher frequencies, if the bandwidth of the system goes above the bandwidth of the plant, the control effort increases at high frequencies. In particular, at higher frequencies than the bandwidth of the plant, the control effort behaves as the controller, while at lower frequencies it behaves as the plant, and the frequency response of the control effort increases until the frequency of the open loop bandwidth.
The definition of control sensitivity function is:
$Q(j\omega)=\frac{C(j\omega)}{1+C(j\omega)P(j\omega)}$
by looking at this definition, we can make some approximations, so if $|L(j\omega)|>>1$ then $Q(j\omega)=\frac{1}{|P(j\omega)|}$ and if $|L(j\omega)|<<1$ then $Q(j\omega)=|C(j\omega)|$ where $L(j\omega)=C(j\omega)P(\omega)$. From the plot below, this means that for high frequencies, the control effort behaves like the controller, while for low frequencies it behaves like the plant.
This is the plot I have created using Matlab.

where by control effort I meant the frequency response of the control sensitivity function and the open loop is $L(j\omega) = C(j\omega)P(j\omega)$. Moreover, I have plotted the frequency response of the plant and of the controller. Just to be more clear as possible, the code for plotting this plot is:
s = tf('s');
P = 1/[(1+s)*(1+0.05*s)^2];
C = (s+1)/s;

tau_3 = 0.001;
CF_3 = [(1+s)*(1+0.05*s)^2]/((1+tau_3*s)^3);

Q3 = (C+CF_3)/(1+P*C);

C3 = (C+CF_3);

L3 = C3*P;

figure;
bodemag(Q3,'g',C3,'r',P,'b',L3,'y'),grid
legend('control effort Q(jw)','controller C(jw)','plant P(jw)','open loop L(jw)')
title('behaviour of the control sensitivity function')

In this case I am considering a two degrees of freedom controller, which is why I have used C+CF_3 in my code.
Why does this happen?


texts: How to determine if an IIR filter is causal or non-causal?

texts:
It may sound impractical, as only causal system are passively realizable, but what I am facing is a general statement made regarding recursive digital filters: for them to be stable, the poles should  be inside the unit circle. I am not able to see that how without knowing type of system that the  system is causal or non causal one can comment on location of poles for system to  be stable.

I also know that for system to be stable its output should only be dependent on values of input at or before observation time for instant below is causal

But what about below equation


texts: How to simulate analog VU meter response to audio?

texts:
I'd like to simulate the movement of an analog VU meter dial as shown below and often found on stereos and other music monitoring equipment.

I just learned through this article by Rod Elliot (ESP) and Wikipedia that the response of a VU meter is standardized and designed to measure the perceived loudness of audio signals.

  A VU meter is designed to have a relatively slow response. It is driven from a full-wave averaging circuit defined to reach 99% full-scale deflection in 300ms and overshoot not less than 1% and not more than 1.5%. Since a VU meter is optimised for perceived loudness it is not a good indicator of peak (transient) performance. Nominal sensitivity for 0VU is 1.228V RMS, and the impedance is 3.9k.

I'm playing with music visualization and data processing and a measure of perceived loudness is precisely what I need. I also like the analog nature of the response.

I'd like to implement this in an algorithm in Python (for an entire music file) and later perhaps in Processing (live processing in batches). The underlying implementation will probably be very similar.

How can I generate the response from raw audio data to match the specifications of a VU meter?


texts: How much of a problem is the Gibbs phenomenon and would this solve it?

texts:
By iterating or nesting a sine curve like in this question

I get curves like these:

that seem to tend to a square wave.

The eight case of these looks like:

which here on purpose was chosen for it's roundness.

The Mathematica code for these plots can be found here:
http://pastebin.com/6UK1u1uX

I don't know much about signal processing but I recalled the Gibbs phenomenon in square waves after I saw these curves.

  Would they solve the problem with the Gibbs phenomenon in the case of square waves?

In the Fourier transform this kind of function is not of any use though I understand.

Edit 13.1.2013:

Sawtooth wave:
http://pastebin.com/JNg7bzzB

Triangular wave (partial sums instead of integrals):
http://pastebin.com/wRCBV7NF

Dirac comb http://pastebin.com/QMSMQf26