texts: Ambiguous results of phase correlation in pattern recognition

texts:
We are using phase correlation to find pattern on image and what we get is 15% of results is spurious. Ours pattern has 32x32 pixels and image for research has 32x512 pixels. So we put Pattern to 32x512 pixels image to the left side and the rest of image is filled by zero pixels. Next we apply FFT to pattern and the image without applying a window function.
Then we make Hadamard product, normalized it and do inverse FFT of resulting matrix.
Sometimes we get false peak almost on the middle of plot where edge effects and circularity of correlation should be neglected.

The question:

What else could be the cause of false peak ?

Images:

what was searched and what we got:

real research image 32x512 (before greyscale)

real pattern in (in greyscale)

correlation result

Best Regards

Dawid D


texts: Design of a digital A-weighting filter with arbitrary sample rate

texts:
I want to A-weight a time series with arbitrary sample rate.

An analog A-weighting filter is defined exactly by IEC 61672-1. But there's no definition for a digital filter. One method is to use the bilinear transform (BLT) to convert the analog filter to the digital filter (as done here Applying A-weighting). However this method suffers from extreme warping near nyquist (even when the analog poles/zeros are pre-warped):

Figure 1: A-weighting frequency response comparison where the sample rate is $25600\textrm{ Hz}$.

Instead I'm thinking of using an algorithm than can design a digital IIR filter with arbitrary frequency response and plugging in the frequency response of the analog A-weighting filter.

Is this a good approach?
If so, is there a particular algorithm that would be well suited for this?

I've looked into MATLAB's yulewalk but I would need a corresponding Python implementation to try out. I've also come across Berchin's FDLS method in a few places, like this question for instance, but all of the links appear to be broken.


texts: How to interpret Allan Deviation plot for gyroscope?

texts:
Regions with different slopes correspond to different types of noises in Allan Deviation plot of a steady gyroscope at steady temperature.
My doubts are:

What is significance of x axis in this plot, how cluster/window size affect different noises?
e.g. if a 7 degrees/Hr value on Y-axis corresponds to 10 second value of x axis (forget which noise region it is, i.e. antiquarian, ARW, Bias Stability, etc.) what  can I say from that particular (x,y) combination on Allan deviation curve?

Bias Instability has two different units in two different sources (http://cache.freescale.com/files/sensors/doc/app_note/AN5087.pdf) dps/Hr and degrees/Hr. Which one is correct?


texts: Interpolation techniques for extremely limited hardware

texts:
I am trying to playback samples on a retro-computer. The hardware is extremely limited, so I am forced to use software PWM as my main method of playback. The limitations of the platform mean that I cannot use a particularly high PWM frequency and the resulting sample resolution is unlikely to exceed 5 or 6 bits. Let us say just for the sake of definiteness that my PWM frequency is about 20 kHz.

Now, my hardware is also quite limited in terms of memory. Samples recorded at 20 kHz are not really practical. As a way of compromise, I am trying to use samples recorded at 5 or 10 kHz, i.e. at frequencies that are factor of 2 or 4 lower than my PWM frequency. I need to interpolate, but sophisticated processing is basically impossible. I tried simple "upsampling" (i.e. inserting zeros between existing samples) and it produces quite a lot of ringing artefacts. I also tried "zero-order hold" and "first-order hold", as defined in What are the relative merits of various upsampling schemes? Frankly, I cannot easily choose between the latter two; both ways are better than simply inserting zeros, but the ringing in both cases is still substantial.

Clearly, more sophisticated filtering is required. My problem is that software PWM is expensive and my computer is weak. All computations will have to take place in 8-bit registers. There is no hardware multiplication/division (except for multiplications/divisions by 2 done by shifting). A FIR filter can probably be implemented by using look-up tables, but I guess no more that 3-5 filter taps are plausible.

So, the question is, what  filtering methods are likely to give me the most bang for a buck the least ringing for my very limited platform? Should I try to experiment with FIR filters tweaked to get 8-bit friendly numbers or should I do something entirely different? What filtering strategies do you think are likely to work best in the limited computing environment?

In terms of my homework, I did read through the post cited above and several other posts related to it. I've done some reading on Google. I understand how to construct moving averages, including polynomials (="higher order holds"), but the discussions seem to suggest that they are not the best option. FFT is impossible. I am currently playing with various 3-5 tap FIR filters, which seem to work, but are approximately maximum that I can do computationally. I tried to implement CIC filter (and failed to get a decent result). I have not looked at IIR filters yet. So, basically, I am asking this question in the hope that you could help me to focus on something a bit more specific, maybe a family of filters that are more likely to be useful in my case, maybe even specific filters.


texts:
I know this subject tends more to control theory but I am certain its part of the global knowledge basis for engineers, thus I believe I can find the answer here.
I'm trying to draw Root Locus for $K<0$, but can't understand how the system behaves.

I have this open loop system:

$$
\frac{20(1+s)^2}{(1+\frac{s}{10})(1+\frac{s}{2})}
$$

I know it has no asymptotes, but yet by one of the drawing rules for $k<0$, it tends to $\pm \infty$ in the real axis. How is it possible?


texts: Confused in difference between sequence versus signal?

texts:
I am learning basics of signals and systems with MATLAB
If i create a vector in matlab such that
x=[ 2 5 10 20], will it be considered a sequence or a signal?

As far my learning/knowledge is, x is a sequence in this case, since it is using discrete numbers as its elements.

If there was x such that x=sin(t) or cos(t) or exp(t),it would be a signal because of the continuous range of values in it.

Please correct/guide me if i am wrong


texts:
As I was learned in signal processing, modulation took the signal spectrum to higher frequency range, so I made an experiment for audio file. The audio file "handel.ogg" plays a small part of music "hallelujah".
I was expected that I would hear higher frequency or higher tone of the modulated sound than the unmodulated one when I played the modulated sound, but it didn't.

Why the thing that frequencies in spectrum get higher doesn't mean that the tone or the frequency of signal will get higher? Can someone tell me what's difference, thank you.

Here is my code:

clear;
clc;

% handel.ogg is a sample audio file in matlab.
[x, fs]=audioread('handel.ogg');

% carrier frequency
fc = 100;

% modulated signal
time = (1:numel(x))/fs;
x_modulated = x.*exp(1j*2*pi*fc*time');

% play the music
sound(real(x_modulated), fs)


texts: Confused about the definition of point to point ,this point means single antenna or single device?

texts:
What is the definition of point to point ? does the "point" mean single device or single antenna?  I mean,can one transmitter with multiple antennas and one receiver with multiple antennas be called point to point ?or we should only call it MIMO?

If there are 2 transmitters,t1 & t2,and 2 receivers,r1 & r2,and t1 will send the message to r1,but r2 will also receive the RF of t1 ;t2 will send the message to r2,but r1 will also receive the RF of t2.So in this situation,is this system also point to point? or point to multi-point

If a receiver with multiple antennas ,and there are K energy harvesters, 4 antenna for each energy harvester,and 1 receiver with single antennas.What system can we call it?MISO?or MIMO?


texts: How to transform SoundWave Picture to sound?

texts:
I would like to recreate a sound from a picture of a soundwave.

But i see a lot of theorical question.

And im not sure its possible....

I mean, it is possible to create a sound...

But to make the sound as close as possible of the original one, sound a bit harder.

Most of the time when you see soundwave as art...

It's really time compressed.

I would love to have a tatoo of the soundwave of someone important to me that say a word to me.

And then with my smartphone point the camera at the tatoo and hear it again.

But i have a lot of question about this.

First how can i get the periodicity?
Per pixel i will probably got a lot of periode.
How can i decide the lenght of my whole song?
I have a sound wave but no legend. so it can be 1s or 160s compressed i can never know....

Let's say i cheat and decided my application always says from start to end of my soundwave i have 1s (1s is enough for a 'I love you' for exemple)

Ok so i have my length total so with open cv i can check my image and reconise bar height every pixel.
And then with my pixel length and the fact i know it's one second i can start to generate sound.

But how can i decided.... the corresponding value to the Heigh in pixel? I don't have frequency value correspondance. 12px heigh can be 20Hz as 20 000Hz

Ok let's say i define a value to the max height of my sound wave to the real value of my sound.
Cause i use a sound i choose.
So i can set a reference value and use it to get other value.

I now parse a picture to get a compressed sound and i have some value of Hz in an intervall of second.

Lets say i have a 10cm tatoo of a 1s sound.
each cm is 0.1s

And in each cm i can make like... 10 bar maybe 20 (one bar is 1mm or 0.5mm possible in tatoo right?)
Let say 20 ...

so i have info of Hz every
0.005s

and let say i decide i start up and and bottom
i hav two info in 0.005s the up and bottom one
So i have one info for 0.0025s

That make a sound at 400Hz...
And... classical sound are know to be around 44 100Hz....

Will the sound i produce be at little close to the real one?
Or does it will only be a little noise?

(English is not my mother tongue feel free to improve i will try my best to reformule if you didn't understand something)


texts: What type of signal analysis (if any) might be performed on a recorded music vocal track to determine if pitch correction might have been applied to a performance?


texts: Filters using equiripple approximations (different from type I lowpass)

texts:
In Oppenheim & Schafer's Discrete-Time Signal Processing, only type I lowpass filters are explained in detail in the chapter "Optimum Approximations of FIR filters".
I want to know what happens not only with the other three types of generalized-phase filters, but also understand how the equiripple approximation works with bandpass and highpass filters.
In the previously mentioned book, it says:

Specifically, we will show that for type I lowpass filters:

The maximum possible number of alternations of the error is $L+3$.
Alternations will always occur at $\omega_p$ and $\omega_s$.
[...] the filter will be equiripple, except possibly at $\omega=0$ and $\omega =\pi$.

I have a bunch of questions, for example:

Is there a maximum possible number of alternations for every type (II, III, IV) and kind (lowpass, highpass, bandpass) of filter?
Do the other two properties (alternations at edges and equiripple-ness except possibly at $0$ and $\pi$) apply to other types and kinds of filters?
Do other types and kinds of filters have other special properties (i.e., properties that differ from the ones in the quote I wrote)?

It would be great if you could give me some insight in the subject, or if you could recommend a book to which I could fall back on.


texts:
I have been reading more about EKF and I am a bit confused on how you handle predictions with multiple sensors.
Ex, I have IMU, GPS, Odom and Stereo Camera.
Each can be used to predict location, how do you combine them?
My understanding of EKF fits in the basic framework of predict, act, measure, fuse prediction with sensor.
But it's not clear how multiple sensors that measure the same thing is used.


texts:
I am confused why zero-padding in the frequency domain does not result in linear convolution in the time-domain using the relationship:

$$corr(a,b) = ifft(fft(a) fft(b))$$

See my process below for more details:

1.

$$a = \{a_0, a_1,\dots,a_{N-1}\},\;\;\;\; w = \mathrm{rect\{N\}}$$
$$\boxed{y_c = \mathrm{conv}(a, w)}$$

2.
$$M=2N-1$$
$$X_a = \mathrm{FFT}(a, M),\;\;\;\;W_a = \mathrm{FFT}(w, M)$$
$$\boxed{y_f=\mathrm{IFFT}\left(X_a * W_a\right)}$$

3.
$$y_c=y_f$$

I am aware that zero-padding in frequency domain is interpolation in time-
domain.

4.

$$X_b = \mathrm{FFT}(a, N),\;\;\;\;W_b = \mathrm{FFT}(w, N)$$

Now zeropad the $X_b$ and $W_b$ the spectrum to size $M$
Perform frequency domain multiplication
Take inverse transform
$$\boxed{y_{zf}=\mathrm{IFFT}(X_{zb} * W_{zb})}$$

where, $X_{zb}$ and $W_{zb}$ are zero-padded spectrum of $X_b$ and $W_b$

Results: $y_{zf} \neq \left(y_c\;|\; y_f\right)$

Attached MATLAB example below

clear all;

clear;

M = 7;
N = 4;

A = 1:4;
window = ones(1, 4);

y_c = conv(A, window)

A3 = fft(A, M);
W3 = fft(window, M);

y_t = ifft(A3.*W3)        % y_t = y_c

A1 = fft(A, N);
middle_a = A1(N/2+1)/2;
A2 = [A1(1:N/2) middle_a zeros(1, M-length(A1)-1) middle_a A1(N/2+2:end)];

W1 = fft(window, N);
middle_w = W1(N/2+1)/2;
W2 = [W1(1:N/2) middle_w zeros(1, M-length(W1)-1) middle_w W1(N/2+2:end)];

y_f = ifft(A2.*W2, M)     % Expected y_f = y_t = y_c but y_f gives bad results


texts: What is the meaning of a Nyquist diagram in a vibration signal

texts:
I need to analyze some vibration data from accelerometers (g-Hz) but I don't quite understand the meaning of each component that the registered signal contains. Basically it is Magnitude and Phase. I'm able to get the Real/Imaginary parts from those two as well.

Today I plotted Real vs Imaginary parts (Nyquist plot/diagram, correct me if I'm wrong). These are the results:

The Nyquist shows like a circular pattern, sometimes there are spirals, sometimes just random points. What could this mean?

The second picture displays the Magnitude of this particular accelerometer.

In the third the raw Real/Imaginary parts are included. The Magnitude is the RSS of Re/Im parts. I've realized that I need to compare (divide by) this channel to the reference (the input or control channel).

The last one shows the chaotic Phase, it gets better if I do the same as at Re/Im parts: compare to the reference, in this case I subtract in order to get the gap between the input and my channel (output).

The pink and green dashed lines are the Re/Im parts divided by the Re/Im parts of the reference (the input). The blue is the same but with Magnitude

The blue line is the subtraction.

It would be great if someone could help me to have some better understanding and interpretation of this kind of data.

By the way, is Argand diagram the same in essence as Nyquist?

EDIT: The vibration signal comes from a UFF (Universal File Format) dataset 58, the test consists in measuring the response of 50-100 accelerometers attached all around the structure to a sinusoidal motion (varying in frequency). There is an accelerometer situated in the base, so it is measuring the real input to the system (in g-Hz).

The hardware of the test transforms internally the response from g-s (time) to g-Hz with some kind of Fourier Transform algorithm I believe.

As the vibration may not be in phase with the input motion the gap between them is also measured. For example: a gap of 180 degrees between an accelerometer and the base means that if the shaker is going up in a particular instant, this accelerometer is going down.


texts:
I have feature in my camera that indicates "Low Frequency Flat Field correction" and I want to evaluate its impact on the image.

How can I do this?

Currently I can only take pictures of a uniform monochromatic light source.


texts: Audio time scaling using a phase vocoder

texts:
I've implemented audio time scaling using a phase vocoder approach because I wanted to answer this question here (and learn something in the process). Since that question has been closed, I may as well ask a new question about audio time scaling.

Here are some examples of what you might get if you use the approach I did (the format is 8kHz, 32bit float, 1 channel). I can post the source code here too if someone's interested.

Examples (these are all examples of time scaling without pitch shifting - magnitude/phase modified or raw fft modified say what I did to achieve time scaling)

original

2x slowdown -magnitude/phase modified

2x slowdown - raw fft modified

2x speedup - magnitude/phase modified

2x speedup - raw fft modified

I still have a couple of questions though

1) Does anybody know of software that does time scaling right using a phase vocoder (by right I mean with as few digital artifacts as possible)?

2) How do we preserve the phase coherence/continuity while time scaling the fft spectrum? Some code or pseudo code would be great.

Regarding question #2, I know there're a lot of papers on this but they're usually so convoluted and I'm having a hard time understanding them.


texts: Difference between frequency sampling and windowing method

texts:
These two filter design methods seem fairly similar. Both ask to determine a frequency response and then take a inverse DFT to get the filter coefficients.

So what's the difference?


texts: Suppose I have done 4x oversampling for a continuous time signal, but the successive sampling times have a linearly increasing offset. Specifically, the samples with indices {4k; k=0, 1, 2,...} are correctly sampled at times {4kTs}, but the samples at indices {4k+1; k= 0, 1, 2,..} are sampled at {(4k+1)Ts+e}, the samples at indices {4k+2; k= 0, 1, 2,..} are sampled at {(4k+2)Ts+2e)}, and the samples with indices{4k+3; k= 0, 1, 2,..} are sampled at {(4k+3)Ts+3e)}. How does the spectrum of this oversampled signal look ?


