texts: Clarification for "Digital Signal Processing" by Steven W. Smith related to complex representation of sinusoids

texts:
I have a question related to complex number representation of sinusoids from a book by Steven W. Smith "Digital Signal Processing". The book is made freely available by the author on dspguide.com. The part I have question about is available here, pp.559-563.

Excerpt from the book (p. 560):
A sinusoid is represented by a complex number in rectangular form as follows:
$$
A \cos(\omega t) + B \sin(\omega t) \rightleftharpoons a + jb
$$
where $a \rightleftharpoons A$ and $b \rightleftharpoons -B$.
A sinusoid is represented by a complex number in polar form as follows:
$$
M \cos(\omega t + \phi) \rightleftharpoons M e^{j\theta}
$$
where $\theta \rightleftharpoons -\phi$.
Why change the sign of the imaginary part and phase angle? This is to make the substitution appear in the same form as the complex Fourier transform described in the next chapter. The substitution techniques of this chapter gain nothing from this sign change, but it is almost always done to keep things consistent with the more advanced methods.

What I am confused about is that these two representations are not equivalent. Here is an example following the rules described above for rectangular and polar forms:
$$
\cos(\omega t) + \sin(\omega t) \rightleftharpoons 1 - j = \sqrt{2} e^{-j\frac{\pi}{4}}
$$
$$
\cos(\omega t) + \sin(\omega t) = \sqrt{2} \cos(\omega t - \frac{\pi}{4}) \rightleftharpoons \sqrt{2} e^{j\frac{\pi}{4}} = 1 + j
$$
The rules for rectangular and polar form produce phase angles of opposite sign.
Author gives few more examples on p. 561 (first paragraph in "Complex Represenation of Systems") that show clear discrepancy between rectangular and polar forms considering phase angle.
I am aware that we can take either rectangular or polar form to "be correct", the sign is a convention anyway. But how can both of them be used at the same time?


texts:
As a rule of thumb, the bandwidth of a communication system with a complex signal must be equal to the bit-rate or symbol-rate?

Besides, after reading this post, it is not clear for me how a band-filter or low-filter signal can influence the maximum data rate.


texts: Prove the following DFT for a periodic sinc sequence or ideal lowpass filter

texts:
I need to prove the following DFT for a periodic  sequence or ideal lowpass filter:

$\sqrt{\frac{p}{m}}\frac{sinc(\frac{\pi np}{m})}{sinc(\frac{\pi p}{m})} \stackrel{DFT}{\longleftrightarrow} \begin{cases}
                    \sqrt{\frac{m}{p}},\: if \: |k-\frac{m}{2}|\ge \frac{p-1}{2}\\
                     0, \: otherwise
                 \end{cases}$

But actually, I do not know how to do it. Maybe someone gives me at least a hint?


texts: Working with a sound's magnitude instead of amplitude

texts:
I'm working on a project, where we're recording sound with a piezo-disc which looks a little something like this:

Now, unless we're doing something horribly horribly wrong, I've discovered that we're only recording the magnitude of sound, since a piezo-disc emits a response to pressure, regardless of direction.
This is a sound-recognition project and previously, we'd been working with smartphone microphones. Back then, we could MFCC to perform feature extraction, yet now it looks like some things will break:

I fear that the pre-emphasis step in particular might lead to faulty results.
What kind of an approach could we follow?

Is there a way to "guesstimate" the amplitude from the magnitude?
Assuming that I do skip pre-emphasis, I don't expect the Fourier transform of the magnitude over time to differ from that of the Fourier transform of the amplitude over time. But am I better of skipping it, or fine-tuning it?
I should just ignore all of these concerns and just continue to take MFCC's as usual.

Any other ideas?


texts: Deconvolution of a 1D Signal with Known Kernel (Square Wave)

texts:
I have a signal measured from a radiation detector in a narrow beam of radiation. The peaks I get are quasi-gaussian in shape, see attached picture.

The signal is not a function of time, rather a function of distance. The x-axis is is mm and the y-axis is in arbitrary detector response.

The detector used to measure this signal had a finite width, which is contributing to a broadening of the peaks. What I want to do is deconvolve a square wave of width equal to that of the detector from the signal, hence removing some of the broadening effect.

I am hoping to do this in matlab, however I am having trouble using the deconv function due to each data set being two vectors, x and y, and the fact that each data set is a function of linear distance not time.

Any ideas on how to go about this?


texts: What is the significance of Butterworth filter in image processing?

texts:
Filters like mean,median,gaussian,bilateral and adaptive forms of these filters are used commonly in image processing but not Butterworth filter.
The reasons  I could think of are

a) Butterworth filtering can be done only in frequency domain(AFAIK there is no spatial filtering equivalent for Butterworth filter, correct me if I am wrong)

b) One of the main advantages of Butterworth filter is since there is no sharp cutoff frequency, there won't be any ripples, but since Gaussian also has this property there is no need for Butterworth.

Are there any specific applications Butterworth filter offers advantage over other filters? Do Butterworth have any significance in image processing?


texts: Do waterfalls generate pink (1/f) or brownian (1/f^2) noise?

texts:
Does anybody know if natural waterfalls generate pink noise or brownian noise? I have tried to search about this but the matches are non-scientific and contradictory.

For example

Livescience.com mention Brownian noise to resemble big waterfall.
Soundonsound.com magazine says Pink noise to occur in nature, e.g. waterfall.

Even though it feels weird, it could be that the type of noise is dependent on the size of waterfall, for example by affecting to alpha of the power spectral density of the broad definition of pink noise: $S(f) = 1 / f^{\alpha}.$

Thank you in advance.


texts:
A Band-limited signal is defined as a signal whose Fourier Transform is zero above a specified frequency. Shannon Sampling Theorem is also stated for a strictly band-limited functions,i.e,

  "For a band-limited case, 2W numbers per second are sufficient."

Where, "W" is the max. frequency content.

My confusion is that why band-limit a signal? What would be the situation if a signal is not perfectly band-limited?

My understanding says that unless we have a band-limited signal, we can't get a usable "W" and aliasing would also occur. Does it make sense as an answer?

I think I know answers intuitively, but struggling to frame it in words. Please guide me.


texts: Is there a counterpart for zero forcing in communications in DSP?


texts: Realisation of a passive RC low pass filter

texts:
I have an unusual low-pass filter problem that I would like to realise with a passive RC network (Note 1).

It's easy enough to find prototype filters for passive RLC networks, or for the various active RC filters.

I am having difficulty finding prototype filters for the classic filter types (e.g. Butterworth, Chebychev, Elliptic) that are implemented using such a network.  The closest I have managed to find is this which recommends equal R and C values for each passive in the network:

Hence, I would like to ask

Is there a good reference that covers this sort of design?
Are there any "tricks" or "gotchas" for this design?
What is the design procedure to implement one of the classic filters?

Note 1 - Context:

The design is for a second-order low-pass anti-aliasing filter. A first order doesn't attenuate an annoying periodic glitch enough - and I may yet need a higher-order filter. Board space is very limited and the ADC has a built-in buffer that I would like to make use of.  The attenuation is desirable - the signal is larger than the ADC would normally accept.  Inductors are completely undesirable for the application.


texts: Parabolic fiting for sub-sample precision

texts:
I am performing cross-correlation between two double[1024] arrays. I want to track the correlation's maximum with sub-sample accuracy, so I decided to implement parabolic fitting to my code. I used this class, that seems to work well.

To make this class work I have to feed it with the points I want it to apply to. My question is simple : what are the best points to feed it ? Should I give it the maximum of the cross-correlation and it's direct neighbours ? Should I space them more ? Should I NOT feed it the maximum of the cross-correlation ? Should I limite myself to 3 points, of give it as much as I can ?

Bonus question : if you think this class is not the most suitable and know a better way to implement parabolic fitting to my code, I am open to suggestions.

Thanks.


texts: Derive the LFSR sequence from demodulated bitstream

texts:
I'm new here and hope to have good feedback from you.

I'm trying to blindly demodulate an RF signal and managed to get a sequence of bits for a preamble. After some research, I'm in fact exactly in the same situation as this guy:

OFDM Preamble Ripple Structure in Frequency Domain

My question is: given a bit sequence, how can you derive the LFSR sequence (and initial seed) like he seems to have done here:

https://www.dsprelated.com/thread/2716/semi-blind-ofdm-channel-estimation

Thank you !


texts: Training Fractionally Spaced Channel Estimator and Equalizer

texts: If you are attempting least squares channel estimation with a fractionally spaced channel estimator, do you want the training sequence to also be fractionally spaced or symbol spaced? It looks like you could do either.


texts: Choose the right Sigma for Gaussian filter

texts:
I have the following problem: I have a time series with counted data. I now want to smooth it using a Gaussian low-pass filter. Is there a method to determine the sigma value? The window should have a size of 365. The data set contains 2191 entries.
In the present study, from which I got the idea, only the filter weights are mentioned. Is this perhaps what is meant by this? It was described with: "required filter weights can be calculated from the standardized normal distribution and its density function". If so, how should this work (I get at the end a function and not a discrete value that I can use for sigma)?


texts: How to match zero-pole diagrams to their frequency responses (Discrete Time)

texts:
I get confused when there are a lot of zeros/poles in the zero-pole diagram and I find difficulty understanding their frequency response.

I know the following:
1. Complex conjugates cause double peaks at their respective angles. The larger their magnitude, the sharper their peaks.

A single pole causes a peak at its respective angle. The closer it is to the unit circle the sharper the peak in the frequency response.
A single zero causes a dip at its respective angle. The closer it is to the unit circle the sharper the dip.

I am not sure how to deal with zero pole diagrams when they come in bundles as shown below where it is asked to match each zero-pole diagram to its frequency response.

My trials:

I matched:

Frequency Response 3 to Zero-Pole Diagram 2

Frequency Response 6 to Zero-Pole Diagram 3


texts: Calculate amplitude of noise added Sine Gaussian signal from frequency domain

texts:
How to calculate the time domain amplitude of noise added Sine Gaussian signal from corresponding frequency domain. Here time domain amplitude is 2. How to get this from frequency domain.

N = 4096;
Samplingfrequency= 1024;
timelength=N/Samplingfrequency;

% Generate random
Noise=rand(1,N)*.1;

t    = linspace(-timelength/2,timelength/2,N);
Freq=(1/timelength)*[0:N/2-1 -N/2:-1];

signalFrequency = 64 ;
amplitude=2;
Q=10;
tau  = Q /(2 * pi * signalFrequency);

%Sine Gaussian
Gaussian=((amplitude*exp(-1 .* ((t)/tau).^2) .* cos(2 * pi * signalFrequency .* t))+Noise);

%Time Domain
subplot(2,1 ,1)
plot(t,Gaussian);

%Frequency Domain
FFTGaussian=abs(fft(Gaussian));

subplot(2,1 ,2)
% One sided frequency domain plot
plot(Freq(2:N/2),FFTGaussian(2:N/2));


texts:
I have asked the same question in stackoverflow ,https://stackoverflow.com/questions/17794772/steps-for-successful-image-recognition/17840975?noredirect=1#17840975,  but since I am not getting considerable responses , I'm going to ask it again here .

In order to do successful image recognition what are the steps one has to follow ,for example denoising , use of LDA , PCA , then use of neural network . I am not looking for any algorithm , just a brief outline of each of the steps from capturing an image to test an input image for similarity.


texts: Determine fundamental period from zero crossing signal

texts:
I have got a signal which consists of zero crossings over discrete time and I would like to estimate the fundamental frequency (period) from this signal in order to remove noisy samples.