texts:
The FMCW radar with the following parameters was implemented:
% System parameters Value

% ----------------------------------

% Operating frequency (GHz) 77

% Maximum target range (m) 15

% Range resolution (m) 0.037

% Maximum target speed (km/h) 30 for fall detection

% Sweep time (microseconds) 50

% Sweep bandwidth (GHz) 4

% Maximum beat frequency (MHz) 73

% Sample rate (GHz) 4.050

A target was simulated with the following parameters(static radar)

dist = 14;

speed = 10*1000/3600; ;%2.77km/h

rcs = 100;

and the Range Doppler image plotted using the phased array functions.

RangeFFTLength = 2048;

DopplerFFTLength = 512;

rngdopresp = phased.RangeDopplerResponse('PropagationSpeed',c,... 'DopplerOutput','Speed','OperatingFrequency',fc,'SampleRate',fs,... 'RangeMethod','FFT','SweepSlope',sweep_slope,... 'RangeFFTLengthSource','Property','RangeFFTLength',RangeFFTLength,... 'DopplerFFTLengthSource','Property','DopplerFFTLength',DopplerFFTLength);

figure

plotResponse(rngdopresp,xr);

[![enter image description here][1]][1]

The results are as expected.

Interested to get the same results implementing the 2DFFT manually.

For this purpose the following code was used:

Nr = RangeFFTLength;

Nd = DopplerFFTLength;

% 2D FFT using the FFT size for both dimensions.

sig_fft2 = fft2(xr,Nr,Nd);

% Taking just one side of signal from Range dimension.

sig_fft2 = sig_fft2(1:Nr/2,1:Nd);

sig_fft2 = fftshift (sig_fft2);

RDM = abs(sig_fft2);

RDM = 10*log10(RDM);

Yielding the following:

The index of the range and velocity are: [518 229].
This yields the following values:
Range:
fb=fs/2;

range_max = cfb/(2sweep_slope);

distance = ((518-512)/512)*range_max

distance =

43.9453

This is 3 times larger then the correct value. Why?
Velocity:
Converting the index to the abs value using the following, yields correct value:
vel_max = lambda/(4*tm);

sp = ((293-256)/256)*vel_max

sp =

2.8155

Seems, however, that the velocity in this case is positive – why?
The code can be seen below:
https://drive.google.com/file/d/1e7E6ItgVeHTaU1qx3VL_aDfB7nes7ipq/view?usp=sharing