The signal is about 500 to 1500 samples long and has about 10-50 zero crossings, e.g. x[93] = 0; x[183] = 0; x[244]; x[282]; x[310]; x[439]; x[502]; x[515]; x[570]; x[590]; x[640]; x[635]; x[650]; x[710]; x[740]; x[835]; x[850]; x[905]; x[915]; x[980]; x[1050]; x[1110];

The output should be zero crossings again or their fundamental period, but without the "noise". I'm only interested in the position of the "new" zero crossings.

I'm also not quite sure, how to model a zero-crossing signal for further processing.

Thanks for any ideas.


texts: Is wavelet analysis useful for 1D signals?

texts: Wavelets seem to be very useful for image processing. Assuming that I'm only ever going to study signals of time, i.e. 1D signals, should I still take a course in wavelet analysis? Are they applicable to 1D signals?


texts:
Can a CDMA PN sequence be fully random, as in encryption-grade randomness, or must it be deterministic? I have tried the first bytes of SHA-256 hashes as PN sequences, but somehow they don't coexist too well.

I know a deterministic code can be generated on-the-fly so no storage is needed, but let's say I have 500 fully random PN sequences stored on a device. Is that good or do you really need deterministic codes like the Gold codes?


texts:
Im studying the DSP book by Steven W. Smith. On page 41 he covers the Nyquist frequency. He makes up an example by writing the following.

  ... consider an analog signal composed of frequencies between DC and 3kHz.

What does that mean? My guess is that in this context DC is equivalent to zero. Why does he use DC here?

Sorry if this is totally obvious.


texts: Showing frequency and amplitude after doing an FFT on a signal

texts:
I have executed an FFT on a .wav file of a person saying "ahhh" which shows the frequency and amplitude of the audio file.  When I run it on a .wav file it shows the frequency 0 Hz as having the highest amplitude.  I'm not sure where the problem is within my code and how I can fix it.

How does 0 Hz have the max amplitude?  The reason I'm trying to fix this is that I want to find the frequency with the highest amplitude in the wave file then run some calculation against it but running calculations against 0hz doesn't make any sense to me especially when I have to do multiplication with it.

When I look at the array_sort variable it says the frequency is 0hz and 0.117341 as it's amplitude.

Here's the wave file and .m file I'm using
http://dl.dropbox.com/u/6576402/questions/fft/11262012_44100ahh.wav

http://dl.dropbox.com/u/6576402/questions/fft/test_rtfftphase_question.m

clear all, clc,clf,tic
dirpathtmp=strcat('/tmp/');
[vp_sig_orig, fs_rate, nbitsraw] = wavread(strcat(dirpathtmp,'/nov26/11262012_44100ahh.wav')); %must be mono
fs=fs_rate;

t_rebuilt=linspace(0,2*pi,fs); %creates same size time for new signal as orginal signal good for error checking

vp_sig_len=length(vp_sig_orig); %get sample rate from vp fs_rate needs to be an even number?