texts:
Problem 1.14) Consider a periodic signal :
$$
x(t):=\left\{\begin{array}{ll}
1, & 0 \leq t \leq 1 \\
-2, & 1<t<2
\end{array}\right.
$$
with period $T=2$. The derivative of this signal is related to the "impulse train"
$$
g(t):=\sum_{k=-\infty}^{\infty} \delta(t-2 k)
$$
with period $T=2 .$ It can be shown that
$$
\frac{d x(t)}{d t}=A_{1} g\left(t-t_{1}\right)+A_{2} g\left(t-t_{2}\right)
$$
Determine the values of $A_{1}, t_{1}, A_{2},$ and $t_{2}$.

I checked on wikipedia the impulse train and it seem's too advanced for chapter $1$. I was wondering how we can plot $g(t)$. The solution manual only offers the graph without how it is plotted.


texts: Split and Merge image segmentation algorithm in OpenCV

texts:
I asked google and I've tried to find something in the API of OpenCV, but hadn't any good hints on split and merge image segmentation method.
I want to test it, if it's working better than my proposed method which I posted a while ago here on SP.
Do you know if there exists a free library or OpenCV extension for this segmentation method?
Any good hints for writing it fast by myself are welcome, if there is no available solution.

kind regards


texts: Fast approximate optical flow / image shift

texts:
I need to detect how fast a camera is panning (either horizontal/vertical) to give a warning to the operator to slow down.

The entire image is moving as a block, I don't need an actual direction (although H or V would be a bonus) and I only need an approximate magnitude - ie. trigger if more than 'N' pixels shift between frames.

Images are large and generally uniform low contrast scenes, I don't have any obvious highlights to track. I need to do it in realtime (60fps) and without using all of the CPU.

Niave solution is pick an RoI in the center, find edges, calculate similarity between pairs of frames, shift one of frames left/right/up/down by a pixel, repeat - find minima.

I wondered if there was a smarter solution?


texts:
In this code, i am doing a STFT on my audio file. I want to find the rhythm of file. Bascially the bass, which is located in the lower frequencies. I think i need to find the BPM of my file. The tempo of a song is measured by BPM, which is i need.
There is a method,that if there's strong beat is to take the magnitude of the STFT of the waveform, and then auto-correlate it in only the time dimension. The peak of the auto-correlation function will be the beat, or a submultiple of it.

This is equivalent to breaking up the signal into a lot of different frequency bands, finding the amplitude envelope of each, autocorrelating each envelope, and then summing them. The noise and other parts of music are averaged out by the cross-correlation operation.

I tried to find this method, how excatly this can be performed. I was searching for an open-source-code or any kind of instructions, how this can be done. But i wasn't able to find anything. Does anyone can help me to reach the steps explained in the methods?

%% MATLAB
%% STFT = SHORT TIME FOURIER-TRANSFORMATION
%___________________________________________
clear all;
[y,fs]=audioread('UnchainMyHeart.wav');
% audioread = Reading the WAV-File
% y = A vector, which contains our audio signal
% fs = Sampling frequency
% 'UnchainMyHeart' = Name of the WAV-File

%PARAMETER FOR THE CODE
%_____________________________________________
t_seg=0.09; %Length of the segment, on which we use the STFT

fftlen = 4096;
% Length of the fft

% L,M,H bands
% Start & Stop frequency defenition of bands
fL = [  1,  300 ]; % Low frequencies
fM = [  301,  5000 ]; % Medium frequencies
fH = [ 5001, 22050 ]; % High frequencies
%_____________________________________________

segl =floor(t_seg*fs);
% Length of the segment(50ms), which is being multiplied by the
% sampling frequency
% The result is rounded off with the function "floor"

windowshift=segl/3;
% Defining the size of the window, which goes to next segment and so
% on,until to the end of the audio signal

window=hann(segl);
% Hanning Function, which is being stored in a vraiable
% Matlab usually works better with variables than actual numbers. Hence
% the workspace. This way, you can avoid errors.

window=window.';
% transpose vector from a line vector to a row vector
% In the workspace, you can see, what kind of vector it is

si=1;
% Start index

ei=segl;
% End index

AOS=floor( length(y)/windowshift - 1);
% Determining the numbers of segments in my audio signal

f1=figure;
% New figure is being openend
n=0:1:fftlen-1;
f=n/(fftlen-1)*fs;
% Definig frequency vector

Ya=zeros(1,fftlen);
% The values between "1" and "fftlen" are being filled with zeros

for m= 1:1:AOS

y_a = y(si:ei);
y_a= y_a.*window;
Ya=fft(y_a, fftlen);
YA=abs(Ya);

drawnow;
% Updates the graphical objects

% indices of bands
LI = find((f>=fL(1))&(f<=fL(2)));
MI = find((f>=fM(1))&(f<=fM(2)));
HI = find((f>=fH(1))&(f<=fH(2)));
% mean values of bands
ML = mean(YA(LI));
MM = mean(YA(MI));
MH = mean(YA(HI));

figure(f1);
plot(f, 20*log10(YA));
ylim([-90 50]);
xlim([0 fs/2]);

% Limiting the length of my y-axis
title('Spectrum of audio signal');
% Title
xlabel('f(Hz)');
% Name of x-axis
ylabel('abs(Ya)/dB');
% Name of y-axis
grid on;
% Generating grid raster

si=si+windowshift;
%Start index is being updated
ei=ei+windowshift;
%End index is being updated

end


texts: why we do multiple aliasing of high order harmonics

texts:
the general rule for aliasing.
If my sampling frequency is Fs=800Mhz
signal frequency =120Mhz.
for the 4th harmonics 480MHz
its 80MHz above nyquist frequency(400Mhz) thus its mirrored 80MhZ back to 320MHz.
What about 1120MHz the closest nyquist frequnecy to it is 2*400 so its supposed to be mirrored
800-320=480 why we do double mirroing for it?
why it also mirroed to 320Mhz?


texts: Are complex exponentials the only eigenfunctions of LTI systems?

texts: Is there an example of an eigenfunction of a linear time invariant (LTI) system that is not a complex exponential? Justin Romberg's Eigenfunctions of LTI Systems says such eigenfuctions do exist, but I am not able to find one.


texts: How can we find the signal power of $x_{out}(t)=\frac{1}{2}Am(t)\cos \theta$?

texts:
I am trying to solve the following question:

I have partially worked out the problem and we have:
$$x_{out}(t)=\frac{1}{2}Am(t)\cos \theta,$$
which is the output of the LPF.

and
$$x(t)=Am(t)\cos (2\pi f_c t)$$

My problem is that how can I find out the power of $x_{out}(t)$ and $x(t)$ because I don't know the amplitude of $m(t)$. Moreover, if $m(t)$ is not a singletone frequency signal, how can we find out the power of $x_{out}(t)$ and $x(t)$ ?

  In short my question is:

  How can we find the power of

  $x_{out}(t)=\frac{1}{2}Am(t)\cos \theta$

  and

  $x(t)=Am(t)\cos (2\pi f_c t)$?


texts: Do energy of signal and power spectrum (in db/hz) indicate towards same signal property?

texts: If I calculate energy of signal by squaring the magnitude of signal sample and power spectrum using spectrogram (db/hz) what kind of property of signal do they indicate and are they point towards same characterstic. That is higher energy signal will always have higher peak spectral power and vice versa. Also what is there practical significance.


texts: Basic Algorithm for Image Classification

texts:
I have been trying to implement image classification by extracting facial features. I tried starting with some already established methods like Multi Kernel Approach, using Independent Component Analysis etc. Is there a very basic algorithm for image classification with which I can proceed the implementation ?

The data set I am currently considering is CMU Face Images data set. So aim is to separate images with human faces to those who do not contain human faces. I think I need to learn parameters by supplying  positive data set and negative data set as well. I am aware that SIFT, SURF, VJ algorithm etc. are helpful fir extracting features from an image. But I am stuck on how to start i.e. what features are required for face detection, and how to proceed towards implementing them.


texts:
Distribution for "joint multi-variate gaussian distribution" (joint MVG):
$$f_{X}(x) = \frac{1}{(2\pi)^{n/2}\prod \limits_{i=0}^{n}\sigma_i} ~~\text{exp}\bigg[-\frac{1}{2} \sum \limits_{i=1}^{n}\Big(\frac{x_i\mu_i}{\sigma_i}\Big)^2 \bigg]\tag{2}$$

Distribution for "multi-variate gaussian distribution" (MVG):
$$f_{\mathbf{x}}(x) = \frac{1}{(2\pi)^{n/2}~|\text{det }C|^{1/2}  }~~\text{exp}\bigg[ -\frac{1}{2} (\mathbf{x}-\mathbf{\mu})^T C^{-1} (\mathbf{x}-\mu)\bigg]\tag{1}$$
Where:
$[n\times1] ~~~\mathbf{x} \Rightarrow \text{sample vector}$
$[n\times1]~~~\mathbf{\mu} \Rightarrow \text{mean vector}$
$[n\times n]~~~ C \Rightarrow \text{covariance matrix (symmetric positively defined matix)}$

What's the difference between the two?


texts: Laplace transform of a time domain sampled data MATLAB

texts:
I have two sets of one second voltage data sampled with 4000Hz and I can plot all the voltage points vs time points in MATLAB. So it means I have a data matrix with with length of 4000 one column for the time in seconds the other for the voltage.

Now I have simultaneously sampled two data matrix in time domain with this way. One is input to a filter (Vin,t) the other is output (Vout,t). I want to find the transfer function both for amplitude and phase shift.

How can I take the Laplace transform of this data? Can I do it without converting it to a expressible function like poly-fit?


texts: Can CV or DS be seriously considered DSP roles?

texts:
This is not a technical question but can have a yes/no answer, and a why statement. My understanding about digital signal processing (DSP) is that it allows to take real-world analog signals (1D, 2D, etc...), sample them to create digital representations on the computer, and either way: extract useful information from filters or modify the signal to take it back to the analog world (using a digital-to-analog converter if you like). There is an overlap with other disciplines like pattern classification or statistics as DSP implements dimensionality reduction techniques that make easier to classify samples; or with embedded systems, that have DSP ICs. I am not considering analog signal processing which is another topic for a question.

There a talk explaining that there is an "identity crisis" in DSP nowadays with all the machines learning (ML) methods because they can process raw data without having to apply the carefully crafted DSP knowledge (let's say, using a CNN instead of extracting feature vectors). Of course, sacrificing computational power, time tunning hyperparameters and or the effort to create enough training data. But people don't care as long as they get the processing they want and don't have CPU, power, or memory constraints. This also reminds me this article pointing that DSP roles are not longer the same they used to be 25 years ago.

I have observed certain similarity between computer vision (CV) and data science roles with DSP, but I am still trying to convince my self that someone can really make some DSP working in them. On a CV role you are in charge of dealing with 2D+ signals and perform tasks such as face recognition or pose estimation (which has historically been a DSP task) but the problem is that the majority of the work is to reuse components-out-of-the-shelf (COTS), like openCV, to specific areas, without having to demonstrate full understanding of the yielding techniques (of course, I am talking about someone that hasn't to work in a lab where some research work needs to be done). And about data science, I know that they use a lot of ML, data visualization, statistics, business logic, A/B testing; and have to use the data gathered by data engineers, but they do not use DSP-core techniques like sampling and interpolation or FIR/IIR/adaptive filtering. A former data scientist said that you can even not use ML at all if you want.

Can someone really do DSP with these positions?

P.S. I know there are a lot of roles that have a better overlap with DSP (e.g. EEG, acoustics, radar, music information retrieval, ASR, media codecs) but I am focusing on the ones I mentioned, mostly because they seem to be doing a big impact today. And I believe someone would answer something like "it depends on how good you want to be at your job" but I'd like to consider roles where you are naturally forced to build DSP ad-hoc solutions.


texts: Use fourier transform to calculate image pixelation coef in python

texts:
I want to calculate a coef of image pixelation to remove bad pictures from a bunch of files.

Some pictures results from bad compression and we can see a lot of pixelation on them like img a here: http://imgur.com/IdLvd

I have heard of Fourier transform to calculate repetitive pattern, maybe it can be used in this case to detect pixel square ?

any kind of code making it possible is welcome.


texts: how to simulate the Johnson noise in ccoomputer?

texts:
I am wondering how someone can simulate the Johnson noise in computer? I know it is random however I do not know what distribution it has. According to following link : its power can be calculated but how to actually generate the noise itself. Can anyone explain the steps and the parameters needed to generate and simulate the noise.

http://www.radio-electronics.com/info/rf-technology-design/noise/thermal-johnson-nyquist-basics-tutorial.php


texts: Why not use a complex number in the exponent in the z-transform?

texts:
I am trying to comprehend how the z-transform has come to be similar but different from its continuous counterpart, namely the Laplace transform.

It seems to me that the most parallel and intuitive approach to the deduction of a generalized form of the DTFT would be to substitute $j\omega$ for $z = \sigma + j\omega$, i. e.:
$$
X(z) = \sum_{n = -\infty}^{+\infty} x[n]z^{-n} = \sum_{n = -\infty}^{+\infty} x[n]e^{-(\sigma + j\omega)n}
$$

Instead, we find normally that $z$ is a polar-form complex number which is the product of its magnitude and $e^{j\omega}$. I can guess that probably such representation leads to a rectangular representation of the z-transform, eventually rendering the analysis of poles and zeros impractical due to the periodic nature of the DTFT, but I am not sure. Could anyone enlighten me?


texts: How does an IIR system affect magnitude and phase of a sinusoidal signal

texts: Consider an IIR system with impulse response $h[n]=\left( \frac{1}{\sqrt{3}} \right)^n u[n]$. If I apply $x[n]=\cos(n \frac{\pi}{2} + \varphi)$ at the input, how can I determine the change in magnitude and phase of the output signal, i.e. what is $A$ and $\phi $ in $y[n]=A\cos(n \frac{\pi}{2} + \varphi + \phi)$?


texts: How to get RMS to Frequency chart for discrete samples of acceleration?

texts:
I’m reading a book on Motorcycle dynamics and want to compare the vibration profile of my motorbike against this chart:

I am not sure how to get the RMS of acceleration at different frequencies.

I have a mobile phone with an accelerometer that samples acceleration at 100 Hz. I get filtered values of vertical acceleration from external sources (no gravity component).

I can do a Fast Fourier Transform (FFT) of 512 samples of data to get 256 amplitudes of waveforms for a short window of collected data. FFT contains frequencies 1-50Hz

Or I can square each accelerometer output, making them all positive, add them together and take a square root to get a single RMS value. In this case I’m not sure how to get the frequency component of these values.

Can someone help me understand how I get the chart like above from a continuous set of accelerometer output?

Here’s my attempt at plotting the log of amplitude of the FFT (in blue 0-50Hz). I don’t see any dominant component within the FFT output: at the same time the yellow chart above registers acceleration spikes over 0.155(g) threshold. I can see individual impacts on the suspension within the yellow chart, but am not sure how to get their frequency (impacts per second)

I also see this suggestion, but the octave example is not very clear. Is this relevant to my question?


texts: Mathematical equation for 'Relative and absolute power' of a signal

texts: Can somebody provide me with the mathematical equation to calculate relative and absolute power of a signal (continuous) from FFT.


texts:
I would like to make an autoencoder for music generation using PyTorch.
In input, I would like to have a Waveform (from a .wav file) and I want the output to be a Waveform.
My problem is that I don't know how to get a .wav file from a waveform that is the output...
Does anybody have an idea?


texts: Filter recognition from transfer function

texts:
I have a filter with this transfer function in the z-plane $H(z)= z^{-k}$. Which type of filter is this (BP,LP,BS)and why?
I have a delay filter with zero/poles equal to zero and the magnitude constant equal to 1, so can I characterize it as an all-pass filter ?


texts: Frequency content Signal processing of very large files

texts:
I recently had to process a very large file to obtain the power spectrum. The file had about 60m measurements (arguably its not that huge, but its getting to that point). Although, in the end (initially I tried with Labview) I managed to find a few tools (Matlab, R) that allowed me to perform the calculation I needed on my PC, I couldn't help but wondering what would be the mathematically correct way to break up that problem, so that I can perform it piecewise.
I guess, my question boils down to:

Can I perform FFT on pieces of a very large signal, and then assemble the results to obtain the FFT of the total signal?

Bonus question:

What happens with the periodogram?

The way I interpret the periodogram is that its an fft on a smaller portion of data. So, would I get a much different result if I took a subsets of the signal (overlapping) and performed fft and the created the periodogram?

Update of information on signal No:2 (500kHz):
In advance apologies for changing the sampling rate. I just got some more results with higher sampling rate because I suspect the noise is so high frequency that cannot be captured.

Signal Description:

The signal comes from measurements in a wind tunnel.
The recorded values are the electrical signal of pitot tube, when the wind tunnel speed is set at a specific value.
The reason, the measurements were taken was because noise was creeping in (probably electrical), the signal and there is a need to investigate the frequencies that contribute so that an appropriate filter is applied (one that does not affect the measurement of wind turbulence).

Metadata:

Data acquisition rate: 500kHz (I just got another set of data with 500kHz)
Data recording rate: 500kHz
Recording duration: approximately 1 min (this is the typical length).

Preprocessing:

The raw signal is recorded with no preprocessing.
For the FFT the only preprocessing involves removing the mean value from the signal (so as to remove the DC component). (A window is not applied).

Sample of data

Following are two excerpts (1000 data points from a 500kHz data).
The first is the data with the suspected source of the noise turned on (it is actually the inverter that power the wind tunnel).  Although the inverter is turned on there wind speed is set to zero.

The second set, is an excerpt with the inverter turned off (obviously the wind speed is set to zero), at the same scale on the y axis.

The following graph is exactly the same as the second with autoscale on the y axis.

Longer interval excerpt 0.06[s] (30000 points)

This is to give a better overview of the signal. I switched to points (instead of lines) to give a more clear picture. The following two graphs are again with the electric noise a) on and b) off


texts: Updating forgetting factor in un-normalized lattice recursive least squares adaptive filter

texts:
The algorithms given for un-normalized LRLS and normalized LRLS filters on Wikipedia are transcribed from Adaptive Filtering Algorithms and Practical Implementation by Paulo S. R. Diniz. In reading the book, I noticed the author has this to say of the forgetting factor λ.

  Another interesting feature of the normalized lattice algorithm is that the forgetting factor λ does not appear in the internal updating equations; it appears only in the calculation of the energy of the input and reference signals. This property may be advantageous from the computational point of view in situations where there is a
  need to vary the value of λ.

I do not understand whether the author is saying that updating the factor is impossible with the un-normalized form, or computationally expensive. Nor do I understand what prevents one from updating the factor over time when using the un-normalized form. To me, it looks simple to parameterize the forgetting factor in terms of k for either algorithm. Could someone help me shed light on precisely what is meant here and why it is true?


texts:
Can anyone tell me why in a stereo mode many channels are derived from the 2 channel input . It looks like upmixing.. My questions are summarized below :
If it is Stereo mode why upmix it to many channels at the output ?
Why does this mode have to be after the equalization process ? Why can't this mode be present before equalization?
What I meant when I said the stereo mode is two channel stereo signal is first equalized through some filtering process and then upmixed. My question can be better understood as this why should upmixing be performed after equalization and not before equalization


texts: Is there any alternative characterization of sparsity of a signal in compressed sensing

texts:
The starting assumption for compressed sensing (CS) is that the underlying signal is sparse in some basis, e.g., there are a maximum of   non-zero Fourier-coefficients for an  $s$-sparse signal. And real life experiences do show that the signals under consideration are often sparse.

The question is - given a signal, before sending out the compressively-sampled bits to the receiver and let her recover to the best of her abilities, is there a way to tell what its sparsity is, and if it is a suitable candidate for compressed sensing in the first place?

Alternatively, is there any additional/alternative characterization of sparsity that can tell us quickly whether CS will be useful or not. One can trivially see that the sender could do exactly what the receiver will do with some randomly chosen set of measurements, and then try to figure out the answer. But is there any alternate way to resolve this question ?

My suspicion is that something like this must have been studied, but I couldn't find a good pointer.

Note : I had posted this question in Mathoverflow, a few weeks back, but didn't get any answer. Hence the cross-post.


texts:
I was reading a couple of these threads and I was wondering:
Is it possible for an FFT signal to include frequencies less than $1/N$?

Consider a time-series of length $N$, and I perform an FFT on it. In the zero-th bin of the FFT is the DC signal, and first bin is frequency $1/N$, in the second bin is frequency $2/N$ etc.

Does this mean that the smallest frequency accounted for is a signal where one full period fits in the data length? Or can there also exist frequency where only half/quarter periods will fit in the given length?


texts: Generating a Sine Signal (for example a voltage sine wave) with changing frequency and changing sample rate (time)?

texts:
i have a measured signal (e.g. voltage sine wave) and i would like to generate a sine wave which matches this meausred signal (with the generated sine wave i remove the harmonics from my measured signal), just like a PLL block in simulink.

for that i have to do the 2 steps:

1- Calculate the frequency of the measured signal from detecting the Zerocrossing.

2- calcualte the sine function using sin(2*pi*f(t)*t).

I have the following problem.

1- calcuating the frequency by counting the samples between two zerocrossing would results in getting the frequency at one point so my calcualted fequency does not match my sampled measured signal.

2- even when interpolating or using the repmat function i am able to get the f(t) to be the same length as the time (t) vector yet my sine wave is not correctly calcualted. i know that:

I am adding the zerocrossing times on my time vector which makes the last one inconsistance which mean the sampling rate is changing also.

so how to genereate a sine wave which changing frequency and changing sampling rate of the time signal?

Best Reagrds


texts: Fair performance comparison betweem LMS & NLMS

texts:
How can I choose the step size $\mu$, when I'm comparing different algorithms such as LMS, NLMS and transform domain adaptive filters, regarding their convergence speed, to get a fair comparison between them for mean-squared-error learning curves?

Is it necessary for a fair comparison to use the same step size for all algorithms since in most of the literature $\mu$ is not specified for the individual algorithms?


texts: Algorithm to detect if a spoken phrase matches a previously spoken phrase

texts:
I would like to create a very simple system that allows a user to train (once or multiple times) a spoken phrase (from 1 word to a whole sentence.)

Then the (same) user would speak the phrase back, and the system would score how close to the original the phrase was matched. If certain words were missed or incorrect, the score would be deducted.

I've seen several articles about audio fingerprinting (ie Shazaam) but these implementations are an overkill. I have a known sound pattern that I'm matching against, not search against a database of audio.

Here's what I've tried (using the R libraries DTW and tuneR):

recorded the phrase "Known as the father of the constitution, he was the first to arrive in Philadelphia for the Constitutional Convention." three times, however, the 3rd time instead of saying "Philadelphia" I said "New York".
took the MFCC of all three WAV files
took the DTW three times: Phili1 vs Phili2, Phili1 vs. NY, Phili2 versus NY
Plotted the alignment, question is...what do I do with this data, what metric should I use You can see in the plot that the first alignment is most linear (same phrase repeated exactly)

Phili1 vs Phili2

Phili1 vs. NY

Phili2 vs. NY


texts: Whether Poisson noise will be dominant source of noise in low light conditions?

texts:
I have one paper saying that that the Poisson noise will be dominant source of noise in low light conditions and the other one says the opposite way(Poisson noise will be dominant except in low light conditions). Which is true?
I believe Poisson noise is due to the random arrival of photons. So it should be more at short exposure time irrespective of light conditions.


texts:
I have this signal, with an arbitrary x-axis, and I want to find the (visually) dominant frequency of the signal. There may be a high frequency component, but I'm interested in the component with a period of around 120 pixels.

First I implemented the Pisarenko Harmonic Decomposition, but only got a very high frequency out (0.04 Hz) (one bin, one second). The I tried with the Fourier transform, and when I plotted the frequency amplitude spectrum I also only got a range of very high frequencies.

Can someone help me solve this problem? What am I doing wrong? It feels like such a simple problem, but for some reason I just can't solve it.

The raw dataset is located here: http://pastebin.com/5ghKbBRm


texts: Heisenberg Uncertainly Principle and wavelet transform

texts:
I am using CMOR(complex morlet) wavelet in Fourier space in order to reconstruct my signal and also estimate damping and frequencies of the embedded modes. there are two main parameters in cmor. the Fb and Fc. bandwidth and center frequency, with increasing the Fb i get better result for frequency estimation, but i cant get a good damping estimation with high Fb. is it sth to do with Heisenberg Uncertainly Principle? and if yes, would you explain the role of fb and fc in the accuracy of frequency and damping estimations?
 The wavelet transforms provide a unified framework for getting around the Heisenberg Uncertainly Principle.


texts: I am working on a project involving analysis of bird sounds and I want to record these sounds in slightly remote locations. It is enough if the device can only record and store them (maybe in an SD card). Are there any devices available that I can readily use or what would be the best way to do this ?


texts: Augment State Space Model with Derivative of State

texts:
Problem
How do you augment a state space model with the derivative of a state?  I know how to augment a state space model with the integral of a state by doing the following. Given a linear system
$$ \dot{x}=ax\tag{1}\label{1}$$
which has a state space representation given by
$${\bf\dot{x}}={\bf A}{\bf x} \tag{2}\label{2}$$
one can introduce the integrated state by augmenting the ${\bf A}$ matrix above by writing
$$\frac{d}{dt}\int xdt=x \tag{3}\label{3}$$
and taking $\int xdt$ to be the augmented state. This gives the following augmented state space model:
$$\frac{d}{dt}\left[\matrix{x \cr \int xdt}  \right]=
\left[
\matrix{a & 0\cr 1 & 0}
\right]
\left[\matrix{x \cr \int xdt}  \right] \tag{4}\label{4}$$
Solution Attempt
Is there a way to add $\dot{x}$ as a state? It seems that it should be the reverse of the above. I can take the derivative of $\ref{1}$ to get
$$\ddot{x}=a\dot{x} \tag{5}\label{5}$$
This gives the following augmented state space model:
$$\frac{d}{dt}\left[\matrix{\dot{x} \cr x}  \right]=
\left[
\matrix{a & 0\cr 0 & a}
\right]
\left[\matrix{\dot{x} \cr x}  \right] \tag{6}\label{6}$$
But this seems wrong because now I have essentially the same equation twice... So I tried substituting $\ref{1}$ into $\ref{5}$ yielding
$$ \ddot{x}=a^2x \tag{7}\label{7}$$
This gives the following augmented state space model:
$$\frac{d}{dt}\left[\matrix{\dot{x} \cr x}  \right]=
\left[
\matrix{0 & a^2\cr 0 & a}
\right]
\left[\matrix{\dot{x} \cr x}  \right] \tag{8}\label{8}$$
I think somehow what I am doing above is incorrect, because if the initial state of $x$ is zero, the system remains static.
Any help greatly appreciated and thanks in advance!! I asked this question over on math.exchange here but had not gotten any help so I decided to try my luck on dsp.exchange :).


texts:
How can I calculate bit error rate for 8-PSK modulation when I have $E_b/N_0$ given? I know that for QPSK/BPSK the matter is quite simple, but I cannot cope with 8-PSK.
Let's say that my $E_b/N_0$ = 63.1 [dB].
Now, can I use this formula?:

If yes, what can I substitute for n and Q? And if not, how can I calculate it differently?


texts: API/ Library for re-orienting 360 degree camera frame efficiently

texts:
I am trying to correct the orientation of a 360 degree camera frame using roll, pitch and yaw estimates coming from my C++ Extended Kalman Filter (EKF) code. I am interested in using libraries and packages such as OpenCV, Nvidia Visionworks or OpenVR. I am working on Ubuntu 16.04. Due to the requirements of the project, I am looking to get it done on GPU.

To give more context, I have a camera that provides 360 degree images which also has a set of IMUs integrated to it. There is an initial frame of reference and EKF calculates roll, pitch and yaw based on this frame of reference. As the camera changes the orientation, I want to use the EKF outputs to correct the orientation of 360 degree video frames coming from the camera.

1) So far I haven't seen any APIs or libraries providing this kind of a function for 360 degree cameras. I am looking for suggestions.

2) If this is not readily available, building a function from scratch using CUDA programming a good approach?

Edit based on the comment: The camera is mounted on a mobile platform which moves, thus changing the orientation (roll, pitch and yaw) of the camera. The initial orientation of the camera is used to fix a global coordinate system. The change in the orientation of the camera, as the platform moves, is calculated by estimating roll, pitch and yaw with reference to this global coordinate system. As the orientation of the camera changes, the orientation of the scene in a frame also changes. The idea is to align the frame back to global coordinate system so that all scenes are in alignment.