% Use next highest power of 2 greater than or equal to length(x) to calculate FFT.
nfft= 2^(nextpow2(length(vp_sig_orig)));
% Take fft, padding with zeros so that length(fftx) is equal to nfft
fftx = fft(vp_sig_orig,nfft);
sigfft= fft(vp_sig_orig);
sigifft=ifft(sigfft);
sigphase = unwrap(angle(sigfft')); %get phase of orginal signal
% Calculate the number of unique points
NumUniquePts = ceil((nfft+1)/2);
% FFT is symmetric, throw away second half
fftx = fftx(1:NumUniquePts);
% Take the magnitude of fft of x and scale the fft so that it is not a function of the length of x
mx = abs(fftx)/length(vp_sig_orig); %replaced for testing from stackexchage

if rem(nfft, 2) % odd nfft excludes Nyquist point
  mx(2:end) = mx(2:end)*2;
else
  mx(2:end -1) = mx(2:end -1)*2;
end

amp=mx;
ampinv=abs(amp-max(amp));

% This is an evenly spaced frequency vector with NumUniquePts points.
freq_vect = (0:NumUniquePts-1)*vp_sig_len/nfft;
freq=freq_vect';

%get phase of new signal
phase = unwrap(angle(fftx)); %get phase of orginal signal
array=[freq,amp];
array_sort=sortrows(array,-2); %sort by largest amplitude first

I'm using Octave 3.2.4 on Linux Ubuntu 64bit.


texts: Black “grille” after stereographic projection+rotation

texts:
When I do a stereographic projection and rotationX of omnidirectionnel image, I get this image:

My question is why I get that "grille" in the image, it appears only when I add rotation


texts:
I simulate a transmission channel in Matlab. I want to add pathloss ($PL=100\textrm{ dB}$) to the signal TX.
here is the code edited

PL=100;
snrdb=10;
snr=10^(snrdb/10);

L=length(TX1);
REC1=TX1+sqrt(1/(2*snr))*(randn(1,L)+1i*randn(1,L));

can anyone help regarding the pathloss effect!


texts: $\mathrm{FFT}$ generates non-linear noise

texts:
I followed the tutorial for generating the frequency spectrum of a signal here, and for testing I generated a sine signal with the frequency of $440 \textrm{ Hz}$. That resulted in the time domain in the following picture:

And when I convert it into the frequency domain, I get:

My question now is:

Why is the background noise shaped like it is?
I would have expected a more even noise, or rather a linear shaped noise. Where does this shape come from?

Edit concerning the technical data:

Sample rate is $44100\,\textrm{Hz}$, which should be enough
FFT length is identical to the signal length, i.e. 1323000 points.


texts: Why would a time shifted signal have a higher maximum frequency than an unshifted one?

texts:
I´m reading the book Numerical Simulation of Optical Wave Propagation by Jason Schmidt.
In section 2.1-2.2, the author performs the FFT of a centered and a shifted Gaussian pulse and makes the statement that the time shifted signal has a higher maximum frequency than the unshifted one. For that reason more samples are required in getting the shifted signal spectrum.
Why does the time shifted image have a higher highest frequency? I don´t understand.
How much I should increase my sampling rate for a given time shift?
Thanks for your attention.
Carolina Rickenstorff


texts: PID Control - process variable / setpoint

texts:
I'm trying to design a PID controller but I have a problem in the following case:

The process variable can only be between 0 and 1.
The setpoint can be close to one, for instance 0.97.
Hence the lowest possible error is -0.03  (0.97 - 1), and the maximal error 0.97 (0.97 - 0).
As a result, the controller output usually decreases much more slowly than it increases.

I would like it to be able to decrease faster, with the same set point. Is there a correct way to do that? Of course I could multiply the error by some constant only when it's negative, but I'm not sure it's right to do that (I don't have a lot of experience in control theory).

Thanks!


texts:
I'm kind of confused about digital transmission.

Is the bandwidth occupied by some digital signal the Fourier spectrum of the bit (pulse) format,or the one determined by the bit rate?


texts:
How can I remove a biphasic, square-wave-like artifacts from the signal, so I'll keep as much as possible information "under" the artifact? Below is the signal with artifacts:

The artifacts are those two big spike-like pulses. They are caused by square-wave pulses applied to the skin in neighborhood of recording electrodes.


texts: Quantifying how good I'm producing a spectral density

texts:
I recently asked a question here on how to create noise with a specific spectral density $S_{xx}(f)$. The helpful people of this stack exchange told me one way to do it was filtering white noise with a unitary spectral density using a filter with impulse response $H(f) = \sqrt{S_{xx}(f)}$ and then suggested how to do this. The way that was proposed was using a frequency sampling based FIR filter. As I use Mathematica the idea was to use FrequencySamplingFilterKernel.

Now, this seems to work reasonably well qualitatively, but I am trying to find a way of quantifying this. So my question comes down to how I quantitaviely test how well the noise produced with my filter resembles the desired spectral density.

To take a specific example, I am trying to produce (not exclusively, but to begin with) the Ornstein Uhlenbeck spectral density given by $S_{xx}(f) = \frac{2c\tau^2}{1+(2 \pi f)^2}$. So I suppose it is the easiest if I just show my work and then get to my specific question. What I did was generate the amplitudes

Γ = 10; (* bandwidth of Lorentzian*)
P = 2; (* std dev of noise *)
τn = 1/Γ;(* relaxation time of OU process *)
c = 2 P^2 Γ;(* diffusion constant of OU process *)
S[f_] := (2 c τn^2)/(
 1 + (2 Pi f  τn)^2); (* power spectral density *)
K = 100; (* number of frequency components taken into account *)
fmax = 5; (*max frequency*)
Δf = fmax/(K - 1);(* freq step *)
fk = Range[0, fmax, Δf]; (* sampling frequencies *)
FilterAmps = Sqrt[S[fk]]; (* Amplitudes for the FIR filter *)

The parameter choices are arbitrary, and definitely not necessarily what I want to do in practice, but that shouldn't matter too much for now. I then generate some white noise (the times list is not needed at this point, but I'm just doing it to keep track of what I'm doing for now):

Ns = 1000; (* number of time points generated; output time points \
after filter is n = Ns - 2K + 2*)
Δt = 1/(2 fmax); (*Nyquist rate*)
Tmax = (Ns - 1) Δt;
times = Range[0,
  Tmax, Δt]; (*Using Nyquist rate as step size*)
UnitDataWhite =
 RandomVariate[NormalDistribution[0, 1], Length[times]];

Okay, great, so then we filter

FilteredNoise =
 ListConvolve[FrequencySamplingFilterKernel[FilterAmps],
  UnitDataWhite];
FilteredTimes =
 Range[0, (Length[FilteredNoise] -
     1) Δt, Δt];

Giving me a dataset of $n = N - K + 2$ noise datapoints which should behave according to the spectral density of the Ornstein Uhlenbeck process. The problem is, how do I quantify how well this works? The first thing that came to mind was just constructing the power spectral density and seeing how well it agreed with theory. Well, there I ran into my first real meeting with the fact that one does not simply find the power spectral density from a dataset to some arbitrary degree of precision. Mathematica has a built in function periodogram which is supposed to do this, but while the shape is definitely as desired, is not exactly.

Okay, so then I thought perhaps it is too much to ask to reconstruct the spectral density in this way. Should I look instead at other quantities that carry the same information, such as the autocovariance? For the OU process this is given by $C_{x}(t) = \frac{c\tau}{2} e^{-t/\tau}$ so that's also relatively nice. But calculating the autocovariance with CovarianceFunction again runs into amplitude trouble, so that doesn't seem like a good method either.

So in the end my question boils down to this. Creating noise with a spectral density using the way I described here, how do I reliably quantify how well I am succeeding?

*Note that I know that there are nicer ways of creating OU noise, but I am trying to construct a method for general spectral densities


texts:
On page $359$ of the 2nd edition of the book "Signals & Systems", by Oppenheim and Willsky, the authors wrote the following words:

"Consider a general sequence $x[n]$ that is of finite duration. That is, for some integers $N1$ and $N2$, $x[n] = 0$ outside the range $-N1\leq n\leq N2$. A signal of this type is illustrated in $\text{Figure}\; 5.1\:(\text{a})$"

My three questions are:

Regarding $x[n]$ in the figure, do the leading and trailing zero-valued samples exist?
If the leading and trailing zero-valued samples exist, then what is the duration of (how many samples are in) the finite-duration $x[n]$ sequence?
If the leading and trailing zero-valued samples do not exist, then why are they shown in $\text{Figure}\; 5.1\:(\text{a})?$


texts: Finding the z-transform of $h[n] = a^n\cos(2\pi \frac{n}{F_s}f_0)$ for $n ≥ 0$ and zero for $n < 0$

texts:
So I'm trying to decide whether the cosine part is intended to be plugged in for $z$ or whether it is strictly part of $h[n]$. (the number a lies in the open unit disk)

I mean I was pretty sure it was all part of $h[n]$ but then upon performing the z-transform I get this rational function

$$\frac{1 - a\cos(2\pi\frac{f_0}{F_s})z^{-1}}{1-2a\cos(2\pi\frac{f_0}{F_s})z^{-1} + a^2z^{-2}}$$

The thing is then I'm supposed to evaluate the poles and zeros and if you just ignore the cosine parts you get this really nice rational expression which factors and simplifies down to $\displaystyle\frac{z}{z-a}$.

So that has gotten me thinking that maybe I'm not understanding things correctly and the cosine portion is supposed to be plugged in for $z$ or something.  Can anyone clarify this for me?


texts: How to Plot Summation of Shifted impulses in MATLAB?

texts:
I am trying to plot the following equation in MATLAB:-

I am not sure how to write the following summation equation in MATLAB.


texts: The difference between tensorflow stft and scipy stft

texts:
I'm trying to wrap my head around stft, and checking the docs, tf.signal.stft and scipy.signal.stft seem to do different things.
Can you please explain the difference and how to have the same result?
Thank you


texts: Using Pilot tones to estimate carrier frequency offset in ofdm

texts:
I have been studying carrier frequency offset estimation techniques in OFDM systems. I have understood several of them. when using Pilot tones, as stated in paper (1), the process involves two methods namely: acquisition and tracking modes. a large range CFO is estimated in the acquisition mode while in  the tracking mode, only fine CFO is estimated.
I have confusion, What are the nature of those Pilot tones? how are they being generated?
the authors of the paper wrote equation (18) without any derivation? can I get the system model for this technique?
the questions may sound easy, but I really need it. Thanks in advance.

Reference:
(1) Praween Kumar Nishad,  P. Singh, "Carrier Frequency Offset Estimation in OFDM Systems", National Institute of technology
http://dspace.nitrkl.ac.in/dspace/bitstream/2080/1928/1/ID-451_praween.pdf


texts: FFT, padding, IFFT and plot in time domain

texts:
I performed an FFT with some zero padding and would like to transform it back to time domain. When I plot the signal it looks wrong. Is it because of the padding used in the FFT? How can I make it right? here is my code for doing the IFFT:

NFFT=4301;
AvIFFT = ifft(FFTavg.dat,NFFT);
plot(real(AvIFFT))

And I get this plot:

Any help would be greatly appreciated! Thank you!

ps: I have asked this question on matworks but no success as yet.

EDIT:

As suggested in the comment and answer below, I tried fftshift:

NFFT = 4301;
FFTshifted = fftshift(FFTavg.dat);
AvIFFT  = ifftshift(FFTshifted,NFFT);
plot(real(AvIFFT))

Here is the plot:


texts: What are some typical lossless compression ratios?

texts:
A client was trying to send me 250 GB worth of files. After attempting various ways of sharing the data, he sent me a zipped folder only 4 GB in size. That sounds like too much compression to me--I don't think when I've zipped things I've ever reduced more than 20% of the size.

What are some typical lossless compression ratios that one would see in practice? (Or alternatively, a range.)

UPDATE: I realise it's impossible to say without being able to guess at the actual information content, so perhaps this was an ill-worded question. I can't share the client's data. But looking at the XML files, there are a lot of repeated phrases e.g.

<thing>
    <property="1" value="2" />
    <property="3" value="4" />
    <property="5" value="6" />
    <property="7" value="8" />
    <property="9" value="10" />
    <property="11" value="12" />
    <property="13" value="14" />
</thing>

which does seem quite compressible.


texts: DOA estimation of moving, radiating source in the near-field with nonuniform Doppler shifting

texts:
I am trying to estimate the DOA of a radiating source using two passive sensors.

In the case of a stationary source, I find the lag $k$ of the maximum in the sample cross-covariance sequence $E \lbrace x(t) y(t-k) \rbrace$ between both Signals $x(t)$ and $y(t)$ and relate this delay to the DOA using a trigonometric relation.

Now I have the problem of a moving source which causes both time signals to be stretched or compressed on the time axis depending on whether the source is moving towards or away from the sensor. Furthermore, the source is close to the sensors. Therefore, $x(t)$ can be compressed and $y(t)$ stretched or any other combination. This causes the correlation of both Signals to become smaller.

Question:  How do I estimate the DOA using both time series in the presence of nonuniform stretching/squeezing?


texts: Calculation of channel autocorrelation for LMMSE

texts:
I am currently trying to implement an LMMSE estimator/equalizer for a python based ofdm receiver. The actual reception is done with a SDR and iq-samples are stored in a file for the "ofdm-receiver" process in Python.

LMMSE theory

I've read through a multitude of resources. The final (simplified) formula for LMMSE i am trying to implement is (Edfors et. Al.):

$\hat{H}_{LMMSE} = R_{HH} (R_{HH} + \frac{\beta}{SNR}I)^{-1} \hat{H}_{LS}$

$R_{hh}$ denotes the Channel autocorrelation, $\beta$ is a modulation mapping dependent constant, $SNR$ the signal to noise ratio, $I$ an identity Matrix and $\hat{H}_{LS}$ the Least Squares channel estimate.

I've accomplished the computation for all the elements successfully (I think) except for the channel autocorrelation matrix. I am not shure how to compute this matrix correctly. As I dont have the true channel coefficients $H$, I intend to use the estimate $\hat{H}_{LS}$ instead. That LS-estimate is obtained by using the Long Training Sequence (LTS) from the preamble. $R_{HH}$ is computed as:

$R_{HH} = E\{HH^H\}$
with $(.)^H$ beeing the Hermetian operation.

I am working with a SISO system, so I only have one vector of estimated channel coefficients $\hat{H}_{LS}$ with dimensions $(64\times1)$. I've tried using numpys correlate function as well as the corrcoef function. So far, the resulting $\hat{H}_{LMMSE}$ is always incorrect and leads to worse equalization than using only the $\hat{H}_{LS}$. I would try to implement it manually, but I dont know how I would go about that. I know, that for equally propable outcomes of a random variable, the expectation simplifies to the arithmetic mean of all outcomes. So from Wikipedia: Autocorrelation and this StackExchange answer i conclude:

$R_{HH} = E[HH^H] = E\begin{bmatrix}
\begin{bmatrix}H_1 \\H_2\\ \vdots \\ H_n  \end{bmatrix}
\begin{bmatrix}\bar{H_1} \bar{H_2} \dots \bar{H_n}\end{bmatrix}
\end{bmatrix}
= \begin{bmatrix}
E[H_{1}\bar{H_{1}}]\quad E[H_{1}\bar{H_{2}}]\quad \cdots\quad E[H_{1}\bar{H_{n}}]\\
E[H_{2}\bar{H_{1}}]\quad E[H_{2}\bar{H_{2}}]\quad \cdots\quad E[H_{2}\bar{H_{n}}]\\
\vdots\quad\quad\quad  \vdots\quad\quad \ddots\quad\quad \vdots\\
E[H_{n}\bar{H_{1}}]\quad E[H_{n}\bar{H_{2}}]\quad \cdots\quad E[H_{n}\bar{H_{n}}]\\
\end{bmatrix}$

For complex valued random variable $Z$.
I've come to understand (StackExchange), that $H_1 H_2 \dots H_n$ are not the actual realizations of my random variable $H$ but rather random variables on their own.

My Question

I don't really understand how to compute/implement the auto-correlation matrix $R_{HH}$. I saw that one would have to estimate it (Wiener Filter?) but I don't understand how to apply it to my ofdm case.
What dimensions should the identity matrix $I$ have?
My $SNR$ calculation follows (Edfors et. Al.):
$SNR = \frac{E[\mid x_k \mid^2]}{\sigma_n^2}$
Where I interpreted the term in the numerator as the signal energy. Is that correct?

NOTE Maybe it is useful know that I don't have to realize a real time performance, since I am working on prerecorded data.

Thank you for your time and help!
Cheers
Lucas


texts: How to remove sum and difference terms while computing frequency from fft?

texts:
I am currently operating in vhf band AND trying to detect frequencies using Fast Fourier transform thresholding method. While detection of multiple frequencies , i received spurs(May not appropriate word) in addition with original frequencies, Such as in case of f1,f2 that are incoming frequencies i also receive their sum f1+f2 and difference f1-f2.

i am trying to eliminate these using thresholding method but i can't differentiate them with real real frequency magnitudes. Please suggest me some method, or methodology to eliminate this problem

Input frequencies F1, F2 Expected frequencies F1,F2 Receive frequencies ,F1,F2,F1-F2,F1+F2


texts: What is the "waterbed effect" in control system design?

texts:
I recently stumbled across some notes on the "Waterbed effect" in some notes by A. Megretski for an MIT course on "multivariate control systems". Here's an excerpt:

  A common effect, usually associated with unstable zeroes and poles of the open loop plant, makes it theoretically impossible to make certain closed loop transfer functions “small” simultaneously at all frequencies: if amplitude of the frequency response is reduced in one part of the spectrum, it may have to get larger in the other part. This effect, sometimes called the waterbed effect, can be explained mathematically in terms of integral inequalities imposed on the closed loop transfer functions. In the basis of such results is the affine characterization of all possible closed loop responses, as well as the Cauchy integral relation for analytical functions.

I don't think I've ever heard of this before. Could someone explain the effect in more practical terms?  When am I likely to encounter this effect in practice?


texts: What impact have different types of border-handling on high pass or low pass filtering?

texts:
When high or low pass filters are being applied to an (grayscale) image, the borders need to be handled separately. They could be filled with 0's or 255's (b/w), repeat the nearest pixel value, or even the image could be repeated.

How do the different border-handling-methods impact the result of he filtering operations? What are the pro's and con's of using one method over an other with a HPF to improve the edges in a picture or a LPF to blur it?

OpenCV for example has various BorderTypes like BORDER_REPLICATE or BORDER_CONSTANT but I can't find any information about what happens when I use one of them with a HPF or LPF.


texts:
I'm trying to understand the professor who wrote about Q2-fixed-point number 1.01 and 1.11 which should be multiplied. I don't understand anything.

    Multiply the Q2-fixed-point number 1.01 and 1.11 and give the result as a Q4-number. Answer:

1.01 * 1.10
-----------
 0.01    (2-komplement of 1.01)
   0
 1.1111
-----------
10.0011 (sign extension)
 0.0011

  The result of the multiplication is a positive number. Thus 1.01 is
  negated by adding the boolean complement to 1. The final result is
  0.011. This can be verified using decimal multiplication. The
  Q2-number 1.01 is -0.75 in decimal base 10 and the Q2-number 1.10 is
  -0.5 in decimal. Thus the result is 0.375 which is represented as the Q4-number 0.11.

I don't understand the above at all. I understand that 1.01 is -0.75 and that 1.10 is -0.5_10 in decimal but why use 1.10, where does it come from? Why use the 2-complement in the first place? What does the calculation mean? What does the zero mean? It is the most confusing "answer" I've ever seen.


texts:
I'm trying to calculate (with Matlab) the minimal and maximal Eigenvalues $\lambda_{min}$ and $\lambda_{max}$ of the autocorrelationmatrix $R$ to adjust the stepsize of an adaptive filter.

My input signal $x$ is a vector of colored noise.
And my plan is to do something like

lmin = min(eig(xcorr(x)));
lmax = max(eig(xcorr(x)));

But it fails becaus 'For standard eigenproblem EIG(A), A must be square.'

I think this is a little bit strange, because in my opinion the output of the autocorrelation is always just a vector.

Please help me to find the point, whether I need to use something else than Matlabs 'eig' function or if it's mathematically not possible to calculate the eigenvalues of a single vector.


texts: Find the relation between two noisy periodic signals of equal length

texts:
[Thank you, @leftaroundabout for your helpful comments to my related question. I'm trying to ask a less confusing question here.]

$0\leq\phi\leq 2\pi$ is a parameter that theoretically describes a system. $\alpha=\sin(\phi)$ and $\alpha' = \cos(\phi)$ are observables.

In a measurement, $\phi(t)$ is a continuous periodic function of the time $t$. $\alpha$ can be directly measured and $A_i$ is a noisy over-sampled digital representation of such a measurement. $\beta$ is a different observable, the relation between $\beta$ and $\phi$ shall be studied. $B_i$ is a sampled synchronously with $A_i$ and noisy.

Three questions are interesting and the answer shall be found from $A_i$ and $B_i$:

What is $\delta = \beta(\phi=-\pi/2) - \beta(\phi=+\pi/2)$? This the difference of the $\beta$ values corresponding to the extrema of $\alpha$.
Is $\beta = a * \alpha + c$ a valid model and what is the coefficient $a$?
Can we give a confidence interval for $a$ or $\delta$?

Inspection of the data shows that a better model for $B_i$ is $\beta' = a * \alpha + a' * \alpha' + c$. Does this affect the recipe to find $\delta$ or $a$?

A third alternative model is $\beta'' = f(\phi) + c$. How to reliably find $\delta$?

The nature of the noise is unknown. The noise spectrum has both frequencies less then the modulation frequency of $\phi$ and higher frequencies. A Fourier filter (e.g. lowpass) renders $A_i$ and $B_i$ reasonably smooth.


texts:
Could someone please explain how the 4G LTE OFDM measures and corrects the sampling frequency offset?
I can see a number of algorithms proposed in the literature, but I am trying narrow it down to the actually implemented ones.
Thanks in advance.


texts: Multiple different length Windows for high resolution realtime FFT

texts:
I am looking at trying to achieve a 'realtime' (as quick as possible to acquire, process and present data) FFT application to analyse audio.

I have setup my app to acquire a set of samples, apply a 50% overlap window function, zero pad, compute FFT, extract magnitude and phase and display these.  Currently I can do this with no issues, and minimal latency to the incoming signal.

However, as I have chosen a small sampling window (2048 samples) to achieve a fast time, I realise that this hinders resolution.  I am also aware that there is only so much zero padding can achieve, if the acquired data is not there to begin with.

So my question is to do with how to achieve a better resolution for lower frequencies.  It is my understanding that for accuracy, the time window should contain at least one cycle of the lowest frequency.

Is there a way that I can perform multiple FFTs on a signal with varying lengths and 'glue' the resultant FFT together. ie, a longer FFT will do the lower frequency range, and a shorter for the higher range.  And if I can do this, will this retain phase information, or will I lose this completely?


texts: What kind of periodic signals cannot be represented with the Fourier Series?

texts:
Oppenheim et al. state in Signals and Systems that there exist periodic signals which cannot be represented with Fourier series. What signals are these?

  Although Euler and Lagrange would have been happy with the results of Examples 3.3 and 3.4, they would have objected to Example 3.5, since x(t) is discontinuous while each of its harmonic components is continuous. Fourier, on the other hand, considered the same example and maintained that the Fourier series representation of the square wave is valid. In fact, Fourier maintained that any periodic signal could be represented by a Fourier series.

Oppenheim et al, Signals and Systems, Prentice Hall, Second Edition, Page 195.


texts: Low-pass filter with varying cut-off frequency over time

texts:
Is there a novel way to create a low-pass filter (Finite Impulse Response Filter) with varying cut off frequency over time?

For example, I have a white noise that is 10 seconds long sampled at 44.1 kHz. I want to create a low-pass filter that will have a varying cut-off frequency over time. At time 0 my cut-off frequency would be 100 Hz and will decrease linearly down to 1 Hz at time 10 seconds.


texts: How to Solve Image Denoising with Total Variation Prior Using ADMM?

texts:
I was looking at some articles or Wikipedia on denoising images using the Total Variation norm. The setup is the Rudin Osher Fatemi (ROF) scheme, and the corresponding equation is:
$$
F(u)=\int_{\Omega}|D u|+\lambda \int_{\Omega}(K u-f)^{2} d x
$$
Some of the sources mentioned using the ADMM optimizer to solve this denoising problem. But I was hoping that someone might be able to direct me to some code to show an implementation of this approach. Code in MATLAB, Julia, or Python would be excellent, just something to get started with.
Thanks.


texts: How can I shape my time channel response, in order to have Gaussian shaped Doppler Spread?

texts:
I know how to generate a Rayleigh fading channel but I have no clue how I can shape the Doppler spectrum to be Gaussian.

Any help will be really appreciated.

ps: I am coding on matlab


texts:
Please consider this piece of code:

clc;clear all;
fs=10^3;
t=linspace(0,1,fs);
f=2;
x=sin(2*pi*f*t);

W=dftmtx(fs);

X=fft(x);

X(3)
X(end-1)

%check : imaginary parts are 180 degrees dephased but right frequency
%plot(imag(W(end-1,:)));hold on; plot(imag(W(3,:)))

Xrec=(1/length(X))*(X(end-1)*W(3,:)+X(3)*W(end-1,:));

plot(x,'+g');hold on;plot(Xrec,'r','LineWidth',1.25);

The idea is to show (for my personal understanding) that we can reconstruct the pure sine wave x (of frequency 2 cycles) with the only 2 Fourier coefficients (corresponding to the 2 spikes we see in the spectrum) i.e. a negative frequency = -2 and a positive frequency = 2, for this example.

It seems to work well with the line:

Xrec=(1/length(X))*(X(end-1)*W(3,:)+X(3)*W(end-1,:));

Where I want to show that the signal x can be reconstructed by the weighted contribution of W(3,:) and W(end-1,:) (which I found to correspond to +freq and -freq (+2/-2)). This is the point of view of linear algebra where the vector x is a linear combination of the basis vectors W(3,:) and W(end-1,:) with the complex weights X(3) and X(end-1).

Is this explanation correct?

Moreover, there is the perspective of "matched filter", i.e. correlation. From this point of view we should have only contribution of the 2 frequencies aforementioned here 2/-2. But I still get some non-zero correlation when doing e.g. :

W(555,:)*x' =  -0.0063 - 0.0011i

... i.e. W(k != 3 or 999) (which are the indexes corresponding to freq=2 or freq=-2)

its small but not zero, so I would then to think that these have some contribution to the signal yet the should not ?


texts: Academic problem solving in Computer Vision

texts:
I am currently pursuing a Master degree of Engineering and I will have to write a thesis about solving a specific Machine Vision application. I have done some CV projects in the past but now I am tinkering about the methods of problem solving in the broad field of object detection. What I noticed is that it looks like there are about two kind of people trying to solve CV problems and asking about them on a SE site.

The first kind of people needs to solve a specific problem (like, finding faces or horses or else in a picture) and is asking questions like "Oh, I need to find an algorithm to detect face" or "How can I detect cars with SIFT and OPENCV".

The second kind of people is writing academic papers on some new algorithms (like SIFT, ORB, etc.). They might have questions like "How to best compute the Hamming distance" or else.

Both kind of people and questions are relevant and fine to me (if my opinion matters). I wonder though if there is somewhere I could ask questions or share thoughts about more structured methods of computer vision problem solving. I mean, I would like to know a place where I could ask questions such as:

"What are the general steps of solving an object detection (or recognition) in a 'graduate' manner, and being able to demonstrate that all the steps used where necessary and to a high confidence the best method was chosen?"

I wanted to post on Signal Processing Meta but you need 5 rep in order to...

BTW, the question asked is a real one that I would like to ask here, simply it might not be the place or respect the guidelines of this SE site. In the same way, I feel this might be too CV related to ask on Academia SE...

Edit
What I mean by "a graduate manner" is the rigorous approach to problem solving that one should use in the course of graduate studies. What I mean is that sometime (especially when you work in a company vs working in academia), you must rapidly get a solution that work to solve a problem, instead of doing an entire review of the possible methods and doing benchmarks and etc... (This is a generalization and I don't want to imply that working in a company makes you use somewhat botched methodology, see it more like a "Perfect is the enemy of good".)


texts: I think the number of possibile value(s) of variable $\omega$ is 1 however actually it takes 2 values of angular frequency

texts:
Sampling is done by $~F_{s}=4[\text{Hz}]$ against$~x(t)=\cos(2\pi t)+1$ and the below function is given.
$$y[n]=\frac{1}{2} \left\{ x\left[n \right] +x\left[n -1\right]  \right\}     $$
And it is said that $y[n]$ can be represented as the below form.
$$y[n]=A\cos(\omega' n +\theta)+K$$
$$A,\omega',\theta,K~~\text{are constants}$$
$$ x\left[n \right] =x \left( n T_{s}  \right)  $$
$$ = x \left( \frac{n}{4}  \right)  $$
$$ = \cos\left(2 \pi \left( \frac{n}{4}  \right) \right) +1 $$
$$ = \cos\left(\frac{\pi n }{2} \right) +1 $$
$$ \omega_{\text{input}}:=\frac{\pi}{2}  $$
Below equations are general ones of amplitude characteristics and phase characteristics.
$$ y\left[n\right] =H \left( \exp\left(j \omega\right)  \right) \cdot \exp\left(j \omega n\right)  $$
$$ = A\left(\omega\right) \exp\left(j \theta\left(\omega\right) \right)  \cdot \exp\left( j \omega n\right)  $$
$$ = A\left(\omega\right) \exp\left(j \theta\left(\omega\right) + j \omega n\right)  $$
$$ = A\left(\omega\right) \exp\left(j \left( \theta\left(\omega n \right) +\omega n \right) \right)  $$
$$ = A\left(\omega\right) \left\{ \cos\left(\theta\left(\omega\right) +\omega n \right) +j\sin\left(\theta\left(\omega\right) +\omega n \right)            \right\}  $$
$$ = A\left(\omega\right) \cos\left(\theta\left(\omega\right) +\omega n\right)+j A\left(\omega\right) \sin\left(\theta\left(\omega\right) +\omega n\right)   $$
$$ \therefore  A \cos\left(\omega' n + \theta \right) +K=A\left(\omega\right) \cos\left(\theta\left(\omega\right) +\omega n\right)+j A\left(\omega\right) \sin\left(\theta\left(\omega\right) +\omega n\right) $$
$$ A\left(\omega\right) =\sin\left(\frac{\omega}{2} \right)   $$
$$ \theta\left(\omega\right) =\frac{\pi}{2} -\frac{\omega}{2}   $$
For me, it is quite wierd that the  RHS contains 2 variables of $ n,\omega $ however the LHS only contains one variable $ n $
And of course, the only value of $ \omega $ is $ ~ \frac{\pi}{2} ~ $  I thought.
So plugging the value of $ \omega $ into $ A\left(\omega\right)$ and $ ~ \theta\left(\omega\right)  ~ $  ,
$$ A\left(\omega\right) =\sin\left(\frac{1}{2} \cdot \frac{\pi}{2} \right)   $$
$$ = \sin\left(\frac{\pi}{4} \right)  $$
$$ = \frac{1}{\sqrt{2}}  $$
$$~$$
$$ \theta\left(\omega\right)   $$
$$ = \frac{\pi}{2} -\frac{1}{2} \cdot \frac{\pi}{2}  $$
$$ = \frac{\pi}{2} -\frac{\pi}{4}  $$
$$ = \frac{\pi}{2} \left( 1-\frac{1}{2}  \right)  $$
$$ = \frac{\pi}{2} \cdot \frac{1}{2}  $$
$$ = \frac{\pi}{4}  $$
$$ \therefore  A \cos\left(\omega' n + \theta \right) +K=\frac{1}{\sqrt{2}} \cos\left(\theta\left(\omega\right) +\omega n\right)+j \frac{1}{\sqrt{2}} \sin\left(\theta\left(\omega\right) +\omega n\right) $$
$$ \therefore  A \cos\left(\omega' n + \theta \right) +K=\frac{1}{\sqrt{2}} \cos\left(\frac{\pi}{4}  +\omega n\right)+j \frac{1}{\sqrt{2}} \sin \left(\frac{\pi}{4}  +\omega n\right)$$
$$ \therefore  A \cos\left(\omega' n + \theta \right) +K=\frac{1}{\sqrt{2}} \cos\left(\frac{\pi}{4}  +\frac{\pi}{2} \cdot  n\right)+j \frac{1}{\sqrt{2}} \sin \left(\frac{\pi}{4}  +\frac{\pi}{2} \cdot  n\right)$$
It is easiliy to get $~ A,\theta ,\omega' ~$ $~ \rightarrow  ~$ $~ A=\frac{1}{\sqrt{ 2 } } ~,~ \theta =\frac{\pi}{4} ~,~ \omega'=\frac{\pi}{2}  ~$
However the problem is the rightmost term of the RHS.
Since $~ K ~$ is a constant,$~ K \neq j \frac{1}{\sqrt{2}} \sin \left(\frac{\pi}{4}  +\frac{\pi}{2} \cdot  n\right)~ \leftarrow \text{no such value of n makes K=0} $
What the official descriptions states are below.
As $~ \omega=\frac{\pi}{2}  ~,~  A\left(\omega\right) =\frac{1}{\sqrt{ 2 } } ~,~ \theta\left(\omega\right) =\frac{\pi}{4} \leftarrow \text{same as I computed} ~$
As $~ \omega=0 ~,~ A\left(\omega\right) =A\left(0\right)  =0~$ hence $~ K=0 ~$
Why the $~ \omega ~$ can take zero ? I think $~ \omega ~$ can take $~ \frac{\pi}{2}  ~$ only.
What have I've been missing?


texts:
From what I have heard, compressed sensing can only be utilized for a sparse signal. Is this correct?

If that is the case, how can a sparse signal be distinguished from any bandlimited signal? Every signal can be expanded to include a sparse or zero-coefficient signal part than does it become sparse signal in that case?

Also, does compressed sensing all the time retrieve information or signal perfectly?

Added: by the way, I just started to learn these things, so the purpose of this question is to taste a bit of what these things are.


texts: Is a LTI system with dead-time equivalent with a LTI system with no dead-time but delayed input signal?

texts:
I wonder if the system parameters would remain the same after all.
According to the definitions, the gain is the change of the output induced by the change of the input if we assume that the gain is a constant number then it should remain the same.

But what about the time constant or rise time?

According the differential equations governing the first and second order dynamic systems, the paramater time constant is independent of the input signal, so I would say this also remains the same, but according to the other definition of the time constant which states that time-consnat is a measure of how fast a system goes from one steady state to another, then I would say no, and here is why:

If we feed a system with delayed input or a system has an intrinsic delay or dead-time (Dead time is the delay from when a controller output (CO) signal is issued until when the measured process variable (PV) first begins to respond.), then the time in which system changes its state between the regiems would prolong with the dead-time.

To clarify the concepts, I consider a RC circuit with a step input function, in this case a 1.5 volt battery, here you can find the circuit:

The $R_i$ resistor represents the losses in the capacitor.The differential equation governs this circuit:

$$RC \frac{dv_c}{dt} + v_c=v$$

in terms of controle engineering:

$$\tau \frac{dy}{dt} + y = Ku$$.

With $\tau$, I mean time constant and with K the so called gain. $u$ is the input signal and $y$ is the output.

I have all the the out put voltages and inputs all together in an excel file, they collected all the data via NiDAQ, and I want to measure the parameters $K$ and $\tau$.

Here is the graphs, the orange curve is the input, or in this case the battery voltage and the blue curve is the output voltage over the capacitor:

This circuit or system has no intrinsic dead time, I don't know where this delay is coming from.

My question is:
Does this system show equivalent behaviour as the exact same system, but with the input chopped to zero up to the starting time or in mathematical terms, does this two inputs $u(t)$ and $u(t)= 0$  if $t < 3.5$ $u(t) = 1.5$  if $t >3.5 $results in the same gain and time constant?


texts:
I have discrete signals whose values are between 0 and 1.

I wish to post-process such a signal such that the mean of its values equals 0.5, yet keeping maximum and minimum values 0/1 intact.
Intuitively, I think an 'element-wise' exponential would be the right approach, yet I can't seem to come up with the method to determine the value of the appropriate exponential.

Fictive matlab example to illustrate:

>> s=[0.2 0.7 1 0.5 0.4 0.2 0 0.3];
>> mu=mean(s)
mu =  0.41250
>> s_adjusted=s.^0.69998;
>> mu_adjusted=mean(s_adjusted)
mu_adjusted =  0.50000

What is the best method to determine the 0.69998 exponential ?


texts: Fixed-point and ARM CMSIS-DSP FIR filters

texts:
I am using Q1.15 fixed-point values to represent a 12-bit signed integer value. I was wondering if it matters if I use the  11 MSB or LSB of the fractional part to represent my 11 magnitude bits? Only thing I can think of is using LSB might in some cases reduces the chance of overflow errors and maybe allow me to use larger fixed-point FIR coefficients.

But I am using the ARM CMSIS-DSP FIR filtering functions and from what I understand the Q15 set of functions expects Q15 coefficients, Q15 state variables, Q15 result and of course Q15 input data. So in this case I will not be able to increase the precision on my Q15 filter coefficients.

Is there then any difference?


texts: Numerically finding impulse response from a wave equation

texts:
I'm developing a song synthesizer (like Yamaha's Vocaloid). I decided to mimic the acoustics of human speech. I modeled the space between articulators as a solid of revolution, and came up with the following PDE:
$$
(PA)_{tt} = c^2 (P_x A)_x
$$
where $P$ is air pressure (difference to the atmosphere; unknown), $A$ is cross-sectional area of the solid (known), and $c$ is the speed of sound.
By being a wave equation, I need two boundary conditions and two initial conditions.
Discretizing $x \in [0, 26 × c/F_s]$ by $m \in [0, 26]$ and $t \in [0,1]$ by $n \in [0, 44099 = F_s - 1]$, since I'm finding the impulse response:
$$
P[0,n] = \delta[n]
$$
Since the vocal cord is modeled by a vibrating closed end of the solid:
$$
P_x[0,n] = 0
$$
Since there were initially no sound, apart from at the vocal cord:
$$
P[m,0] = \delta[m]
\\
P_t[m,0] = 0
$$
And what I really need is $P[26,n]$.
I tried using finite difference method, but due to the initial conditions, the solution becomes $P = 0$. This doesn't make sense, and I think this means I must make the grid finer, interpolating the $\delta$. But for which, $x$ or $t$?


texts: Why Fourier series and transform of a square wave are different?

texts:
Here is a square-wave presented by Fourier series perspective:

Above coefficients shows that a square-wave is composed of only its odd harmonics.

But here below a square-wave is presented by Fourier transform perspective:

Above plot shows that a square-wave is composed of all frequencies not only harmonics, plot is continuous.

When I look at the FFT of a square-wave it looks like the Fourier transform which is continuous.

Series and transform gives different interpretation of a square wave. Why is that?


texts: I don't understand how the zeros are found of this 2nd order feed-forward filter

texts:
I realized someone asked a question about the exact same section of a book, which can be found here: Question about zeroes of simple 2nd order FIR filter.
While the answer to this question looks useful to me I have a question about the what the author did to find the zeros. Particularly this part:
$0=1+\alpha_1z^{-1}+\alpha_2z^{-2}$
We know that the zeroes need to be complex conjugates, so can change it to this:
$0=(1-Z_1z^{-1})(1-Z_2z^{-1})$
where $Z_1=Re^{j\theta}$ and $Z_2=Re^{-j\theta}$
The author says that $Z_1$ and $Z_2$ are the zeros, but I don't understand how this can be. Wouldn't $Z_1$ or $Z_2$ have to $=z$ for this to be true?


texts: Convert 16-bit wav file to 12-bit raw audio file

texts:
I want to convert a 16-bit wav file to 12 bit raw audio samples (to simulate the output of an ADC).

I'm trying to run

$ sox file.wav --bits 12 --encoding signed-integer --endian little 12_bit_signed_le/file.raw

And I get the error

sox WARN formats: raw can't encode Signed Integer PCM to 12-bit

Output File    : '12_bit_signed_le/file.raw'
Channels       : 1
Sample Rate    : 4410
Precision      : 16-bit
Duration       : 00:59:53.47 = 15847219 samples ~ 269511 CDDA sectors
Sample Encoding: 16-bit Signed Integer PCM
Endian Type    : little
Reverse Nibbles: no
Reverse Bits   : no
Comment        : 'Processed by SoX'

sox INFO sox: effects chain: input         4410Hz  1 channels
sox INFO sox: effects chain: output        4410Hz  1 channels

As you can see, the command resulted in 16-bit output. How do I force it to truncate to 12 bits?

Also, do I need to be worried about clipping (as this post suggests?)


texts: Can Sparse Fourier transform be used for sparse signal in other domain

texts: I've read that sparse fast Fourier transform can be used to compute the Fourier transform of a signal that is sparse in frequency domain much faster compared to FFT. My question is that can SFFT be used for signal that is not sparse in frequency domain but in some other domains?


texts: Analogous Library to OpenCV for Audio Processing / Analysis

texts:
I understand OpenCV is the de facto library for programming image processing in C/C++; I'm wondering if there is a C or C++ library like that for audio processing. I basically want to filter raw waves from a microphone, and analyze them with some machine learning algorithms. But I may eventually also need:

Multiplatform audio capture and audio playback
DSP - Audio filters
Tone detection
Tonal property analysis
Tone synthesis
Recognition given some recognition corpus and model
Speech / music synthesis

Any advice would be appreciated.


texts: Mesuring the distance between a base line and an object

texts:
I am working on an image having musical symbols, like
Before i reach this step i have removed the staff lines to recognize them in efficiency.
but now i want to detect on which stave line they exist. They only way i am thinking of is to create a base line, let's say to be the ground of the image. And measure the distance between the object and the base line.
Maybe i can add contour boxes and measure from the base of the box till the ground of the image.
How can i implement this idea?? What algorithm can i use ?


texts: Calculating gyroscope data from accelerometer and attitude data

texts:
I am currently collecting accelerometer and attitude data using smartphone sensors. Data is collected at 100Hz over 2.5 seconds. Of which there are 250 accelerometer points and 250 points representing the attitude of the device. I am looking to convert the attitude/accelerometer data to gyroscope Data. For example, 1 of the 250 segments look like;

For example,

Accelerometer

AccX = 0.08458628
AccY = -0.0586758144
AccZ = 0.273877382

Attitude

Pitch = 0.111681767
Roll = -0.8779668
Yaw = 1.91596484

How can I calculate the corrected gyroscope data from this data?


texts: Database into training and testing images

texts:
I am trying to compute the accuracy of the HMAX model. I am using the Face category (containing 435 images) from the Caltech101 database. I split it into x training and y testing. At each time, when x increases, the accuracy also increases. Furthermore, I heard that the number of training should be equal to 80% by comparing it to the tests. So when I split my data into 348 positive training and the rest for positive testing, I got an accuracy that it is smaller than the other smaller splits (when x<348)!!.

Even when I took x=300, I also got a smaller accuracy!!

By the way, I also used the background category and I split it into 50 negative training and 50 negative testing.

Please why I got a smaller accuracy? Please I need your help.


texts: Prerequisites for audio signal processing

texts:
I started a DSP course online and quickly discovered that as much as some people say that it is possible to avoid the more advanced mathematics of signal processing, this didn't seem the case.

It seems like a solid understanding of Calculus and Probability Theory is needed to properly grasp the subject and to be able to be creative with it in the audio field.

Which parts of Calculus are mainly used for dsp? Are there any parts than can be excluded?


texts: Savitzky–Golay filter vs. IIR or FIR linear filter

texts:
A traditional IIR / FIR filter (lowpass to remove the high freq oscillations), e.g. moving average,
or a Savitzky-Golay filter

can all be useful to smoothen a signal, such as an envelope signal:

For which application would a Savitzky-Golay filter be more interesting than a classical lowpass?

What makes it different than a standard filter, and what does it add in comparison to standard filters?

Does it adapt itself to the input data?

Is it better for transient preserving?

Have you ever been in an engineering situation one day when you decided "Let's use a SG filter instead of moving average or another FIR lowpass! It's better because this and this and this..."? Then this question is for you!


texts:
I'm designing a $2$-stage filter and was simulating the effect of quantization to a certain number of bits at the filter output.  The result I got was far from expected - and would appreciate any intuition from the experts here.

The high-level idea is:

Filter input data is $N$ bits.
$\rm Stage_1$ is a half-band interpolation by $2$.
Internally the filter accuracy is maintained (to approx $30$ bits), but the output is rounded to $M$ bits.
The $2^{\textrm{nd}}$ stage takes the $M$ bits in, filters it at full accuracy (again a half-band interpolation by $2$ filter, with full precision internally)
The output of the filter is rounded to $P$ bits.

Initially I set $N=M=P$ to be $16$-bits. The filters themselves have a stop-band attenuation of $\approx90\textrm{ dB}$. What surprised me was $16$-bits between filters was not enough - at least in terms of the frequency response.

So if I do not quantize the inter-filter values I of course get ideal behaviour and the overall frequency response (measured via an FFT of an impulse response) is the combination of each individual frequency response - and my stop-band attenuation is $\approx90\textrm{ dB}$. Of course the input bit-width does not matter here.

However, if I quantize to $16$-bits between stages, with rounding, I would have thought this more than sufficient to preserve the filter frequency response accuracy - but I was wrong - the stop-band attenuation dropped to $\approx84\textrm{ dB}$ in places. It required $18$-bits inter-filter bit-width in order to maintain performance.

So the question is - is there a rule of thumb for how many bits to preserve. Why is $16$-bits not enough for $\approx90\textrm{ dB}$ attenuation?


texts: Why Fourier transform and Stockwell-transform retain the absolute phase information of one signal?

texts: Hello friends am studying the topic of signal processing and the Fourier transform and the s-transform and in most books as for example "Time-Frequency Signal Analysis and Processing. 2nd" of Boashash in section 5.11.2.3 says that these transforms retain the absolute phase information of the signal and I do not understand that it mean with this concept about retain the absolute phase information of the signal and why this is important?.


texts: Convert old computer cassette signal into binary

texts:
Completely new to this but keen to learn :)
I have an old BBC Micro computer cassette which I've recorded into unsigned 8-bit pcm wav file format. The file comprises tracks separated by virtual silence and each track is split into a series of blocks separated by a carrier tone at 2400hz. The blocks are a series of 1200hz and 2400hz signals representing binary data. I think this is frequency modulation? (as you can tell, I'm not very educated in these things)

Where would I start if I wanted to convert this into binary?


texts: Can lossy video encoding result in identical adjacent frames?

texts:
When using lossy encoding can similar adjacent video frames become merged or even identical?

For example, if frames A, B and C occur in sequence and are similar but different, can the encoded video render A, A, A when played?

I am referring to this tweet from Channel 4 News that implies that the veracity of a video can be called into question if, in its encoded form, frames are replaced with adjacent frames.

It would seem to me that the observed playback could be symptom of inter-frame compression - possibly performed multiple times due to repeated encoding and decoding. Could this be what happened?

Another idea: could differing US/UK framerates also affect the rendered output due to frames falling in between the eventual rendered (possibly different) framerate?


texts: Taking care of 'splash' onto adjacent frequencies

texts:
I have a system that should identify activity on a frequency (say in a 5kHz range), and report the frequency.  I have a problem with this system - the signal strength is sometimes wider than 5kHz, or strong enough that it bleeds over into adjacent FFT bins.  My system then recognizes (erroneously) activity in these adjacent bins / frequencies.

I am sampling at about 2MHz, I am not filtering the output (as I understand it the filtering would only control what goes into the 2MHz area, not each FFT bin).

Question: is there a way to control / detect this sort of thing, so that I know where the center frequency of activity is, and ignore the bleed into adjacent bins?


texts: Signal Processing using Fourier Transform1

texts:
How can I derive the fourier transform of

                                   g1(t) = {A cos(2πfc t),−T/2 < t <T/2
                                            0,               elsewhere

and;

                                  g2(t) = cos(t), −∞ < t < ∞

my answer for g1 is;

    ∫ g(t)exp(-j*2*pi*f*t)dt = ∫ Acos(2*pi*fc*t)exp(-j*2*pi*f*t)dt

       =∫ 1/2A (exp(j*2*pi*fc*t)+exp(-j*2*pi*fc*t))exp(-j*2*pi*f*t)dt

       =∫1/2A(exp(j*2*pi*fc*t)exp(-j*2*pi*fc*t)+∫1/2A(exp        (-j*2*pi*fc*t)exp(-j*2*pi*fc*t))

       =1/2A∫exp(-j*2*pi(f-fc)t) + 1/2A ∫exp(-j*2*pi(f+fc)t)dt

       =1/2A(f-fc)+1/2A(f+fc)


texts: Impulse response of a time scaling system

texts:
Assume a bandlimited signal $X(t)$. Given that the output for this signal is $X(t/2)$, what will be the impulse response $h(t)$ of such a system?

\begin{array}{l}
X( \omega ) \ =\ \int ^{\infty }_{-\infty } x( t) e ^{-j\omega t} dt  \\
Y( \omega ) \ =2X( 2\omega )\\
\end{array}

As the system won't be LTI the output won't be the convolution of the input and the system response. How do I proceed with finding the response of such a system? Any guidance in the direction of the solution will be very helpful.

Edit: Thanks for all the answers, i had reframed this question which was on a similar line. The question goes like this ->
Given an input pulse of duration T, the system scales it to a pulse of 2T, design such a system? It would be of great help if someone could point out the right direction to proceed.


texts: best technique to remove noise from bio signal data

texts:
I'm still learning about signal processing so sorry if this is an intro problem. I want to remove noise from the following data so I can separate each wave and run analysis on it.

The data is sampled at 41 hz, the red is the raw data and the blue is the data that I applied a lowess filter to with a window size of 41. As you can see it is smoothed to some extent but there is still a lot of peaks and noise in the mix.

I read that you can use RNN or PCA or FFTs to remove noise for bio-signal data, in this case, what are the best techniques to remove noise from the red data so that the blue line is just 5 waves that is easily identifiable?

My ideal result is that after applying the filter I can easily tell that there is 5 waves in this period of data and the resulting index of said waves.
Any input is appreciated!


texts: Is my concept of receive diversity right? EGC,MRC and SC

texts:
Is my  concept of receive diversity right?There are three combining technology belong to receive diversity.

1.Equal gain combining(EGC)

$\sum e^{-j\theta_k}(\sqrt{P}|h_k| e^{j\theta_k}x[n]+w[n])$

so the EGC coefficient is $e^{-j\theta_k}$ just because we assume the channel phase is $e^{j\theta_k}$,so it seems that this method is hope the signal can have  same phase direction and sum it.

2.Selection combining(SC)

we have a receiver with multiple antenna,so theoretically we have multiple SNR in the receiver,now we select the highest SNR as real SNR. It seems that this method like Ostrich Syndrome,that is ,we don't do any other process to the signal,we just choose the highest SNR and ignore the other weaker SNR.

3.Maximal ration combining(MRC)

we use the Cauchy–Schwarz inequality to realize the MRC coefficient is the conjugate of the channel,that is

$\sum |h_k|e^{-j\theta_k}(\sqrt{P}|h_k| e^{j\theta_k}x[n]+w[n])$

So theoretically,the SNR performance order is

MRC>EGC>SC,because MRC not only do some process in the phase,but also amplitude,however,EGC just do some process in the phase.we all know that the signal power has a high relation with amplitude,so the performance of MRC will be the highest in these three method.

Is my concept and thinking right?


texts: RF for Data Transmit and Receicve for Beginners

texts: Is there any good matrial avialable for data specific DSP? I have gone through some great DSP intros for beginners in python but all of them revolve around the characteristics of audio signal


texts: How to tell whether an image has a low gamma (Finding out imaging system tone map)

texts:
I am using Emgu C#.

I acquire images from my cameras.

I know when there is no saturation (ie a grey-tone image) by looking at the average hue channel of the image. If zero then pretty sure picture taken at night time.

I can also detect how bright an image is by checking the average Luminescence channel.

What I would now like to do is a value for the gamma an contrast of an image.

Now, I know it is the interpretation of this hypothetical gamma and contrast that determines its value within the context of how I use it. But what factors can i use to attempt to put a scale on these values?

Should I be looking at a different Color Space?

Thanks


texts: Simulink continuous to discrete question

texts:
I'm new to Matlab/Simulink and would like to convert the continuous system below to discrete for eventual conversion to C code. Matlab has a c2d function, but I don't know how to apply it to a simulink system.  The c2d function requires the system to be in transfer function or state-space form, neither of which I know how to convert the diagram to.

So any ideas on how to use the c2d function in this situation?  Or should I use something like Tick's rule to replace the integrators?  Any other methods?

Here is the simulink diagram in question.  It's purpose is to determine the fundamental of a sine wave.  With further stages, it can also extract higher harmonics if present.  The scope is connected to the fundamental frequency estimate.  The system needs to be converted to 44.1Khz sampled system.

See this paper for more info: http://ijcsi.org/papers/IJCSI-8-5-1-360-365.pdf


texts:
We often hear that "convolution in time is the same as multiplication in frequency", and vice versa, that "convolution in frequency is the same as multiplication in time".

So in a typical windowing operation, we do a point-wise multiplication of a signal $x[n]$, with a window $w[n]$. This means that in the frequency domain, we are performing $X(f) *
W(f)$.

My question is the following: I wish to illustrate this for myself, but I am not sure what lengths FFTs to take, and what type of convolution to do. (Circular? Linear? etc). Those details seem to be missing from all sources I look at.

So, if you want to do convolution in the frequency domain, what lengths FFT do I pick to compute $X(f)$ and $W(f)$, and what type of convolution am I doing? Thank you.


texts: Decimation Question about using a low pass filter before downsampling

texts:
I have a bunch of audio files that have a sample rate of 380kHz, however I would like to reduce this sampling rate to 44.1kHz. From doing some research online, it seems like I will have to use a low pass filter in order to avoid aliasing before I downsample.
I am using python and thinking of using the butter_lowpass_filter. However, I am confused as to what my cutting frequency would need to be and also how much I will need to decrease my sampling rate in the downsampling step.
Any help would be appreciated!


texts: Extracting fundamental amplitude/phase from only half a period of a pseudo-sinusoïd

texts:
Before you read my problem, I've summed up my experiments in a notebook available here.

So, I have a few noisy samples (~50) of a pseudo sinusoidal signal for which I use a traditional discret Fourier transform in order to extract the amplitude and phase of the fundamental (real signal is much noisier).

fft[1]=5.0, 60.0°

Now my problem is that i sometime have only half the data available, ie only half a peridod of that sinusoid.
But I know I almost exactly have sample of half that period, and I know the signal is almost a sinusoid.

How can I proceed to extract the fundamental characteristics anyway?

I've noticed that zero-padding the missing half and doubling the amplitude works quite well.

fft[1]=2.5, 59.1°

But in my case the sinusoid is not DC-centered on zero, and in that case zero-padding doesn't work.

fft[1]=10.6, -82.5°

I would need to pad with the DC of my signal, which is unknown. I've noticed that if you have half a period, the average of first and last samples should give the DC, but this won't be reliable with noisy data.

fft[1]=2.5, 59.1°

Thanks in advance for your insights!


texts: In image compression using transforms, how to deal with the transformed coefficients as they are not integers?

texts:
I am new to the field of image compression. While going through various texts, I read about how transforming the image to another domain using, for example, the wavelet transform, or the DCT, makes it suitable for lossy compression.

I have been trying to play around with wavelet transforms on a sample bmp in MATLAB. Using the MATLAB library function, I created transform coefficients using Daubechies wavelets.

Now a given pixel when read from bmp is in uint8 format, i.e., it uses up 1 byte of memory. This is because in most image formats the range of values a pixel can take is from 0 to 255. After wavelet transformation however, one gets double precision floating point for each element of the transformed matrix. This would typically consume about 4 bytes for each element.

My goal was to try out some very basic compression using quantization and entropy coding of quantized elements. Quantizing the low magnitude values of the transformed elements to zero does give good compression. But trouble is I have to still use double precision floating point. The moment I convert all the wavelet coefficients to some integer format, the reconstructed image becomes very poor in quality as compared to the original.

In standard compression techniques, how are the transformed coefficients handled, given that they are not integer in format? Each transformed coefficient, due to its double precision nature, takes up more bytes than the original. Can you point out resources where this issue has been explained?


texts:
Heads up, this is homework.  Just a little stumped :)

I have some arbitrary primaries, A, B, C, which I want to express in terms of the standard XYZ primaries.

I have that the tristimulus values with respect to the ABC primaries for some random colour R is defined by some linear matrix equation:

$\begin{bmatrix} R_a \\
R_b \\
R_ c \\
\end{bmatrix}
%
=
%
\begin{bmatrix}
a_{00} & a_{01} & a_{02} \\
a_{10} & a_{11} & a_{12} \\
a_{20} & a_{21} & a_{22}
\end{bmatrix}
%
\begin{bmatrix}
R_x \\
R_y \\
R_z
\end{bmatrix}
$

How can the primaries be computed from this information?


texts: Why we need Laplacian for edge detection?

texts:
I am studying some trivial computer vision processing techniques and I came across edge detection algorithms. IMO sharp changes in the gradient are enough indications to detect the edges in an image but most of the modern edge detection algorithms use Laplacian with second derivation to do the same task.

Q1. Are we using second derivative because the change in flux is a much better indicator for edges?
Q2. Can we use something other than Laplacian?


texts: Speech comparison algorithm for rating on similarities

texts:
I am trying to compare 2 speech samples and rate them on similarities. Think of someone trying to repeat a phrase, and then comparing those 2 audio files.

I started by implementing the MFCC (http://en.wikipedia.org/wiki/Mel-frequency_cepstrum) algorithm. I calculate the MFCCs of both audio samples, which gives me roughly 500 frames of audio (at 10ms each, with like 30% overlapping of the previous) having 14 or so MFCC coefficients. So a 500x14 matrix for each audio signal.

Then I do the naive approach of simply differencing the matrices. This does not give very promising results. Half of the time when I compare completely different audio samples (where different phrases are spoken), I get less difference than comparing the audio where I try to repeat the same phrase! This is clearly backwards and can't give me a good scoring algorithm.

How can I improve on this? I thought MFCCs were a really important part of speech processing, though clearly I need to do more with it.


texts:
I am having an issue using neural networks to predict time series. Some predicted data fits with the expected data, as bellow: (In black the real time series and in blue the output of my neural network)

Time serie: Australia energy demand.

But with the same code, with other time series, the predicted data does not fits with the expected data, and has a delay of one unit, as bellow:

Time serie: Walmart Stock price.

Time serie: Dollar libra exchange.

I found some articles about some variations of neural networks and at the results section shows the plot with the delay like my results, as bellow:

Time serie: Dollar libra exchange.
(Article link: http://www.sciencedirect.com/science/article/pii/S1877050915015793)

Anyone knows if this is a common behavior or can be something wrong with my code ? I am having this issue about three months ago, and since there I am trying to figure out some bug in my code but is all right.

Thanks and I appreciate any tip.


texts:
For a regular RGB camera, reading the wikipedia page for camera resectioning/calibration here, they divide the paramters into two categories:
Intrinsic: - focal length, scale factors in x and y, and principal point
Extrinsic: - the rigid body transform of the camera relative to some origin point
My question is how does camera calibration for a depth camera relate to these parameters, for example a Kinect v2 depth camera.
Edit: For example in the SUN RGB-D dataset, there are two files associated with each png image/ png depth image pair. An intrinsic file, and an extrinsic file.
The intrinsic file is a 3 by 3 matrix, example:
529.500000 0.000000 365.000000
0.000000 529.500000 265.000000
0.000000 0.000000 1.000000
From what I understand, using 1-indexing, entry (1,1) and (2,2) according to the camera resectioning article on wikipedia are the focal length multiplied by scale factors relating "pixels to distance" (any elaboration on this appreciated). Whereas entries (1,3), (2,3) represent the coordinates of a principal point. Is this principal point in 2-D or 3D space and what do these numbers mean?
The extrinsics file/s (for some reason there are multiple files sometimes) are
a 4 by 4 matrix, example:
0.979445 0.201365 0.011827 0.000000
-0.201365 0.972640 0.115861 0.000000
0.011827 -0.115861 0.993195 0.000000
Which is a rigid body transform.


texts: How much noise gets through my raised cosine filter?

texts:
I want to figure out how much of my total noise is getting through my filter. To see this, I generated a noise vector, applied the filter, and measured the output variance. However, the output variance changes if I scale my filter (as would be expected). I suspected that I needed to normalize the DC gain to be one, but I'm not sure if that is the right approach. Here's my code:

noiseVector = randn(1,1e6);
varOrig=var(noiseVector)

filterCoeff = rcosdesign(0.2,10,12);

filteredNoise1 = conv(noiseVector,filterCoeff);
var1=var(filteredNoise1)

filteredNoise2 = conv(noiseVector, filterCoeff/sum(filterCoeff));
var2=var(filteredNoise2)

There's a big difference between var1 ($\approx 1.00$) and var2 ($\approx 0.08$). Var1 would indicate that essentially all of the noise power was getting through the filter, but var2 would say that most of the noise is filtered out.

I also plotted the response of the unnormalized filter

 and of the normalized filter.

As expected, the DC gain of the normalized filter is 1 (0 dB).

For my purpose of characterizing how much noise is getting through the filter, should I be using the normalized one (and is that normalization factor the right one)?


texts:
I've been trying to understand the concept of the Kalman Filter. I came across this great article which makes the concept sufficiently clear.

However I could not understand the concept of the matrix $\mathbf{H}$ which I think is the observation matrix. In Equation 8 in the article, the sensors are modeled using this matrix. I've been through a few posts in this site, where I found that the $\mathbf{H}$ matrix is always a combination of 1's and 0's.

Is this always true for any system where I am trying to estimate the value of a parameter like velocity or position?


texts: Relation between the DTFT and CTFT in sampling- sample period isn't as the impulse train period

texts:
I will quote an answer of Matt L. from this post
(I didn't comment there because I can't)

  If you have a continuous-time signal $x(t)$, then the two signals you're talking about are

  $$\begin{align}
x_c(t) &=x(t)\cdot\sum_{n=-\infty}^{\infty}\delta(t-nT) \\
 &=\sum_{n=-\infty}^{\infty}x(t)\delta(t-nT) \\
 &=\sum_{n=-\infty}^{\infty}x(nT)\delta(t-nT) \\ \tag{1}
\end{align}$$

  and you define

  $$x_d[n] \triangleq x(nT)\tag{2}$$

  The first signal given by $(1)$ is technically a continuous-time signal, even though it is only non-zero at discrete times $t=nT$. The reason why it is considered a continuous-time signal is because it can and must be transformed using the continuous-time Fourier transform (CTFT). So $(1)$ is the continuous-time representation of a sampled signal. Eq. $(2)$ is the discrete-time representation of the same signal. Here the sampled signal is represented as a sequence of numbers. You can't apply the CTFT to $(2)$, but you must use the discrete-time Fourier transform (DTFT).

  The nice thing is now that the CTFT of $x_c(t)$ given by $(1)$ and the DTFT of $x_d[n]$ given by $(2)$ are identical. So if the CTFT

  $$\begin{align}
X_c(j\Omega) &= \int_{-\infty}^{\infty}x_c(t)e^{-j\Omega t}dt \\
   &= \int_{-\infty}^{\infty}\sum_{n=-\infty}^{\infty}x(nT)\delta(t-nT) e^{-j\Omega t}dt \\
   &= \sum_{n=-\infty}^{\infty}x(nT) \int_{-\infty}^{\infty}\delta(t-nT) e^{-j\Omega t}dt \\
   &= \sum_{n=-\infty}^{\infty}x(nT)  e^{-j\Omega nT} \\
   &= \sum_{n=-\infty}^{\infty}x_d[n]  e^{-j n(\Omega T)} \\
\end{align}$$

  and the DTFT:

  $$X_d(e^{j\omega})=\sum_{n=-\infty}^{\infty}x_d[n]e^{-jn\omega}$$

  we have:

  $$X_d(e^{j\omega})=X_c\left(\tfrac{j\omega}{T}\right)\tag{3}$$

  In sum, the signals $(1)$ and $(2)$ are just two different representations of the same signal, and their spectra (one defined by the CTFT, the other defined by the DTFT) are identical.

My question arises due to a question I got when the period of the impulse train is not the same as the period of the sample:

$$x_c(t)=\sum_{n=-\infty}^{\infty}x(nT)\delta\big(t-n(\tfrac{2}{3}T)\big)\tag{1}$$

and

$$x_d[n]=x(nT)\tag{2}$$

does we still get the connection:

$$X_d(e^{j\omega})=X_c\left(\tfrac{j\omega}{T}\right)\tag{3}$$

if yes, does the $T$ in the connection imply to the impulse train period ($\frac{2}{3}T$) or to the sample time ($T$) and why?

When I set in  $X_d(e^{j\omega})$ the value $\omega=\frac{2}{3}T\omega$ I got an answer which should be true. but I don't know if it's by luck or really true and I don't know why.


texts: Denoising before or after Geometric Transform?

texts:
I am working on a image which needs denoising (bilateral filter) and a geometric transformation. I am not sure in which order these filters should be applied. Personally I think it is better to use the transformation first because otherwise I would loose details removed by the bilateral filter. But in the same moment the transformation would amplify some of the existing noise wouldn't it?
I tried it both ways and objectively it's hard to tell which one is better.

So which order is right? And how to order filters in general?


texts: For an image with pepper noise, presuming it is desirable to reduce the pepper noise, which operations, in which sequence, would you apply? Find an image, add pepper noise, and demonstrate your results.


texts: What Makes a Signal Processing Book Good or Less Good?

texts: I've recently been disappointed by a few books that have "using MATLAB" in their title, which makes me wonder why. I like MATLAB so it isn't MATLAB. There are other books that I will keep at considerable inconvenience to myself even if I haven't used them for years, and that also makes me wonder why? I'm curious if others have similar opinions and what they might be.


texts: Need help in understanding minimum variance estimator and CRLB concept using an example

texts:
I am reading the book, Fundamentals of Statistical Signal processing, Estimation Theory Volume 1 by Steven M. Kay. In Chapter 2, there  is a Fig 2.5 which illustrates which estimator to select based on the CRLB. Basically, the estimator with less variance is preferred since its pdf is more concentrated about the true value. I have certain doubts regarding this statement and the term "inconsistent estimator".

Considering 2 estimators for a parameter $\theta$ found using two estimation technique. Estimation technique A is the ML estimator and B is the ordinary least square having the CRLB denoted as CRLB_A and CRLB_B for the unknown parameter $\theta$ respectively.

Doubt 1: At high SNR, the CRLB_A > CRLB_B. So, should I select CRLB_B at high SNR? For low SNR, it is the reverse.

Doubt 2: Let the $mse(A) = E[(\Delta \theta \Delta \theta^T)] < CRLB_A$

What does this imply? Does it mean that the ML estimator of A is inconsistent?


texts: How to detect start and finish of temperature control in temperature time series

texts:
I have a huge dataset containing temperature data inside a building. I want to extract the time that the building starts and stops controlling the temperature (approximately around the vertical black lines in the pictures). In this case the temperature control starts and stops at the same time. However, I want to detect the the same for a building where the start and stopping time is variable, per day and per area inside the building. How would you go about finding a solutions for such a problem?
I can quite reliably detect the first line by detecting when the absolute velocity / acceleration reaches above a certain threshold, but this method seems less reliable for detecting the stopping point.

Smaller subset to better show the behavior of the data:


texts: Hardware requirements for ambient active noise cancallation system using adaptive LMS

texts:
Background

I'm working on a hobby project to reduce ambient low-frequency noise generated from HVAC equipment within a small area of a room. The noise is predictable and concentrated between 55Hz and 120Hz. Aggressive passive noise attenuation efforts have failed at these frequencies, and so ANC may be the only option. I have basic analog mixing equipment, microphones and speakers, and am now researching DSP and related hardware requirements for ANC.

Algorithm

My preliminary research has led me to believe that a Filtered Least Mean Squared (FxLMS) algorithm may be the best choice for an application like this. Because it would be implemented in a "open" space, my understanding is that the secondary path filter of the FxLMS (as opposed to a simple LMS) would be critical. The related diagram would be:

Where:

x(n) is the reference signal recorded via a mic near the HVAC noise source, fed through a preamp and available as a line-level signal.
e(n) is the error signal recorded via a mic in the cancellation area, fed through a preamp and available as a line-level signal.
y(n) is the cancellation signal that will be sent as a line-level signal to a powered sub with an integrated LPF near the cancellation area (filter output).
d(n) is the ambient noise to be cancelled after traveling from the source the the cancellation area.

My understanding is that this is conceptually a pretty straightforward ANC setup, and it is referenced in some detail in numerous publicly available resources (e.g. here and here). However, what is not clear to me is the hardware requirements to implement the DSP filter part (the blue box).

Possibilities

I'm assuming that the real-time synchronization between the sampled x(n)/e(n) signals and the final y(n) output requires a specialized DSP board. I suppose that the algorithm itself could be programmed in Matlab or C (samples are available), but refining, compiling and embedding the result onto a board from scratch seems like something that may require expertise that I do not currently have. So I'm wondering if there are more "black box" solutions available somewhere for this sort of thing.

The closest things I could find are the SigmaDSP Audio Processors, possibly the evaluation versions of this board or this one. If I'm understanding it correctly these come with a huge library of pre-compiled filters that can be chained together and mapped to various I/O via a GUI. One of the available filters seems to be an FxLMS (source), but it's hard to tell which SigmaDSP boards are capable of running that filter or if there are other special considerations that I need to be aware of given an application like this.

So on the hardware side what would be the "lowest barrier to entry" for an application like this? Though I have a background in systems engineering, I do not have extensive experience in audio signal processing. I'm also wondering if this is the kind of problem space that may require significant additional background theory knowledge before tackling.


texts: How to get the phase/angle from an Alglib complex variable

texts: It is easy to get the magnitude using alglib.abscomplex function (https://radfiz.org.ua/files/temp/Lab1_16/alglib-3.4.0.csharp/csharp/manual.csharp.html#gs_stdfunctions), but I would like to know, how to get the phase information from a complex variable. Please tell me, if you know a good solution, thanks!


texts: Multiplication of two impulse function $\delta(t)\cdot \delta(t)=?$

texts:
If a impulse function is mulplied with a function $f(x)$ then the formula will be apply
$$f(x)\delta(x-a)=f(a)\delta(x-a)$$ so from this formula mulplication of two impulse function will be

  $$\delta(t)\delta(t)=\delta(0)\delta(t)$$

But,what if i take two impulse function as the approximation of standard signal (rectangular or gaussian) and mulplied them directy then i will get again an impulse function of same property.

What is wrong with this two?


texts:
Say I have the following 4x4 block:

[ 120  121  125  119
  120  120  118  117
  122  121  117  118
  122  122  120  120]

If this block is intra coded the resulting DCT coefficients are the following and rounding to nearest integer:

[ 480.8  3.8  -1.5  0
  -0.1  -1.8  -2.7  2.7
    4   -2.4  -2    2
   1.1   0.2   0    0.3]

Assuming I used QP size of 2 for quantization:

[ 240  2  -1  0
   0  -1  -1  1
   2  -1  -1  1
   1   0   0  0]

How do I calculate the compression ration for the following assuming a pixel is encoded using 8bits/pixel and the DCT coefficient uses 10 bits

I normally calculate the compression by first calculating the

uncompressed bit rate = image width × image height × colour depth × bits per pixels

and then solve uncompressed size/compressed size

But I am not sure how to calculate the compression ratio in this case where DCT coefficient is given!!


texts: General questions regarding OFDM modulation

texts:
In Orthogonal frequency division multiplexing (OFDM), data symbols are modulated using an N pt-IFFT operation to produce ONE output OFDM

Assume we have total of $N$ QAM symbols which are input to the IDFT operation.

1) Is the output time domain samples $X_k$ also of length $N$ in length?

2) If ONE data QAM symbol has symbol duration $T$, is ONE OFDM symbol of symbol duration $T$ or is one SAMPLE of the OFDM symbol of duration $T$?

Thanks looking forward for your answers

Update

One example of OFDM modulator is the one used in LTE, in particular the subcarrier bandwidth is 15 KHz, and the OFDM symbol (and not one sample of the OFDM symbol) is 1/15k = 66.67 $\mu $ sec which is equal to the transmission time of one symbol (for example 1 QAM) over one subarrier. If my understanding is correct than the answer provided below is wrong. Can somoeone please double check?

Thanks


texts:
I want to design a digital FIR filter to cancel the phase of an analog Butterworth filter (i.e. the phase is smooth) i.e. the filter has unity gain with just an inverted phase component.

The following standard method for designing linear phase filters via FFT guarantees that the phase is linear (without deviation) even after applying a window (the window is obviously useful to prevent ripples occurring if the required impulse response is longer than the desired length):
FIR filter design with frequency sampling method - setting proper phase response for IDFT

Is there a similar method where by careful maths you can ensure that the magnitude is guaranteed to be unity (even after windowing to smooth any "ripples" in the resulting phase if the impulse is longer than the desired length)?


texts: Using spectral coherence for computing similarity between time series data

texts: I don't really know anything about signal processing. I need to find similairty between two 1-dimensional time series. I read somewhere that spectral coherence could be used to find similarity between two time series. But i am not able to get around how to use it. Can some one tell how i can use it to compute similarity between time series.


texts: In a set of images taken with the same infrared camera, I have a noise signal presumably originating from the camera chip. How would I go about extracting said signal to be able to substract it from all images I have taken?


texts:
I am taking a graduate level course in Networking theory and applications and I am still a bit shaky on the difference between baseband and pass band scheming. The book I am using is Computer Networks 5th edition -- Andrew S Tanenbaum

To my knowledge, passband scheming uses the changing of frequency, amplitude, and phase to modulate a analog signal. And base band uses encoding techniques like NRZ, NRZi, and Manchester encoding.
How does this work along side, frequency multiplexing and CDMA for multiple device access?

And can someone give me a layman explanation of carrier signals? And how I can maybe think of them as offsets like in assembly languages.
Thanks for helping!


texts: Measuring walking speed with iPhone accelerometer

texts:
As part of a research project, I have been tasked with determining gait speed (walking speed) for a subject using a handheld iPhone. The main constraint is that walking distances are very short (10-30 meters), and accuracy is critical (data is used for research.) Using a pedometer and measuring step distance is not an option (too time consuming.) The only plausible way I foresee this could be work is using accelerometer data. However, I'm not sure whether this will succeed. I was wondering if anyone has experience with these sensors and could answer the following two questions:

Will an iPhone accelerometer plausibly be able to accurately measure walking distance for such short distances? Are there any figures on accelerometer accuracy for this kind of sensor? (I couldn't find any.)
Are there any established protocols for converting accelerometer data into distance measurements (calibration, noise correction, sampling rates, etc.) that have been shown to have good accuracy for such short distances? I have been able to find this, http://www.freescale.com/files/sensors/doc/app_note/AN3397.pdf but I'm not sure if this will apply well to the iPhone sensors.


texts: Why is there no FPU on (most) DSP chips?

texts:
Why is there no FPU (Floating Point Unit) on most DSP chips?  I found
several answers such as this
one
that explain advantages of fixed point approach such as smaller power
consumption, higher speed and I can myself think of several other
advantages such as smaller heat production or price but I have never
seen any practical real life benchmarks. The questions I would like to
know answers for are:

how much is FPU and what is the price difference between CPUs with an FPU and CPUs without an FPU?
how much heat can FPU produce?
how much power would FPU consume?


texts: How do I show if this system is time-varying?

texts:
$\displaystyle y(t) = x(t), t \ge 0$ and $-x(t), t \lt 0$

I can anticipate this system is time-varying.

However, I cannot be sure it and prove it.

please help me.


texts: How should we read FIR filter phase response graph?

texts: What should we see from the FIR phase response graph, as an example for a linear phase? And what does this straight line at $0.5\pi$ mean?


texts:
I'm learning about distortion and I got stuck at

"What is the difference between linear and non-linear distortion?"
(Also in frequency spectrum i.e. Amplitude and phase spectrum)