As an example, there is an idea to fix a global coordinate system where (x, y, z) will indicate the position of each pixel of the 360 degree video. It can be imagined that the pixels are lying on the surface of the sphere and the origin of the global coordinate system is at the center of this sphere. As the camera changes the orientation, this sphere rotates. Thus a pixel which corresponds to a particular object X will change its coordinates after rotation. Another way of looking at it, is that the local coordinate system has deviated from global coordinate system by roll, pitch and yaw. The objective is to create a rotation matrix from roll, pitch and yaw values estimated from EKF algorithm to rotate this sphere back to original position and bring it back in alignment with the global coordinate system.

I am looking for a function which is capable of doing this using GPU.


texts: Depth estimation from live video stream in matlab

texts: I want to estimate depth from live video stream with two calibrated webcams in matlab but has no results. In this post depth is estimated with two recorded video files. how can I estimate depth in live video stream?


texts: Derivation of Yule-Walker Equation for LPC

texts:
I have derived the Yule-Walker equation as shown below.

\begin{align}
\hat s(n) &= -\sum_{k=1} ^ p a_k s(n-k)\\
e(n) &= s(n) - \hat s(n) = s(n) + \sum_{k=1}^pa_k s(n-k)
\end{align}

In order to minimize the power of the error: $\displaystyle
\frac{\partial E\left[\lvert e(n)\rvert^2\right]}{\partial{a_k}} = 0 \quad \text{and}\quad \lvert e(n)\rvert^2 = e(n)e^*(n)
$

$$
E\left[\left(s(n) + \sum_{k=1}^p a_k s(n-k)\right)e^*(n)\right]= E\left[s(n)e^*(n)\right] + \sum_{k=1}^p a_k E\left[s(n-k)e^*(n)\right]
$$

\begin{align}
&\frac{\partial E\left[\lvert e(n)\rvert^2\right]}{\partial{a_k}} = E\left[s(n-k)e^*(n)\right]=0\\
&E\left[s(n-k)\left(s^*(n)+\sum_{i=1}^p a^*_is^*(n-i)\right)\right]=0\\
&E\left[s(n-k)s^*(n)\right]+ \sum_{i=1}^p a^*_i E\left[s(n-k)s^*(n-i)\right]=0\\
&\sum_{i=1}^pa^*_i r(i-k) = -r(k)
\end{align}

A few things confuse my mind. So I have 4 questions:

Is this derivation true?
I am not sure why we do the partial derivation in terms of $a_k$.
$e^*(n)$ includes $a^*_i$ coefficients, too. Why is $e^*(n)$ not affected by the derivation operation?
What is the meaning of all these complex conjugates here? How do they affect the numeric calculation?


texts:
When I read previous studies it mentioned a method of "square windowing function". I searched but I did not find anything talking about it. Can someone help to explain what is "square windowing function"? How to do it in matlab?

The description in the article is like this:

  A Cooley-Tukey FFT algorithm was implemented with a square
  windowing function and a 50% overlap of data segments to reduce
  spectral variance (Press et al., 1989).

This is from:

  Hamill et al., 1995. Shock attenuation and stride frequency during
  running. Human Movement Science. 14, 45-60.


texts: Looking for a way to monitor raw microphone digital output?

texts:
This is sort of a cross between a data processing and Physics question, but I would be grateful if anyone here could help me.

My objective is to calculate the sound pressure level (in dB) of a sound generated 1 meter away. I would like to use my condenser microphone to calculate this. The microphone I have is the Blue Yeti, which has a sensitivity of 4.5mV/Pa (reference value 20 microPascal).

So my question is is there a way that the digital output of the microphone can be directly monitored and recorded in units of Volts. Hence, I would use these values to calculate Pascals. Can anyone point me to a (preferably free) program that I can use to do this direct monitoring?


texts: In μ-law compression formula i have always seen that the value of Xmax and Ymax is always same but can they be different?


texts:
What is energy in terms of signal processing? You can read here, that energy is

I just need a simple everyday-example for that energy. And yes, bringing an example like

  $x(t)$ representing the potential of an electrical signal propagating
  across a transmission line

is still too complicated for me.


texts: "plot" command for continous time signal in matlab?uses interpolation?

texts:
We know digital computer cannot deal with continuous time signals directly. But then how MATLAB "plot" command works?

Does that uses interpolation technique to show an apparently continous time graph by connecting the various discrete data points?

Till now, i am able to understand is that MATLAB only handles discrete time data, MATLAB models continous time signals using discrete time signals but with very very small sampling interval,so it appears to be continuous while in reality it is discrete and then connects those discrete points using interpolation

I have also attached a snapshot of wikipedia where a graph of polynomial interpolation is shown

I have also attached a snapshot of chapter4 first page of book signal processing first, where interpolation discussion is mentioned


texts:
i have mini project to do about homography , but i am really a beginner in matlab . i have calculated the homography matrix easily by taking a set pixels from both images but the problem is how to apply this matrix to all pixels of the original image (i think it's difficult to treat each pixel individually ) . here is the original image :

i want to apply the homography to this image ( i have already extracted the homography matrix ) to get a frontal view of the cover.

so with my weak knowledge of matlab , i applied the folowing operations:

i get 4 points from the corners of the original image and the corresponding points in the output image

i have estimated the homography :

0.9638 -0.0960 52.5754;
0.2449 1.3808 -17.0081;
-0.0001 0.0013 1.0000

then i have applied it on the image using this poor matlab code:

function [Ired] = affect(I,P)
I1=im2double(I);
for i=1:308
i
for j=1:288
v1 = [j;i;1];
v2 = P*v1;
v3 =v2/v2(3,1);
if (v3(1,1) <0 || v3(2,1)<0 || v3(3,1)<0)
   continue;
else
Ired(round(1+v3(2,1)),round(1+v3(1,1)))=I1(i,j);
end
end

end

and the result is the following:

- but the problem with this code is it takes a lot of time (sometimes 10 minutes) to perform the operation on the image especially if the size of the image is high so is there a way to implement this code without loops to make it faster? .

- i get these black dots all over the image , i can do a dilation but the image will be distorted , do you have an idea how to eliminate this dots without distorting the image ?.


texts: Does a raised-cosine filter have infinite support?

texts: I recently asked a question here regarding limiting the bandwidth of a digital baseband signal and was introduced to pulse-shaping using a "raised-cosine filter". At the time, I mistakenly assumed this to be a sinc function combined with the Hann window. This is because the Hann window is also known as the raised cosine window, and that seemed logical to me. However, after reading on Wikipedia, I see that the "raised-cosine filter" is actually another beast entirely. This function appears to be a sinc function windowed by another sinc-like function, with two parameters, β and T. The extent of this function, like sinc, appears to be infinite, for all values of β and T. This thoroughly confuses me, as I thought the whole point of windowing the sinc function was to give it finite support. What am I missing?


texts: What is going wrong with my DFT program?

texts:
Please let me ask your help on my problem. My following DFT program outputs:

[Testing frequency's amplitude: $56.9708$, and its phase: $1.32018 \pi \textrm{ rad}.$]

Testing frequency's amplitude should be $57$, then it is okay. But its phase should be $-0.68\pi\textrm{ rad}$. Obviously it is obtained by subtracting: $1.32018\pi\textrm{ rad} - 2\pi\textrm{ rad}$.

But why this?

// Testing program for DFT. I change sampling frequency (samplFreq), samples (N)
// testing frequency (testFreq), and two existing in signal frequencies (existFreq_#)
// with their amplitudes (ampl_#) and phases (phase_#). After variable's declaration
// there is, in comment, its unit.

#include <iostream>
#include "math.h"

int main()
{
   double pi = 3.141592653589793; //pure number.
   int n = 0; // sample.
   double xn = 0; //pure number.
   double Re = 0; //pure number.
   double Im = 0; //pure number.
   double xn_cos = 0; //pure number.
   double xn_sin = 0; //pure number.

   int samplFreq = 3021; // sample/second.
   int N = 4400; //sample.

   double ampl_1 = 57; //pure number.
   double existFreq_1 = 536 * 2 * pi; // 2 * pi rad (cycle)/sec (multiple unit), basic unit: rad/sec.
   double phase_1 = -0.68 * pi; //pirad = pi rad (multiple unit), basic unit: rad.
   double unitAngle_1 = existFreq_1 / samplFreq; // cycle/sample (multiple unit), basic unit: rad/sample.

   double ampl_2 = 91; // pure number.
   double existFreq_2 = 896 * 2 * pi; // 2 * pi rad (cycle)/sec (multiple unit), basic unit: rad/sec.
   double phase_2 = -0.51 * pi; //pirad = pi*rad (multiple unit), basic unit: rad.
   double unitAngle_2 = existFreq_2 / samplFreq; // angle/sample.

   double testFreq = 536 * 2 * pi; // 2 * pi rad/sec (multiple unit), basic unit: rad/sec.
   double testUnitAngle = testFreq / samplFreq; // cycle/sample (multiple unit), basic unit: rad/sample.

   for (n = 1; n<= N; ++n)
   {
       xn = ampl_1 * sin(n * unitAngle_1 + phase_1)
          + ampl_2 * sin(n * unitAngle_2 + phase_2);

       xn_cos = xn *  cos(n * testUnitAngle);
       xn_sin = xn * -sin(n * testUnitAngle);

       Re += xn_cos;
       Im += xn_sin;
   }
   double testAmpl = sqrt(Re * Re + Im * Im) / N * 2; //pure number.
   std::cout << "Testing frequency's amplitude: " << testAmpl;
   std::cout << ", and its phase: " << atan2 (Im, Re) / pi + 0.5 << " pirad." << std::endl; // rad.
return 0;
}


texts: Speech recognition using MFCC and DTW(Dynamic Time Warping)?

texts:
I know basics about DSP, and now trying to complete a project on Speech recognition. So I read as many resources as I found, and got some ideas. They are like:

take a sample sound and break it into small frames

calculate MFCC for each frames( 13 of them)

use DTW to match the testing and template pattern.
Now, here are the things I am having trouble with-

13 MFCC's for n frames leaves me with 13*n MFCC's. How exactly do I use DTW here?

DTW gives me a distance between two patterns. How do I determine if they match or not?


texts: just getting started in Signal Processing - easy question

texts:
I am reading Cycle Analytics for Traders by John Ehlers and need help.

in the first section "Transfer Response" he refers to:

so if I had $4$ prices say $8+8+8+8$ then average would be $8$ and output/input $= 8/32 = 1/4$

but not equal to $1/4 + 8/4 + 8/4 + 8/4$ so I think I've misunderstood?

I don't want to infringe copyright so all I can do is guide you to amazon where you can view this section.


texts: What is the best codec for streaming of audio in this case?

texts:
I am trying to stream audio from device. I can't use the PCM audio because it is not compact enough, and I don't have so much bandwidth.

What is the option to substitute wave PCM with some codec? I am interested in good quality for speech and sampling frequency up to 16 kHz. Is ADPCM a good choice? Where can I find info about that?


texts: Different definitions of unit step signal

texts:
While I was learning signal theory, I have come across different definitions for the unit step signal. For example.
$u(t)=\begin{cases}
1 & t\geq0\\
0 & t<0\\
\end{cases}$
$u(t)=\begin{cases}
1 & t>0\\
0 & t<0\\
\frac{1}{2} & t=0\\
\end{cases}$
$u(t)=\begin{cases}
1 & t>0\\
0 & t\leq0\\
\end{cases}$
However, in the context of LTI systems the outputs are not different.
i.e LTI systems with these inputs produce same outputs. How can one justify this?


texts:
The questions below are for OFDM, IFFT, FFT operations.

Example 1

In OFDM modulation, a stream of parallel symbols are input to an IFFT operation of size $M$ for example and the output is time domain samples of size $M$.

My question is:

Let us take for example, the fact that the input symbols to the FFT operation are QAM symbols. Then, at the output of IFFT I receive $M$ samples. Each sample is weighted sum of modulated subcarriers.

Does it mean that each QAM symbol (input of IFFT) is sent out on ONE subcarrier?

Example 2

I have seen a paper that take the time domain samples of an impulse response of channel of length $T_{CH}$ puts them into  M-FFT operation and the result was $H(k)$ for $k\in[1:M]$ which the authors state are the frequency response of the $k$th subcarrier. Why is that the FFT generated the subcarrier frequency response? According to Example 1, each sample should be weighted sum of all input ?

Can anyone explain to me whats the connection between two examples?

Thanks and looking forward for your clarification.


texts: Compensating Loudspeaker frequency response in an audio signal

texts:
I have been working on a project in which I was required to work on the audio signals recorded from the loudspeaker kept in front of a filter. So, to simply explain it:

$$\boxed{\rm LoudSpeaker} \longrightarrow \boxed{\rm Filter} \longrightarrow\boxed{\rm Microphone}$$

Now the project depends on finding how the filter reacts to the signals from the loudSpeaker. The loudSpeaker outputs a frequency sweep.

When I saw the datasheet of the loudspeaker I found that it had a certain frequency response which was necessary to compensate within the sweep. But now that I have already taken the readings into the microphone I have to subtract the loudSpeaker frequency response from the final spectrum.

A possible way to that is Deconvolution. But I can only explain that in theory.

Can someone help me how to implement these functions in MATLAB? Or a different way to solve this problem???


texts: Illustration of time domain aliasing cancellation (TDAC, MDCT, lapped transform)

texts:
Can someone find or make a visual illustration of how time domain aliasing cancellation works in lapped transforms such as the MDCT?  I think a graphic would make it a lot easier to understand, and I can't find any.  For instance, this image clearly shows how the overlap-add process combines windowed chunks of a signal into the original signal:

But in MDCT, there is time-aliasing within each chunk?  And somehow overlapping and adding the chunks causes the aliasing to cancel out?

MDCT uses the DCT-IV, which inverts polarity outside of one boundary, so I assume it has something to do with that:


texts:
I am a student learning dsp. I like the subject. I could understand the discrete time signals. When I move into z transform. I could not understand it.

Z transform is the mapping from discrete signal to zplane to make frequency analysis easy. It would be great if users give some tips that could help me to clarify various views on z-tranform on discrete signals.

Text is here to explain about broad answers on z-tranform. I am just looking forward in some tips that can help me understand and approach z-transform in text. Just some lines about what you think about z-tranform will surely help. Thank you mate.


texts: In the figure below, from the book "Principles of Linear Systems and Signals - Lathi", the author uses the notation D to replace the Leibniz's notation $d/dt$, and after that he rewrites the equation, disconnecting the symbol of the derivative, $D$, of its function, considering each as a factor. I don't understand how he did that. Is that mathematically possible?


texts:
The goal is to get a 200ms decaying delay of an audio signal while preserving the sharpness of attacks to mimick human perception of sound. The paper I'm following convolves a 200ms half-Hanning window with each frequency band to simulate it.

I'm using numpy.hanning() since there's no half-Hanning and have tried either setting the first half of the hanning window to 0, the first half to 1, or chopping it off and only using the second half. I'm also normalizing the window to keep scales the same.

Since I don't really know, which one of these would be the "correct" half-Hanning?

The chopping off version, which seems the most likely to me, works but is offshifted 100 ms to the left. Should I just shift it 100ms to the right and call it good?

dataMasked = np.zeros(data.shape)
for i in xrange(freqs.size): # Loop through each frequency band
    winSize = round(0.4/(length/bins.size)) #Calc win size
    hann = np.hanning(winSize)
    halfPoint = np.argmax(hann)
    hann = hann[halfPoint:] #Chop at half
    hann = normHann(hann)
    dataMasked[i,:] = np.convolve(data[i,:],hann,mode='same')

Here's the plot of what I'm getting (blue is raw loudness curve, while green is adjusted).

The paper I'm following shows this:

Thanks!


texts: Downsampling lowpass filter for audio: FIR or IIR?

texts:
I'm working on a real-time audio processing project in which I have to downsample a 44.1 kHz to a yet-to-be-determined lower sampling rate essentially for reducing computational complexity. I'm looking for a decent downsampling filter, and I found articles suggesting both IIR (mainly elliptic) and FIR (mainly minimum phase). FIR minumum phase filter wouldn't necessarily work for me, because I need a linear phase filter. So the options are either linear phase FIR that could have a considerable latency in it or a double-filtering IIR (MATLAB filtfilt command) that first filters forward then backward.

What are some pros and cons of FIR and IIR as downsampling filters? Which is more practical in a real-time application?


texts: How are the scaling parameters included (extracted from) an essential matrix?

texts:
An essential matrix relates corresponding points between two images assuming that a camera satisfies the pinhole camera model, and can be expressed as:
$$E=K'^TFK$$

where K is the calibration and F is the fundamental matrix.

There are many tools to compute the essential matrix, one of them using OpenCV's function findEssentialMat. You are typically returned a 3x3 matrix which contains the transformation (or the $$E=R[t]_x$$ camera pose version). Typically, the translation is directly extracted from the t part, and the rotation matrix has more than one solution.

However, how is scaling represented in the essential matrix?

In case it is, how can one extract it? In case it isn't, how come it isn't> And how should one include it to properly state the total motion between the images' points?


texts: Question about a diagram of PWM detection

texts:
I have this diagram in a book(taken from Slideshare for clarity)
as described in the book PWM is put on the differential to obtain A(as starting of pulse) and B(as the end of pulse)
The A is used to start the integrator and B to stop it, at the same time A work as a clock for the sample and hold, to obtain the PAM signal of PWM
my question is, why A is used as the clock for the sample and hold?! I think B must be used for the clock to capture the amplitude! I don't understand this point!


texts:
For a Face Recognition system which one is better using Neural Network or the Histogram with pattern matching concept ?? which one is more accurate??

I need to integrate the face recognition engine to a Java project so I think it is hard to integrate a math lab project to a java project. So I need to know about Histograms and pattern matching in OpenCv (C++) and Neural Networks. Which one is better??


texts: Difference between order and length of a filter

texts:
Let, the channel be modeled as a FIR model with order L. Mathematically, $y_n = \sum_{k=1}^L h_k u_{n-k} \tag{1}$ where $u$ is the data input to the channel and h is the channel coefficient. In statistics, the model y is known as the Moving Average process with order L. In signal processing, L is known as the length. Consider an example where there are 3 coefficients viz. $h_1,h_2,h_3$

Confusion 1: My confusion is, what is the order for this example? There are 3 coefficients  so the order should be 3. I am confused between these terms - order, length and delays.

Confusion 2: Can somebody please clarify what is the order for this example? Please correct me where I have made any mistakes.

In Matlab I have implemented the equation(1) as follows:

N = 1000;
u = rand(1,N);
for n = 3 : N
    y(n) = h(1)*u(n) + h(2)*u(n-1) + h(3)*u(n-2);
end


texts:
I'm ready to dip my toes in the scary waters of non-aliasing waveforms and wavetables. Ideally, what I'd like to do is create a (naive) wavetable/waveform in memory and subsequently generate band-limited versions of it with a reusable procedure.

Is that possible, and what would be the best starting point for my research?


texts:
I would like to know a short definition of the three fields

Active Vision
Attentive Vision
Machine Vision

For me it is quite hard to find a specific definition in literature. Sometimes authors group two of them together or use any of them as a synonym.


texts: Scipy butter filter - remove DC offset w/ high sample rate

texts:
I am having a hard time figuring out how to employ a high pass filter to remove the DC offset of my data signal with the "scipy butter" function because my sample rate is quite high.  The crux of my issue seems to be that my sample rate Fs is very high and my cut off frequency is very low (ideally just the DC offset component, but could be 1 to 10Hz with a sample rate of 125ksps).
Here is my example code:
import numpy as np
from scipy import signal
import matplotlib.pyplot as plt

# inital parameters
Fs = 125000         # sample rate (if changed to 125sps looks better)
n = 9               # filter order
Fc = 10             # cut off freq (Hz)
Nyq = Fs/2.         # Nyquist freq (1/2 Fs)
Fcc = float(Fc)/float(Nyq)  # normalized cut off freq

# find butterworth xfer functions
sos = signal.butter(n, Fcc, btype='hp', output='sos', analog=False)
# find freq/mag
w, h = signal.sosfreqz(sos, worN=1500, fs=Fs)
#convert to log scale
h_db = 20*np.log10(np.abs(h))

# plot filter response
fig1, ax1 = plt.subplots(1, 1)
ax1.plot(0.5*Fs*(w/np.pi), h_db)
ax1.set_title('db log')
plt.show()

I think this is working like it is supposed to because dropping the sample rate down to 125 instead of 125,000 yields a response that looks reasonable.  I think I'm missing something fundamental here with the Fc vs Fs.
Here is the response plot:

Here is a screenshot of the data I'm trying to apply this filter to:

As you can see there is a DC offset I'd like to filter out of my data file with a high pass filter.  Right now I'm just trying to get the filter response to behave so I'm not worried about processing the data yet - I just added the data file screenshot for reference.  I don't need anything fancy.  So my questions are the following:

Why do I have ringing and such an aggressive response?
How does the low cut off frequency and high sample rate affect the filter response?
Why did Scipy go from the b,a approach in the butter() filter to the "sos"?  I"m curious why they switch to this new sos appraoch.  My understanding is that it is more accurate and/or prevents errors in the b,a approach.  I'm unsure if this is just bolting second order transfer functions together though cascading simpler filters or what.
Also, you can notice (if you print(w) to see my freq axis) that my frequencies seem to run from 0 to 2*pi.  Is that normal or should it be from 0 to pi?
If question #4 is is "yes this should be 0 to 2*pi" than should line #23 in script:

actually be
ax1.plot(0.5*Fs*(w/(2*np.pi)), h_db)

so that my frequency range in the final result/plot runs from 0 to 1/2*Fs?
Thanks for any help!


texts: How to find the impulse response of this system with complex roots?

texts:
I've been working trying to analyze a causal stable system. Hopefully a numeric example such as the one I am working on, and the problems I face during it could be useful to others.

I have this system function:

$$H(z) = \frac{1-\frac{3}{10}z^{-1}+\frac{1}{3}z^{-2}}{1-\frac{3}{5}z^{-1}+\frac{38}{75}z^{-2}+\frac{2}{5}z^{-3}}$$

So I originally thought that since the numerator has the power $z^{-2}$ and the denominator has the power $z^{-3}$ I could use partial fractions, but now I believe that I am wrong to think that. I believe this case is the numerator has a higher degree than the denominator?

I multiplied the fraction through with $\frac{z^3}{z^3}$

$$H(z)=\frac{z^3-\frac{3}{10}z^2+\frac{1}{3}z}{z^3-\frac{3}{5}z^{2}+\frac{38}{75}z+\frac{2}{5}}$$

Well now the numerator has a degree that is the same as the denominator. I think I need to use long division.

I get,

$$H(z) = 1+ \frac{\frac{9}{10}z^2-\frac{13}{75}z-\frac{2}{5}}{z^3-\frac{3}{5}z^2+\frac{38}{75}z+\frac{2}{5}}$$

Factoring the denominator,

$$H(z) = 1+ \frac{\frac{9}{10}z^2-\frac{13}{75}z-\frac{2}{5}}{(z-(\frac{2}{5}+j.711)(z-(\frac{2}{5}-j.711)(z+\frac{1}{5})}$$

After much later I find the coefficients,

$$H(z) = 1+ \frac{1.12+j.273}{z-(\frac{2}{5}+j.711)}+\frac{1.12-j.273}{z-(\frac{2}{5}-j.711)}-\frac{.3805}{z+\frac{1}{5}}$$

Writing it in terms of delays,

$$H(z) = 1+ \frac{(1.12+j.273)z^{-1}}{1-(\frac{2}{5}+j.711)z^{-1}}+\frac{(1.12-j.273)z^{-1}}{1-(\frac{2}{5}-j.711)z^{-1}}-\frac{.3805z^{-1}}{1+\frac{1}{5}z^{-1}}$$

Now taking the inverse Z-Transform

$$h[n]= \delta[n]+ (1.12+j.273)(\tfrac{2}{5}+j.711)^{(n-1)}u[n-1]+(1.12-j.273)(\tfrac{2}{5}-j.711)^{(n-1)}u[n-1]-.3805(\tfrac{-1}{5})^{(n-1)}u[n-1]$$

That was pretty difficult and time consuming for me too. I ended up find some sort of solution but I am not sure if it is correct. Is there an easier way to solve more difficult IIR systems such as these with complex roots? What do the complex coefficients mean? Is there a standard to simplifying these even more? Further more, what would the input output equation of this type be?

UPDATE:
Using part of the example kindly provided below, noting that complex conjugate pairs can be simplified further to obtain an impulse function I was able to come up with the following: (Focusing on the complex conjugate part in particular)

$$H(z) = \frac{1.12+j.273}{z-(\frac{2}{5}+j.711)}+\frac{1.12-j.273}{z-(\frac{2}{5}-j.711)}$$

Which simplifies to,

$$H(z)= \frac{(2.24)-(.9381e^{-j.811}+.9381e^{j.811})z^{-1}}{1-.8z^{-1}+.665z^{-2}}z^{-1} $$

I am going to ignore the extra factor of the delay tacked on at the end. I found a Fourier Transform Pair that particularly looks like this! Not sure if this is what should be done but it looks hopeful!

$$r^ncos(w_0)u[n]<---DTFT--->\frac{1-r \cos(w_0)z^{-1}}{1-2r\cos(w_0)z^{-1}+r^2z^{-2}}$$

rearranging some things to make it fit better with the DTFT pair,

$$H(z)= 2.24\frac{1-(.8375)\cos(.811)z^{-1}}{1-2(.58)\cos(.811)z^{-1}+(.815)^2z^{-2}} $$

Well one thing that is alarming is that my r values (according to the DTFT pair) are slightly off.

The three different values:

$r=.58$ is worrisome.

$r=.8375$

$r=.815$

The other two r values seem like it could be due to averaging errors. But $r=.58$ seems a little too off.

What I think I would do is take the average $r$, though I don't know if this is the right approach, and use that to find the new impulse function for this complex conjugate pair.


texts: How to add noise with given autocorrelation to signal in Matlab?

texts:
My question is a mix of signal processing and Matlab coding.

I have an FIR filter with added noise $w_n$ $$x_n=\sum_{m=0}^{N_h-1}h_mg_{n-m}+w_n.$$

Now the noise $w_n$ has the autocorrelation $$E[w_nw_m]=\sigma^2e^{-|m-n|}.$$

How can I generate this noise in Matlab?

Thanks in advance


texts: How detect if an object is missing from an image and set a Raspberry Pi GPIO output

texts:
I'm pretty new in OpenCv and Python.  I want to detect an image.  If a particular object is missing from the image set a GPIO output using on a Raspberry Pi.
What would be the right way?  I don't want real time monitoring or adiffrent API like TensorFlow.
My plan is to take a picture using the Pi camera and if that object is missing it should set a GPIO output.


texts: "Normalizing" PSD of unequal window lengths

texts:
I am acquiring time-varying data with unequal sampling (nature of the source). When building a spectrogram, I have the algorithm choose sample blocks that are are -nearly- the same length -but, they are never equal. Since the peak widths are a function of the sample block length, this means that although two sample blocks, just separated by one sample (sliding window), can have the same underlying frequency content, the total power (if one is to sum the PSD) is different. This is a problem because sometimes, again due to the nature of the data source, adjacent sample blocks can have vastly different lengths, and therefore there is a large variation in the total power.

One possible solution I have thought of is to take an interactive approach to "normalizing" the spectrum. For each spectral component, I can calculate the goodness of fit. Then, choose the best fit sinusoid and subtract it from the data. Doing this iteratively I will eventually reach a noise floor, where no sinusoid fits the data. (one benefit is that it will remove spurious peaks such as aliases). Then, using the list of amplitudes and frequencies, "rebuild" the spectrum assuming that each peak is the sinc shape and width based on the desired sample block length.

I would appreciate any feedback on this approach, or others to try. I am well versed in signal analysis, but with uniform sampling -where these problems don't show up. And after extensive literature search, I have been unable to find a solution.


texts: recovering phase of sine signal from FFT

texts:
I have a simple sine function as $sin(2\pi ft + \phi)$. I want to obtain the phase signal $\phi$.
I tried to use FFT to calculate $\phi$. In matlab I do the following

f=200; %frequency of sine wave
overSampRate=30; %oversampling rate
fs=overSampRate*f; %sampling frequency
phase = 3/5*pi; %desired phase shift in radians
nCyl = 5; %to generate five cycles of sine wave

t=0:1/fs:nCyl*1/f; %time base

x=sin(2*pi*f*t+phase); %replace with cos if a cosine wave is desired

NFFT=1024; %NFFT-point DFT
X=fft(x,NFFT); %compute DFT using FFT
XX=2*abs(X(1:NFFT/2+1));
[tt ind]=max(XX);
phase_Estimate=angle(X(ind);

This result makes almost no sense to me. For example, when $\phi=0.523$, phase_Estimate is obtained $-0.98$.


texts: Does sampling in the frequency domain cause time-domain aliasing?

texts:
Let's say I have an impulse response $h[n]$.

I analyze the power spectrum of that impulse response similar to fourier transformed $h[n]$ corresponding to roughly $H[f]$.

Now I compare $H[f]$ with some target $H_{0}[f]$ by subtracting $H_{0}[f]-H[f]$.

I create a compensation filter based on this via inverse fourier transform: $\mathrm{ifft}(H_{0}[f]-H[f])$.

But this is inadequate because time-domain aliasing is observed: Why?

What I want to understand is, just as sampling in the time-domain cause aliasing in the frequency domain, is this operation of creating a filter via ifft akin to sampling in the frequency domain and likewise causing aliasing in the time domain?

Or is this because the $H[f]$ was not sufficiently padded and the result is a circular convolution that causes ringing (but is this time-domain aliasing?)

Is this a direct result of the duality of the DFT? In that, just as a sinusoid of a given frequency will show up as a frequency-axis shifted impulse in the frequency domain, an envelope of some frequency will show up as a time-axis shifted impulse in the time domain?

Confusedly yours,
@panthyon


texts: Can someone explain me how to generatee a doppler spectrum?

texts:
I have a signal generated in matlab, with Rayleigh Fading, how can I add a given type of Doppler spectrum ( Gaussian for instance) to that signal ?

Any help will be really appreciated


texts: No of samples 4mega samples per second,using 8 bit ADC,V p_p is6V. calculate frequency and peak power

texts:
This place has been great in helping me to understand my online image and signals class!

I've moved on to another question and wanted to see if I'm correctly grasping the subject.  The next question is as follows:

  If we sample a pure sine signal at "sam" samples per second, and there are 8 samples per cycle of the signal, and we have not undersampled the signal, what is the signal's frequency in cycles per second?

So using the Nyquist-Shannon theorem I know I have a Nyquist rate of $8\frac{samples}{cycle}$ so I believe to calculate the signals frequency in cycles per second I need to do the following:

$8\frac{sam}{cycle} = 2\,f_{max}$

$8\frac{sam}{cycle} = 2\left(\frac{sam}{sec}\right)$

$4\frac{sam}{cycle} = \frac{sam}{sec}$

$\frac{sam}{sam}=\frac{1}{4}\frac{cycle}{sec}$


texts:
I've got an array of different values representing the y-values in a plot:

y-values = [0.07, 0.09, 0.04, 0.15, 0.14, 0.05, 0.02, 0.2, 0.18,...  ...0.06, 0.2, 0.17, 0.19, 0.21, 0.3]

I want to split it in 3 intervals:

the first one should return the values to the first big amplitude (here: [0.07, 0.09, 0.04, 0.15])
the second one should return the values to the last big amplitude (here: [0.14, 0.05, 0.02, 0.2, 0.18,...  ...0.06, 0.2])
the last one should contain the last values (here: [0.17, 0.19, 0.21, 0.3])

I have no idea how to calculate these threshold-amplitudes. Can anyone help me with this problem?

I have to implement this. I originally posted it on StackOverflow, but this is too mathematical as a programming subject, hope I can get some help here.


texts:
In the digital domain a higher sampling will have a better SNR.

Similarly does a narrow filter give a better SNR in analog domain?
Once analog signal is converted into digital signal can SNR be increased? By using a digital filter?


texts: Gaussian filter in terms of pixel radius

texts: So I'm writing an app that blurs and downscales large quantities of images, but all the image processing libraries I've come across define gaussian blurs in terms of sigma and kernel size rather than pixel radius (like an image editing app would do). Does radius relate to sigma and kernel size in some way, or is it an entirely different thing?


texts: Non Periodic, Deterministic Power Signals

texts: Any one know of work on non-periodic but deterministic power signals?  Now one member in this class would be the quasi periodic signals.  I wonder if there is a generalized Fourier analysis of non-periodic deterministic power signals.


texts: How can I describe a sum of sinusoids by an equivalent lowpass signal?

texts:
I consider a sinusoidal signal with fixed amplitude $A_{\rm in}$ and frequency $f_c$.

This signal is sent into a nonlinear amplifier, whose AM/AM and AM/PM characteristics are known. Using these characteristics for the given amplitude, I can determine the output amplitude $A_{\rm out}$ and the output phase $\phi_{\rm out}$.

Now however, I consider a sum of two sinusoids with different amplitudes $A_{\rm in_1}$ and $A_{\rm in_2}$ and different frequencies $f_{\rm c_1}$ and $f_{\rm c_2}$. First, I want to describe this input signal by its equivalent lowpass signal. I want to do this in MATLAB. I know the hilbert() command gives the analytic signal. So I suppose when my first sinusoid is called $x_1(t)$, the equivalent lowpass signal can be described by $\mathcal H(x_1(t)) \cdot \exp(j2\pi f_{c_1} t)$. The same is valid for the second sinusoid. But  I don't know how to represent the sum by an equivalent lowpass signal. In a second step, I want to apply the AM/AM and AM/PM characteristics to the signal. But now, I have two different amplitudes.

I found this:
Consider a multiple carrier input:
$x(t) = \sum(A_i(t)*\cos[(\omega_c + \omega_i)* t + \theta_i (t)],i,N)$

This can be written as $x(t) = A(t)*\cos[\omega_c *t + \theta(t)]$

where
 $A(t) = [x_I^2(t) + x_q^2(t)]^{1/2}$

$\theta(t) = tan^{-1} [x_I(t) / x_q(t)]$
I really don't understand this equation given for the resulting phase. Why is it valid? I mean X_I and X_Q are not just real and imaginary parts of x(t), are they? I know by Euler's formula, that the cos corresponds to the real part of the exponential and the sin corresponds to the imaginary part. But (see below) X_I and X_q are both sums of cos or sin waves of different amplitudes and different phases. How can I just add them?

$X_I(t) = \sum(A_i(t) * \cos[\omega_i * t + \theta_i (t)],i,N)$

$X_q(t) = \sum(A_i(t) * \sin[\omega_i * t + \theta_i (t)],i,N)$


texts: Matlab - Constructing a Cosine wave with IFFT

texts:
My apology if following question is too simplistic to be asked but I have the following code which generates a nice sine wave for me:

N=64;
X=zeros(N,1);
X(2)=-32j;
X(N)=32j;
x=ifft(X);
stem(real(x));

Now I was thinking I should be able to construct a cosine wave in the similar way by changing the X(2) and X(N) values into some real mirrored values say X(2)=-32 and X(N)=32. However, the output is not what I want i.e. a cosine wave


texts: How to classify images based on the amount of colors in the image?

texts:
I have a problem where all images have the same object; however, these objects can either have number_of_colors<=3 OR number_of_colors>3 and images are not labeled.

My attempt starts by converting RGB to LAB and Consider only the A & B to find the color coverage of that image. I was thinking of it as an area on the AB space.   So for every image, I found the range of A and B (i.e max(A)-min(A), max(B)-min(B)) and multiplied them together to get the area, assuming it's a rectangle. Then I threshold using this feature.

Here is the confusion matrix:

TP: 0.41935483871, FN: 0.0645161290323
FP: 0.0967741935484, TN: 0.41935483871

Here is the basic routine the should work per image

    LAB = rgb_to_lab(data_rgb[...,0],data_rgb[...,1],data_rgb[...,2])
    A = LAB[1]
    B = LAB[2]

    minA,maxA = np.min(A),np.max(A)
    minB,maxB = np.min(B),np.max(B)

    diff_A = maxA - minA
    diff_B = maxB - minB

    area = diff_A * diff_B
    # p is the normalized area
    p = area/(200*200.)
    # Found 0.5 to be the best possible threshold
    if p >0.53:
        print 'class 1 - colors > 3'
    else:
        print 'class 2 - colors <= 3'

Please let me know if my intuition is correct and why it isn't working. I have no experience in image processing. I would love to know what is the standard way to do this. I could manually find the range of each color in Hue after converting to HSV but it seems too specific which might not handle all the colors in the test set.


texts: Comparing the control performance of a given closed loop system

texts:
I am having a question about comparing the control performance of a given closed loop. In this link there are some characteristic values that need to be calculated, but there is no description of what they mean or their interpretation for example: the root-mean squared control error and root-mean squared change in the manipulated variable (manipulating effort).

This is the formula for the root-mean squared control error :

$$
S_e = \sqrt{\frac{1}{M} \sum e^2(k)}
$$

Where the $e$ is the error

And root-mean squared change in the manipulated variable :

$$
S_u = \sqrt{\frac{1}{M} \sum \Delta u^2(k)}
$$

where

$$
\Delta u = u(k)-u(\infty)
$$

Could someone please explain their source or their interpretation ?


texts: How to Extract High Frequency and Low Frequency Component Using Bilateral Filter?

texts:
What does High frequency and low frequency component signify in an image.
How to separate out the high frequency as well as low frequency component of an image using Bilateral filter.


texts:
Goal: Obtain the 3-axis accelerations from the Bosch BMI160 IMU when measuring the accelerations of the bogie of a commercial train. The accelerometer used is installed in a PCB and used by an mbed microcontroller. The mbed manages to receive and save the data from the accelerometer at 50 Hz. The BMI160 has some options such as measurement range that can be changed: to avoid sensor saturation the limit is set to ±4g.

Issue: The Z-acceleration (gravity-like oriented) shows an important bias due to unknown reasons. Phenomenon in Figure 1 and 2:

The odd phenomenon can be more easily seen in this picture of the zoom Z-acceleration:

time stamps and $ Acc_z $ data can be found here: https://pastebin.com/raw/4PyAtVU8

It can be seen on it, that the average of that signal is not the gravity value. If it where due to the rotation of the object, a similar effect shall be seen in the other axis. Anyway, this does not seem to be the case, as the vehicle is a railway going forward.

If we calculate the low-pass-filtered signal ($ f_cut = 0.1\ Hz $), the signal is clearly non-oscillating. The expected result should be something more similar to what is shown in purple in the next figure:

Moreover, if we zoom in the last part of the signal, we can see that there are not any particular trends:

Question: Why the bias of the acceleration, which should be a slow-changing as a random variable, causes such a distorsion on the signal? It seems to affect only to big accelerations caused by impacts.

In next figure, you can see more information about the device layout:

The accelerometer (green component) is well fixed to the PCB with strong adhesives. The PCB itself is screwed to some wooden pieces which are also strongly sticked to the plastic box.

The whole device is fixed to the train through duck tape using metal plates for the contact. All componentes are strongly fixed one to each other and we have not observed any relative bouncing between components. The next figure shows the set up:

The blue axis are the vehicle reference system and, as it can be stated with the sign of gravity value, it does not coincide with the accelerometer axis.

I think the phenomenon may be due to an aliasing issue or just a problem with this low-cost accelerometer. Any insight from anybody?


texts: how to handle different durations of audio data?

texts: I am new to signal preprocessing, I read about mel_spectrograms, MFCC's. Now I want to apply it and use the CNN model, But the data which I have for practice is having audio of different durations, now because of this, the mel_spectrograms will be of different shapes. for using them as inputs, the model requires inputs to have a fixed shape. So, what should I do to make them have a specific shape??


texts: When applying a bandpass filter designed in Matlab's DSP system toolbox, is it necessary to do any normalization?

texts:
I'm applying the next bandpass filter to the data of an impulse response coming from .wav; it fades data below 10 Hz and above 400 Hz:

d = fdesign.bandpass('N,Fst1,Fp1,Fp2,Fst2,C',...
                117,9.99,10,400,400.01,10000);
d.Stopband1Constrained = true;
d.Astop1 = 60;
d.Stopband2Constrained = true;
d.Astop2 = 60;

Hd = design(d,'equiripple');    % Passband type
h = fvtool(Hd);    % Filter design plot

Whose plot is:

Original signal vs. filtered signal looks like this:

Resulting signal is pretty much different from original, so I took a look into frequency domain:

As you can see, magnitude order is notoriously smaller in the bottom plot than the top one in this second plot. Considering the first picture, at least for around 200 Hz resulting amplitude might be almost equal to the original one but it doesn't happen (regardless of the amplitude increase after 300 Hz).

Is something missing in my design that causes this differences? Do I have to do any normalization to get an amplitude after filtering similar to the original one? Using 117 as filter's order is the best option to minimize fading.
Thank you in advance for you help.


texts: Is there a program to extract features from an audio signal?

texts:
I am looking for a way to take a .wav file and extract features from it that could be used for further classification (the features could be MFCC statistics, an autoencoder representation, etc.). I know it is likely to be task dependent, but I am looking for some standard set of features that make sense. I am trying to categorize an audio signal (mostly music) into a set of categories such as "quiet music", "thrilling music", etc.

I was wondering if there is existing software (preferably for Linux) that takes such audio signal (such as in a .wav format) and outputs a feature fingerprint.


texts: Analyze stability of a closed loop system with Bode

texts:
How can one know, with just looking at the Bode plots, if the closed-loop system is going to be stable or not?
This closed-loop system is unstable, why?

@DSP Novice
@Jake

It was my fault that the input perturbation was misplaced.

Closed loop stable: Yes .
Thank you.


texts:
The input space has artefacts that are already in a grid-like layout:

I'd like to be able to fit/draw a grid over the artefacts so as to separate them, preferably with lines on average mid-way between neighbouring artefacts:

A bonus would be to tweak the threshold to cluster artefacts that are in closer proximity:

What does one call this method of grid fitting?

Once I know what I'm looking for, a next avenue would be which tools to use to implement this.


texts: Sound quality with really high sampling rate, but really low bit depth with dithering?

texts:
This question is probably more for fun and theory, but how will the sound quality be, if you create a sound with really high sampling rate (like 192kHz) and really low bit depth (e.g. 3bit)?

Can you emulate 44.1kHz/16bit with 192kHz/3bit (+dithering)?

I can probably think this through and post an answer myself with, sound examples computed in MATLAB, but maybe someone has already done that :)


texts: I am a social worker trying to fund some student programmers to build a software to help senior citizens listen to audio on their phones better. The basic idea is as simple as applying selective gains in select frequency bands. I want to know the best tools /platform or even any reference example for doing this - on Android - to start with. Any help / direction will be great.