texts: How do I eliminate line noise from USB microphone

texts:
I'm trying to record voice from a microphone into my laptop.  Unfortunately, the laptop does not have a microphone jack, so I have to use the USB input.  This doesn't present a problem when I record voice from my gaming headset, but when I record from the condenser microphone over USB I get a very pronounced line hum.  This occurs even when the laptop is unplugged from power and on its battery.

The hum consists mainly of 55 Hz noise, but with some 110 and 512 Hz components. I can eliminate this using a notch filter in "post production", as it were, but I'd rather not have to do this.  This noise is not the fault of the microphone, by the way (at least not directly), since when I run the microphone signal into my digital voice recorder (using a 3.5mm plug) there is no background hum at all.

Is there some way to process or filter the output from the microphone so that this noise never makes it to the laptop?


texts:
What "are" they? What's a sensible way to interpret the coefficients (and what isn't)? To pose specifics:

DFT coefficients describe the frequencies present in a signal
They describe the sinusoidal frequencies of the source

Are either of the above true?


texts: What does natural scene image data-set mean?

texts:
I came across a paper that is trying to classify and detect object(s) present in what they call a natural scene data-set. They have images containing objects like cars, bikes and people.

Can anyone tell me how this is different from other data-sets that contain the images of cars/bikes/people?

The site with the data-sets I am interested in is: Natural Scene Database.
For comparison, the Caltech Computational Vision data-set also contains cars and bikes from the rear and side view (with less background).

I want to know what is so special about the natural image data-set compared to the standard data-sets containing various viewpoints of cars/bikes from these set of images? Why would this natural image data-set be a bigger callenge in object detection?


texts: DPCM Encoder and Decoder Simulation in MATLAB

texts:
I am trying to simulate DPCM in order to understand how it works. I am trying to implement the simplest version of DPCM which has a system scheme like in figure 1.

Sorry for the quality of the picture but this was the best I could get. Let me do some explaining of the system.

System should do a DPCM modulation like in the figure, encode it, send it via a binary symmetric channel, decode it and demodulate it.

Here is what I tried:

fs = 15000;
input_data = getaudiodata(recObj);
input_data = input_data/max(abs(input_data));

quant_steps = linspace(-14/16, 14/16, 15);

quant_vals = linspace(-15/16, 15/16, 16);

epsilon = 0.3;
delayed = 0;

for ii = 1:length(input_data)
    y = input_data(ii) - delayed;
    [quants(ii), y_hat] = quantiz(y, quant_steps, quant_vals);
    delayed = y_hat + delayed;
end

binary_sequence = de2bi(quants, 'left-msb');
binary_sequence = binary_sequence';
binary_sequence = binary_sequence(:)';

%BSC

received_sequence = binary_sequence;

for ii = 1:length(input_data)
    if rand < epsilon
        received_sequence(ii) = mod((received_sequence(ii) + 1), 2);
    end
end

%Demodulator

decoded = zeros(1, length(received_sequence)/4);
demodulated = zeros(1, length(received_sequence)/4);
reconstructed_signal = zeros(1, length(received_sequence)/4);

delayed = 0;

for ii = 1:length(decoded)
    decoded(ii) = bi2de(received_sequence((ii - 1) * 4 + 1 : ii*4), 'left-msb');
    demodulated(ii) = decoded(ii);
    reconstructed_signal(ii) = (demodulated(ii) * 1/8 - 1)  + delayed;
    delayed = reconstructed_signal(ii);
end

MSE = (1/length(reconstructed_signal)) * sum((reconstructed_signal' - input_data).^2);

With this code, unfortunately, reconstructed signal increases constantly.

Waiting for your help.

As always,

Have a nice day!


texts: Hilbert transform Use as a Single Sideband Frequency Translator in Analog communication

texts: How Hilbert transform helps us in communication? What is the practical significance of it? Specifically how is the Hilbert Transform used to create single side-band frequency translators?


texts: How to model Tape Saturation (Audio DSP)?

texts:
I'm looking for info that would help me to build a Tape Saturation process.

I'm working with the WebAudio API. The API provides a number of DSP nodes that perform basic processes, such as a Convolver node and a WaveShaper node. The WaveShaper seems to suggest it is designed for distortion effects (http://www.w3.org/TR/webaudio/#WaveShaperNode-section). But tape saturation would seem to me more than a simple mapping of input to output values.

What are the principal processes I should be modelling? Can anyone point me in the right direction?


texts:
With the desired magnitude of a transfer function in the frequency domain in C++ as described below what is the correct corresponding minimum phase?  In general how does one derive the correct minimum phase in the frequency domain if the desired magnitude is known, specifically such that the a complex IFFT of it would return an entirely real part.

// PnCutoff.cpp : Pink noise above a cutoff.
#include <tchar.h>
#include <math.h>
#include <conio.h>

class PnAtFilter
{
    double _fcHz;
    public:
    PnAtFilter(double fcHz) { _fcHz = fcHz; }
    double Mag(double fHz)
    {
        if(fHz < _fcHz) return 1.0;
        else return  1.0 / sqrt(fHz/_fcHz);
    }
    double Phase(double fHz)
    {
        return 0.0; // what is the the correct minimum phase in r?
    }
};

int _tmain(int argc, _TCHAR* argv[])
{
    PnAtFilter* pnf = new PnAtFilter(1000);
    for(int fHz = 10; fHz <= 100000; fHz *= 10)
    {
        double mag = pnf->Mag(fHz);
        double phase = pnf->Phase(fHz);
        _cprintf_s("%d Mag=%f, Phase=%f\r\n", fHz, mag, phase);
    }
    _getch();
    return 0;
}

/* output:
10 Mag=1.000000, Phase=0.000000
100 Mag=1.000000, Phase=0.000000
1000 Mag=1.000000, Phase=0.000000
10000 Mag=0.316228, Phase=0.000000
100000 Mag=0.100000, Phase=0.000000
*/


texts: Fourier Transform: interpretation of continuous spectrum at specific frequencies

texts:
B. P. Lathi in his book "Principles of Linear Systems and Signals" mentions in the Fourier Transform:

  When $x(t)$ is periodic, the spectrum is discrete, and $x(t)$ can be expressed as a sum of discrete exponentials with finite amplitudes.
  However for an aperiodic signal, the spectrum becomes continuous; that is, the spectrum exists for every value of $\omega$, but the amplitude of each component in the spectrum is zero. The meaningful measure here is not the amplitude of a component of some frequency but the spectral density per unit bandwidth.

I get that when the period of the periodic signal tends to infinity, the Fourier coefficient of the Fourier series tends to zero, at least mathematically makes sense. But, physically, seeing all the continuous spectra of a Fourier transform, this amplitude of each component in the spectrum is zero makes no sense. I can literally see an amplitude. At a particular frequency. How is it zero????? What am I missing?


texts:
As I understand it and have it currently implemented, linear prediction [via Burg's method or the autocorrelation method] is a block algorithm. Hence, there will be latency involved because one must first save a block of samples to use in the analysis -- even if the model order is low.

But are there any sample by sample implementations of linear prediction? Are they less robust to noise?

Edit: To be clear, I am really looking for a sample by sample estimation of the autoregressive polynomial coefficients in order to do inverse filtering. Does such a thing exist?

Edit: Thanks to RBJ for pointing out my conflation of terms.


texts: How to keep the same power (sonority) between pure sines?

texts:
I have a list of sine waves in 1/3 Octave (63,80,100...1k,1.25k,etc) that I want to reproduce with the same power. Right now I just have a global gain that applies to all this freqs, but of course the high frequencies are louder that the lower ones.

I am not sure how to keep the same power between them, I suppose I can use the principle of the pink noise and convert the gain (normalized 0-1) to dB, lower 3dB per octave as I go up in the list and go gack to normalized. But I am not sure if this is the correct way to achieve what I need.

How can I Keep the same power/Sonority?

Edit:
By equal power I mean they sound with "the same volume" to person listen to them.

For info, the user will be using mostly headphones. This is running on mobile phones.


texts: Is discrete cosine transform differentiable?

texts:
Is DCT differentiable? I.e. is $\frac{\mathrm{d}\mathrm{DCT}(x)}{\mathrm{d} x}$ defined?

I've seen a few implementations in automatic differentiation software packages, so I suppose the answer is positive, but I'm still missing a mathematical proof.


texts: Please i need help in understanding Nyquist sampling rate. What is the implication of sampling at a lower rate than the Nyquist rate, at exactly the Nyquist rate and at a rate higher than the Nyquist rate.


texts:
I am trying to to find a magnitude and phase response of a FIR filter as in problem 5.18 Digital Signal Processing 4th Edition by John Proakis. I got the frequency response as:

$$
H(\omega ) = 1 - e^{-j4\omega}
$$

I checked the manual solution and I got the same answer, but in that manual solution, the answer could be simplify to be:
$$
H(\omega)=2e^{-j2\omega}e^{j\pi/2} sin2\omega
$$

I don't understand what are the steps to simplify my answer into that solution, can someone derive it from my answer into the simplified solution. Thank you so much, hope that my question is clear enough


texts: Why Is Zero padding Required for Sobel Edge Eetection?

texts: Why do we leave two rows and two columns of an image (or) padding zeros to an image for detect edges while using Sobel operator and Prewitt operator?


texts: Identify if a Specific Edge Pixel Belongs to Horizontal, Vertical or Diagonal Edge Line

texts:
I have a code below that identifies the edge of the text image. Input image is:

Output display is:

I want to select random points near the edge border of the text. I was thinking to identify if the edge pixel is part of the horizontal or vertical line. If it  is part of the horizontal line, I can choose a vertical random point, else if the edge pixel is part of the vertical line, then I can choose a random horizontal point. How to it in Python? Aside from my logic, is there any better way to select the random points? Below is my initial code:

from PIL import Image
from matplotlib import pyplot as plt
import numpy as np
import cv2

image_counter = 1
path = 'sample/' + str(image_counter) + '.png'
image = Image.open(path).convert('L')
image_width, image_height = image.size
image = np.array(image)

sigma = .33
# compute the median of the single channel pixel intensities
v = np.median(image)
# apply automatic Canny edge detection using the computed median
lower = int(max(0, (1.0 - sigma) * v))
upper = int(min(255, (1.0 + sigma) * v))

#Edge Detection
edge_image = cv2.Canny(image,lower,upper)
plt.subplot(121),plt.imshow(image,cmap = 'gray')
plt.title('Original Image'), plt.xticks([]), plt.yticks([])
plt.subplot(122),plt.imshow(edge_image,cmap = 'gray')
plt.title('Edge Image'), plt.xticks([]), plt.yticks([])
plt.show()

#Select random points outside text borders
#Select random points outside text borders

for x in range(image_width):
    for y in range(image_height):
        if (edge_image[x][y] == 255):
            #Check if the edge pixel is part of the horizontal or vertical line.
            #If part of the horizontal line, pick a random point vertically.
            #If part of the vertical line, pick a random point horizontally.
            # How to do it?

Desired output:


texts:
Does any one of you know what topic to teach people related to signal processing.
The audience is mainly for a group of software programmer working on a telecommunication product who have limited knowledge of signal processing.
Thanks!


texts: Pitch detection algorithm for minsample size

texts:
I am looking for a pitch detection algorithm that uses the least number of samples.

I don't care about the processing time.

I hope to use this on audio signals.

I have tried using the one at the end of http://online.physics.uiuc.edu/courses/phys193/NSF_REU_Reports/2005_reu/Real-Time_Time-Domain_Pitch_Tracking_Using_Wavelets.pdf but the sample size to get a decent estimate is very high (maybe 4096 to lock a 440hz A note which is worse then my FFT)

Assuming super resolution I hope be predicting within +/- 2hz. So that a 440hz tone can register as no worse then 438hz.

Edited: super resolution range.


texts:
I have a signal, S whose bandwidth is bw Hertz and is sampled at fs Hertz.

To contaminate it with a noise corresponding to SNR x dB, I used the matlab function

out = awgn(S,x);

But I have came across some codes doing it instead like the following.

out = awgn(S,corrected_x);

Where corrected_x = x + 10*log(bw/fs);

Which is the correct method and why?


texts: Real and imaginary part of signal after fft

texts:
I will take two sine waves i) 0.1 AMPLITUDE with no phase shift ii)0.4 amplitude with some phase shift 20 degree (Considering Both same frequency).

In time domain - If i divide signal 1 by signal 2 by taking RMS value,it was nearly 0.25
In frequency domain - I took fft of both the signals and divided signal 1 by signal 2, i got the result in real and imaginary part.

If i take the RMS value of frequency domain output(real and imaginary), i am not able to get the same result as time domain.

So what should i do to get the same result in both the case.

Thanks


texts: Covariance matrix associated with random DC level in Gaussian noise

texts:
Given a signal

$x[n] = A + w[n]$

where $A$ is a Gaussian random variable and $w[n]$ is Gaussian white noise, then the covariance matrix of the signal is given by

$[C(\sigma^2_A)]_{ij}=E[x[i-1]x[j-1]]=E[(A+w[i-1])(A+w[j-1])]$.

I understand this definition, but where does the reduced expression

$=\sigma^2_A+\sigma^2\delta_{ij}$

come from?


texts: Dynamically changing cut-off and sampling frequency of a digital filter

texts:
I have designed a low pass filter that smooths the output coming from an accelerometer attached to a vibrating machine. I designed this assuming cut-off frequency $f_{c1}$, and sampling frequency $f_s$. Now the issue is when I change the machine , I have to change the cut-off frequency and $f_s$ manually, else the output is not as smooth as expected. That is every machine is actually vibrating with slightly changed frequency.

Is there a way the filter learns the appropriate Cut-off frequency $f_{c2}$ and $f_{s2}$, itself, without me to change the code  and perform filtering based on this $f_{c2}$ and $f_{s2}$?

I shall appreciate if some one can provide some web-links so I can explore this area further.


texts:
How to calculate the channel gain if the channel is a $N$ by $M$ matrix,$N,M>1$

For example,i create a rayleight fading channel

H_AB  = 1/sqrt(2)*[randn(2,6) + j*randn(2,6)],and H_AB is a 2 by 6 matrix,if it is a $N$ by 1 matrix,i can just use $|H_{AB}|^2=H_{AB}^HH_{AB}$ to calculate a gain value,however,now $H_{AB}$ is a matrix,if i still use $|H_{AB}|^2=H_{AB}^HH_{AB}$,i will get a matrix,and power should be a value ,not a matrix.So how can i calculate the channel gain of $H_{AB} ?$ is it $trace(|H_{AB}|^2) ?$


texts: Can you count signal energy equivalent in frequency domain?

texts:
I read about method of analyzing audio signals where FFT result is bandpass-filtered and the energy of this band is counted.
Can you count the momentary energy in frequency domain?
Does this mean summing magnitude value from all frequency bins (after filtering)?

(I don't care whether this will yield the value similar to the one counted in time domain but just if this can be of some benefit - reflect the energy present within this band.)


texts: Audio output distorted with any FFT Windowing other than rectangular

texts:
For an experiment i have a simple application that takes a quadrature signal from a radio and then does the following:
Complex FFT -> Inverse FFT -> Cartesian to Polar -> audio out
If I tune the radio to an AM signal I can demodulate it perfectly well by this but it depends on how the FFT is processed.
In the FFT routine, I apply a window and if it is anything other than a rectangular window the sound is distorted even to the point where it's only noise.  The sample thing if there is any FFT sample overlap.  Why is this the case?
As I mentioned this is an experiment.  I already have a fully functional spectrum scope which provides very good resolution using a Blackman window and sample overlap.  I wish to add demodulation of the signals in the frequency domain starting from the spectrum but this is problematic.
Thanks for any insight (I'm a beginner in DSP).


texts: Trying to understand whether digital signals help in better bandwidth utilisation or not

texts:
Suppose x(t) is a continuous-time signal and x(n) is a discrete time signal obtained by sampling the signal x(t) at a Nyquest sampling frequency Fs.  The signal x(t) requires a bandwidth of B1 Hz for faithful transmission through a communication channel, while the signal x(n) requires B2 Hz in the same communication channel.

1-Is there are any relationship between B1 and B2? are the two equal?

2- Is it true that a digital signal utilizes bandwidth more efficiently as compared analog signal (perhaps by multiplexing) ?

Update

Thanks for useful comments.
I am a little bit confused. I can get a clear idea if someone can answer my following question:

Digital signals can utilize bandwidth more efficiently as compared to Analog. Is this true or false?


texts: Finding the output of frequency response

texts:
Suppose the input to an FIR system is

$x[n]=e^{j(2\pi n/7 -\pi/2)}$

Define a new signal $y[n] = x[n]-x[n-1]$ . The signal $y[n]$ can be expressed in the form

$y[n] = Ae^{j( 2 \pi f n + \phi)}$

Find $A$, $\phi$, and $f$.

I really would just like confirmation that I am correct.
I calculated $A = 0.8678$

$\phi = -1.7952$

$f = 0.2244$


texts: Is zero forcing Optimization technique or Equalization technique?

texts:
I got some problem in the equalization techniques. I am new to communication simulations but I have done some data analysis labs in my college. I read some where on Internet that in a research paper that
zero forcing is Optimization technique but on Wikipedia it says it is Equalization technique?

I am confused in equalization and optimization techniques in communication. I am doing a OFDM simulation project in MATLAB and I am stuck in terms of these. I have read on Google but they both terms are kind confusing

Can some body please explain the different equalization techniques and the use of zero forcing?
Why to use zero forcing and what are basic possible equalization techniques that can be used with zero forcing.


texts:
I have two images – mannequin with and without garment.

Please refer sample images below. Ignore the jewels, footwear on the mannequin, imagine the second mannequin has only dress.

I want to extract only the garment from the two images for further processing.

The complexity is that there is slight displacement in the position of camera when taking the two pictures. Due to this simple subtraction to generate the garment mask will not work.

Can anyone tell me how to handle it?

I think I need to do registration between the two images so that I can extract only the garment from the image?

Any references to blogs, articles and codes is highly appreciated.

--
Thanks


texts: Defining Model in Kalman for Getting Position Using

texts: I am stuck at modeling a system model, i.e. getting my state vector and input vector for navigating just using navaid and ins (tactical). My guess is that position is my only state vector and INS output (acceleration or velocity) is input vector. What is state vector and what is input vector in my case? As I just need 2 position which sensor must be used for update and which must be used for predict. Should I use 1d 2 kalman implementation for lat and lon or no etc?


texts:
I have to measure the distance between two pulse trains, each of which looks like a slightly long tailed Gaussian distribution. Is there a relatively easy curve fitting method for this? I can do it with the required accuracy if the distribution does not have a prominent tail.

[As an aside, autocorrelation using FFTs is not good enough]


texts: Query regarding complex poles and zeros ??always exist as conjugate pairs?

texts:
Complex poles and zeros always exist in conjugate pairs?If yes,in which context?
https://www.informit.com/articles/article.aspx?p=32090&seqNum=9
The above link mentions this idea with eq 3.50


texts: Overlap/add time-domain audio frames: How does normalization/scaling work with overlap greater than 50%?

texts:
I am attempting to overlap-add time-domain audio frames in a real-time context (with a continuous stream of data coming-in). Each frames consist of 1024 samples and have been previously "Hann" windowed in view of performing FFT/IFFT operations.

When the hopsize is set to exactly 50% (here, 512 samples), everything works fine as the frames "concatenate" in a way that it creates a flat-top. Consequently, there isn't any amplitude build-up occurring:

However, as soon as I try to set the overlap to a greater value, let's say 75% (=768 samples), the frames expectedly stack-up and their respective amplitudes accumulate in a troublesome way:

Unfortunately, I couldn't find any clear documentation on how to properly normalize overlapping frames based off the hopsize value, the framesize and the window type.

What would be the proper way of scaling my audio signal ?

Thanks in advance


texts: Transforming Non-Uniformly Sampled Image onto Rectangular Grid

texts:
I have an image and associated latitude and longitude matrices. So I know the latitude and longitude of every pixel. However, due to the camera orientation, the image is skewed and thus the latitude and longitude sampling is non-linear. See the images below. I want to resample this image on rectangular, evenly sampled latitude-longitude grid. I have coded up a way to do this, but it's computationally expensive, and I feel certain that there must be a better way. I've done quite a bit of searching, but I haven't found good hits. Perhaps I just don't know the lingo necessary for the right search terms.

The image below is the original image.

I want to get a resampled image that looks something like this:

I produced this image, by basically moving a square boolean mask across the original image and finding the mean of the values as shown below:

Ideally, I think that pixels with mostly empty space should have an opacity value as well, but let's table that for now. Here's the MATLAB code I wrote to do this:

%% Create Skewed Image - All of These Are Knowns
rows = 1:size(frame, 1);
cols = 1:size(frame, 2);

% Create non-linearly sampled grid
lat_grid = zeros(size(frame));
lon_grid = zeros(size(frame));
for r = 1:numel(rows)
    for c = 1:numel(cols)
        lat_grid(r,c) = 0 + .001*rows(r) + 1e-3*cols(c) + 1e-6 * rows(r).^2;
        lon_grid(r,c) = 0 + .001*cols(c) + 1e-3*rows(r) + 1e-6 * cols(c).^2;
    end
end

h = figure; surf(lon_grid, lat_grid, frame, 'edgecolor','none'), view([0,90]),
colormap(gray(256))
set(gca, 'ydir', 'reverse')
ylabel('Latitude (deg)')
xlabel('Longitude (deg)')
hold on
filename = 'testAnimated.gif';

%% Create image in target grid
target_lat_array = 0:0.1:(max(lat_grid(:))+0.1);
target_lon_array = 0:0.1:(max(lon_grid(:))+0.1);
[target_lon_grid, target_lat_grid] = meshgrid(target_lon_array, target_lat_array);
resampled_frame = zeros(size(target_lon_grid));
n = 0;
for r = 2:size(target_lat_grid, 1)
    for c = 2:size(target_lon_grid, 2)
        n = n + 1;
        mask = ((lon_grid > target_lon_grid(r, c-1)) & (lon_grid < target_lon_grid(r, c))) & ((lat_grid > target_lat_grid(r-1, c)) & (lat_grid < target_lat_grid(r, c)));
        ph = patch(...
        [target_lon_grid(r, c-1), target_lon_grid(r, c-1), target_lon_grid(r, c), target_lon_grid(r, c)],...
        [target_lat_grid(r-1, c), target_lat_grid(r, c), target_lat_grid(r, c), target_lat_grid(r-1, c)],...
        [1e4, 1e4, 1e4, 1e4], [1,0,0,0.5]);
        if ~any(mask(:))
            delete(ph)
            continue
        end

        % Write to the GIF File
        im = frame2im(getframe(h));
        [imind,cm] = rgb2ind(im,256);
        if n == 1
            imwrite(imind,cm,filename,'gif', 'Loopcount',inf);
        else
            imwrite(imind,cm,filename,'gif','WriteMode','append');
        end

        delete(ph)
        resampled_frame(r-1, c-1) = mean(frame(mask));
    end
end

figure, imagesc(target_lon_array, target_lat_array, resampled_frame),
colormap(gray(256)), axis image
ylabel('Latitude (deg)')
xlabel('Longitude (deg)')

Anybody have any ideas? Like I said, I just feel certain that there must be industry-standard ways to do this.


texts: Do $|s(t)|$ and $|S(f)|$ uniquely determine $s(t)$?

texts:
Consider a signal $s(t)$. My question is if you know $|s(t)|$ and $|\mathcal{FT}[s(t)](f)| = |S(f)|$ or equivalently $|s(t)|^2$ and $|S(f)|^2$ is it possible to determine $s(t)$? That is, is $s(t)$ uniquely determined by $|s(t)|$ and $|S(f)|$?

My strong feeling is that the answer is no but I can't come up with two signals $s_1(t) \neq s_2(t)$ which have the same magnitude and whose Fourier transforms have the same magnitude. Actually I can come up with trivial examples but that doesn't fully satisfy me. Let me share by work so far.

First of all, if we consider

$s_2(t) = s_1(t) e^{i\phi}$

Where $\phi$ is any real constant number then we clearly see that

\begin{align}
S_2(f) = S_1(f) e^{i\phi}
\end{align}

and

\begin{align}
|s_2(t)| &= |s_1(t)|\\
|S_2(f)| &= |S_1(f)|
\end{align}

So this example is a clear counterexample. However, this is just a trivial global phase that cannot be determined. That is, it is clear now that there is global phase multiplier that cannot be determined if only $|s(t)|$ and $|S(f)|$ are known. But, lets say that we either don't care about an overall phase factor or we happen to know that $s(0) = |s(0)|$ so that this global phase can be fixed.

Is it possible to come up with a non-trivial example of two functions which are a counterexample to what I am asking? I can phrase it this way.

If $|s_2(t)|= |s_1(t)|$ then

\begin{align}
s_2(t) = \Phi(t)s_1(t)
\end{align}

Where $|\Phi(t)|=1$ for all $t$. We then have that (by the convolution theorem)

\begin{align}
S_2(f) = S_1(f) \ast \Phi(f)
\end{align}

The question is is it possible for

\begin{align}
|S_2(f)| = |S_1(f)\ast\Phi(f)| = |S_1(f)|
\end{align}

If a non-trivial $\Phi(t)$ could be demonstrated then it would be clear that $|s(t)|$ and $|S(f)|$ do not uniquely determine $s(t)$ in any sense but I can't seem to come up with anything.

If I am wrong and it turns out that $|s(t)|$ and $|S(f)|$ do in fact uniquely determine $s(t)$ then could anyone provide a method to determine $s(t)$ (up to a missing overall phase) from $|s(t)|$ and $|S(f)|$?


texts:
I have 2 sensors, sensor A is sampling a signal at 1kHz, and sensor B is sampling the a signal at 100Hz.

Every timestamp that sensor B takes a measurement at is contained in sensor A. That is, sensor B takes a measurement essentially every 10th measurement taken by sensor A.

How should I downsample sensor A so that both data streams are 100Hz. Can I just pluck every 10th sample from sensor A, or should I low pass filter sensor A first? What frequency should the low pass filter be set at?

EDIT: It seems to me there should be no difference between taking every 10th sample or lowpass filtering if the signal I care about is less than 50Hz. Is that true?


texts: Speech recognition library for detecting phrase in file

texts:
I want to find all occurrences of a specific phrase in a set of audio files (it's a catch-phrase in a TV show). The phrase is pronounced by different people with different speed etc. What is the best approach to this problem?

Additional details: It's a one time thing. The end result should be a program that takes 30 hours of audio and produces timestamps of a particular short phrase. Obviously the training will be required. Problem is that while I'm a seasoned programmer I have pretty much no experience with speech recognition. I know that phoneme recognition engines exist will they get the job done? For now I need some pointers in the right direction.


texts: Real-time oscillation-like noise filtering

texts:
I am making real-time measurements, which are affected by some noise. This noise has oscillating pattern, i.e. the total signal tends to oscillate around the mean value. The examples of measurements are shown in figures below.

Filtering this noise after the signal is received is quite straitforward - we may use mean filter, for example.

What I would like to do is to implement real-time noise filtering, so that filtered signal would be close to its constant mean value.

What kind of methods of filtering could you recommend? I thought about Kalman filter, but the state model is unknown. Maybe there is something else?..

P.S. I am totally unexperienced in signal processing, please excuse me for any ignorance.

UPD: I am not considering mean filters, because the two pictures below represent only particular stages of evolution. It means that the signal evolves in an unpredictable manner in between. Mean filter usually leads to loss of information about such evolution.


texts: Impulse response if initial conditions are given

texts:
In most books, impulse response of LTI systems are calculated by assuming initial rest condition,  but how to calculate response of an impulse input if there are some initial conditions present ?
My approach - first calculate zero input response (only using initial conditions that are given) and then calculate zero state response (taking impulse as input) assuming zero initial condition and then add both of them and we got total response.
Problem
But I think this method will give wrong answer because due to impulse input there must be some changes occur in initial conditions, so I wanted to know

Due to change in initial conditions, which equation will change, zero input or zero state or both?

What is best approach to get solution of problem like this?

Is by using Laplace transform this problem can be solved
without any change in initial condition?


texts: number of samples and Amplitude accuracy,what's the solution to this problem

texts:
I'm colleceting data samples from a device (temporal signal) in order to analyze it with FFT function in MATLAB R2015b,first i get N=4063 data points with (delta_t=0.000015s) so my frequency resolution is (delta_f=1/N*delta_t)=16.4Hz,this give me pretty good results with amplitude,but when i did another measurment with N=8192 data points (delta_t=0.000061)  to obtain better resolution,the amplitude is not correct,i don't know really how to deal with this issue.so please if any body can help me with this i will be grateful,thank you

ps:i'm new in signal processing

below my code in MATLAB

sig_2=asp_ach_de1;
Fs2 = 1/0.000061;      % Sampling frequency
T2 = 1/Fs2;            % Sampling period
L2 = 8192;             % Length of signal
t2 = (0:L2-1)*T2;      % Time vector
% FFT FUNCTION
Y2 = fft(sig_2(:,2))
Q2 = abs(Y2/L2);
Q1 = Q2(1:L2/2+1);
Q1(2:end-1) = 2*Q1(2:end-1);
f2 = Fs2*(0:(L2/2))/L2; %FREQUENCY
figure(3)
plot(f2,Q1)


texts: Variation in Signal Power in Mimo system

texts:
I am exploring methods for reducing computations required by MUSIC (Multiple Signal Classification) Algorithm. Most of the computational power is spent on calculating SVD.

My approach is to take fourier transform of signal matrix and perform filtering to make it sparse; calculating SVD on sparse matrix takes much lesser time.
Usually, when filtering, the determining factor is not the noise itself, but spectrum leakage due to DFT. Smaller terms due to spectrum leakage also get removed when filtering.

My question is, is there limit in MIMO systems as to how much difference in power of two signals can be. For example, lets suppose, no of signals transmitted are 10. Is there a rule as to how high in power Signal 1 can be in comparison to Signal X.
$$ \frac{Signal-1}{Signal-X} <= K $$ whre X is not equal to 1. Can K be indefinitely large ?

Also, do you think sparseFFT with Cheby-Shev or any other proper filter can help in containing the leakages ? Deconvolving using windows is entirely out of question because it would increase the computations to the point of making the whole approach infeasible.


texts:
What papers or resources explain the conditions needed for filter stability in real-time tuning of parameters?
That is, how can I know when a filter is such or how to design a filter that will not pop or "jump discontinue" when its parameters are tuned?


texts: Detect almost circular shapes in RGB image

texts: I want to extract circular trees from this rgb image, I've tried circular hough and segmentation techniques but in vain. Any help?


texts: How does cascading biquad sections for higher order filters work?

texts:
I'm trying to implement an 8th order IIR filter and every application note and textbook I've read says that it is best to implement any filter of order more than 2 as second order sections. I used tf2sos in MATLAB to get the coefficients for second order sections which gave me a 6x4 coeffs for 4 second order sections, as expected.
Prior to implementation as SOS, the 8th order filter required 7 previous sample values to be stored (and output values as well). Now when implementing as second order sections how does the flow work from input to output, do I need to store only 2 previous sample values? Or does the output of the first filter feed as x_in in to the second filter and so on?


texts: FFT - radix 2 - decimation in time -frequency range

texts:
Hello,

I would like to ask how to decrease (make it narrow) frequency range for calculations in FFT radix 2 - decimation in time - algorithm?

Let me explain what I exactly mean:

When you compute DFT in regular manner (I mean not FFT) you make frequency bin loop, and for each frequency bin you need next loop to use each possible sample you have. Then you can measure whole frequency range - in example for audio it would be something like from 0 Hz to 44100 Hz, of course if you have buffer size the same as sample rate 44100. But very often we don’t need to calculate whole frequency range, in example for audio very often 20 Hz to 20 kHz is perfectly enough. So in regular computation of DFT, you can just change frequency bin loop range, and then you use all possible samples but measure only those chosen frequences.

But when you compute DFT by FFT algorithm, you first divide your buffer size by half of a buffer size, so in my example you compute 22050 DFTs with two point size of each. And then you conquer results in log2(buffer size) steps. From the the first step to the one before last there is no loop that correspond to frequency range or just I can’t see it. Only the last step correspond to frequency range.

So my question is:

can I shrink the frequency range only in that last step, or can I do that in some way for whole FFT algorithm? If yes, could you give me some hint, how to do that?


texts:
When you see software packages that read in data from sensing equipment, does the software do something to inverse the transfer function?

Correct me if I'm wrong in my understanding, but this is how I see it:

The sensor takes in input signal $x(t)$ and the sensor has some frequency response governed by the Transfer function of the sensor which alters the signal $x(t)$ to some deformed signal $y(t)$. So if anybody wanted to know about the actual signal would they inverse the Transfer function? And is this on top of other calibration values? Gain etc..?


texts: A DT sequence y[n] is constructed from another DT sequence x[n]

texts:
A DT sequence $y[n]$ is constructed from another DT sequence $x[n]$ according to the
formula $y[n]=x[nN]$, where $N$ is a constant positive integer greater than one. (This process is usually called decimation, although this name would strictly be appropriate only if $N = 10$.)

a) Sketch a typical $x[n]$ and the corresponding $y[n]$ for, say, $N=3$.

b) Suggest a set of conditions to be imposed on the DTFT of $x[n]$ such that it will
be possible to reconstruct $x[n]$ for all $n$ from $y[n]$ .

c) Describe a specific scheme for carrying out the reconstruction if the conditions of (b) apply.

d) The conditions on $x[n]$ that are sufficient to permit reconstruction of $x[n]$ for all $n$ given $y[n]$ are not unique. Describe at least one set of conditions different from those in (b) that will also suffice .

Thank you


texts: adding phase noise in signal thorugh freuquency

texts:
I want to implement a simple signal for phase noise. According to my supervisor, i shoud be adding phase noise in the frquency. This is my signal. A = cos(2*pi*fc*t) and signal with phase noise B = cos(2*pi*(fc+deltaf)*t). here how shoud i define delta f?

After that when i analyse both signals using fft, spectrum of B signal should be broader than spectrum of A signal.


texts: Signal-to-Noise Ratio (SNR) needed to discern two superimposed signals

texts:
Say I am trying to measure a exponentially decaying signal ($S_y$), that constitutes a portion $\gamma$ (about 5% so $\gamma=\frac{1}{20}$) of total signal measured($S=S_y+S_b$ and $S_b=S_0 \beta e^{\frac{-t}{C_b}}$ and $S_y=S_0 \gamma e^{\frac{-t}{C_y}}$). Where $\gamma+\beta=1$ and $C_Y$ is about $\frac{1}{4}$ of $C_b$. I want to determine the least Signal-to-Noise Ratio (SNR) needed to be able to discern that signal. The noise in our signal is additive white noise. Should the SNR be $>\gamma=\frac{1}{20}$ or is there a better more formal way to decide the SNR limit? $$S(t)=S_0(\gamma e^{\frac{-t}{C_y}}+\beta e^{\frac{-t}{C_b}}) + n(t)$$

So my question is how do I determine the minimal SNR when I measure signal $S$ over time $t$, but the thing I am interested in is fluctuation (max 10%) in $S_y$. All constants are known to me, however i only know the mean of $C_y$, as it fluctuates and so $S_y$ does too. Thanks for any help. If I need to clarify any details please tell me and I will do so.


texts: Ultrasound pulses and reflection problems

texts:
I am building a whiteboard to track the position of its pen. I have n ultrasound receivers placed on the periphery of the whiteboard, and an ultrasound emitter in the pen. The pen emits pulses the receivers detect. A microprocessor gathers the arrival times of the pulses for each receiver, and with the time differences of arrival (TDOA) it makes an estimate of the position of the pen following a multilateration algorithm.

Ultrasounds reflect on surfaces, which can cause interference. This is a restriction on the frequency of the pulses. At the moment, I pulse the pen at 10Hz, which is enough for the reflections to die off and not interfere. Unfortunately, 10Hz is not fast enough a sampling for my purposes. Ideally the pen would pulse at 100Hz. (The pen emitter is connected to a microcontroller, so I can control the shape and frequency of the pulse.)

What tricks can I use to tackle the reflection issue? What are some standard filtering techniques? Could using different pulse patterns in a cycle help filter out the reflections?


texts: How to prove $cos(t) + cos(\pi t)$ is non periodic function? Also can I represent this signal using fourier series?

texts:
I would just want to prove $\cos(t) + \cos(\pi t)$ is non periodic.

I don't know where to start it. Also I know that individually these signals ie $\cos(t)$ and $\cos(\pi t)$ are periodic with frequencies $1/(2 \pi)$ Hz and $1/2$ Hz respectively. But since the superpositon of these signals is not periodic should we represent them using Fourier transform only? What is the harm in drawing the frequency components at $1/(2 \pi)$ Hz and $1/2$ Hz using fourier series?


texts:
I wanted to write a function for sampling sine function with sampling frequency sf,frequency f and length l, so I wrote the function adopting from the sampling formula, what change should I apply to my function? or is there any better way to do so?

function X = ssin(f,sf,l) %f as frequency, sf as sampling frequency, l as length

End=l/f;

t = 1/f:1/f:End;

d = 1/f:1/sf:End;

pt = pulstran(t,d,'rectpuls');

ms = sin(f.*t);

X = pt.*ms;

stem(X)

end


texts:
I am trying to simulate an OFDM based system in MATLAB where the estimated channel in the reciever is fed back to transmitter. As a proof of concept I wanted to return the ideal channel. I used the following barebones code (not considering pilots, nulls or gaurdbands etc.,)

pathGains = 10.^(-(0:2:19)/10); % 10 taps channel
g = (randn(1,10) + 1i*randn(1,10)).*sqrt(pathGains*0.5); % Rayleigh
Xf = complex(randn(1,16),randn(1,16)); % random input for the ofdm
xt = ifft(ifftshift(Xf),16);
yt = conv(g,xt); % really not sure about this
Yf = fftshift(fft(xt,16));
H = Yf./Xf; % estimated channel
G = fftshift(fft(g,16)); % ideal channel

My question is whether the above approach is correct. Especially regarding the convolution since fft essentially implies circular convolution.
(When running the above code I get an all ones for H while G is different. Hence my doubt about the correctness.)

The above channel model assumes no doppler (the channel is LTI). If considering doppler I understand that each sample will have varying values for the taps (An  $n\times 16$ matrix, $n$ being the number of samples). The channel output would be a superposition over the corrresponding input values. How would I consider the ideal channel for this case? (from the above $n\times 16$ matrix)


texts: Why are anticausal systems even defined?

texts: I guess the same question is usually asked for complex numbers too, but the fact is that complex numbers are used all the time practically. However, at least on a quick google search, I couldn't find any applications of anticausal systems. So why define it in the first place?


texts: Is there any trade-off between the sparseness and residual of the constructed data?

texts:
I am going to test a sparsity promoting algorithm with different parameters to solve the $Ax=b$ to obtain a sparse model $x$. I have to test different parameters for which my algorithm results in different answers for $x$.

With different $x$'s there are different $Ax=\hat{b}$ 's. To have a better comparison, I forced my algorithm to iterate while the $\left\|Ax-b\right\|^2<\epsilon$.

Now that I obtained all $x$'s for which $\left\|Ax-b\right\|^2<\epsilon$ , how can I determine which model, $x$, is better? I know that I am looking for a model that is more sparse and have a better fit to $b$ but I think I have to consider somehow a trade-off between the sparseness and residual.


texts: Cascading conventional filter with matched filter

texts:
The most upvoted answer to this question suggests to use a "conventional" filter in cascade with a matched filter to first remove out of band noise (with conventional filter) and then optimize signal to noise energy (with matched filter).

Given a sampled signal where it is known that all relevant signal information is located in signal's baseband such as this one (the relevant signal here has a gaussian shape):

and where additive noise information is not known (I know it is for that specific signal, but let's assume it could have any property (colored, white, correlated, etc)).

Is it always better to use the proposed cascaded filters (conventional and then matched filter) or would it be equivalent to only use a matched filter with a gaussian shape?


texts: Why is telephone audio sampled at 8 kHz?

texts:
When did we decide to sample telephone at $8$ kHz? Has this always been the case? Why did we do that? Is it because higher bit rates can't be transferred as quick? And do these reasons still count? And if not, why isn't there a new standard yet? Is it true that $8$ kHz is the lowest possible sampling rate to transfer understandable speech?

I'm trying to find sources for this, but there doesn't seem to be much information about it.


texts:
I am trying to find frequency response and magnitude of the frequency response of the following system impulse response:
$$h[n] = 2\delta [n] + 2\delta [n-1]$$

I understand, that through the DTFT:
$$H(\omega ) = 2(1 + e^{-j\omega})$$

However, I am unsure how to find the magnitude of the frequency response.  The solution is:
$$|H(\omega )| = 4 \left| \cos \left(\frac{\omega }{2} \right) \right|$$

What steps are needed in order to convert the above frequency response to the magnitude of the frequency response?


texts: How to compute impulse and frequency response of Flanger?

texts:
I have to the implementation of a Flanger effect on Matlab, buy previously I have to plot its frequency response and impulse response.

The difference equation is $y[n]=x[n]+a\cdot x[n-d[n]]$
where $a$ is a constant, $|a|<1$, and $d[n]=\frac D2 (1-\cos(2\pi f_s n))$;
$D$ and $f \text{ const}$.

I'm having trouble on how to calculate any of DTFT o Z Transform of such difference equation. I can't find how to compute the varying time shifting transform for $x[n-d[n]]$.

Is there any other way to compute impulse and frequency responce?


texts:
Given is the illustrated circuit diagram of a linear, time-invariant, time-discrete system:

How do I show that the total system has the impulse response $h[n] = aδ[n] + bδ [n - 1] + cδ [n - 2]$ and determine the constants a,b and c?

with the following impulse responses of the subsystems:

$h_1[n] = δ[n] + (1/2)δ[n − 1]$

$h_2[n] = δ[n] − (1/2)δ[n − 1]$

$h_3[n] = −δ[n]$

$h4[n] = − (1/2)^n σ[n]$

So what I have done:

$h_{3||4}=−δ[n]−(1/2)^n σ[n]$

and than:

$h_{3||4+2}=\sum_{k=-\infty}^{\infty}(δ[n-k] − (1/2)δ[n-k − 1])(−δ[n]−(1/2)^n σ[n])$

But problem is that I don't know how to calculate this and than to do it in parellel with $h_1$ to get this form $h[n] = aδ[n] + bδ [n - 1] + cδ [n - 2]$ ?


texts:
I'm working on a Ultrasonic Transducers resonance tracking system. Where phase shift between Voltage and Current is the feedback signal for my system when phase difference is Zero that means system is resonant other wise depending on the phase difference frequency will be changed proportionally. I went through lots of different techniques of phase detection which includes Several

Analog(Comparatively Simple) techniques such as:-

Phase Locked Loop
Zero Crossing Based Phase Measurement
Simple Phase Detector ICs

Digital(Complex DSP Based) Techniques Using Mathematical Algorithms such as:-

Cross Correlation
FFT
Goertzels Algorithm
Sine Wave fit Methods
VVV

So, My question is:- Which system will be best to use for a phase difference calculation analog or digital?

Considerations & Preferences:- Transducer is noisy (Gaussian white noise + harmonics of fundamental). Accurate phase difference calculation is crucial.


texts: How do I modulate complex time domain signal to a carrier frequency?

texts:
I want to modulate a complex time domain signal to a carrier frequency 1880MHz but the sampling frequency is 30M which is smaller than Fs. I did upconversion using

exp(1i*2*pi*Fc*(0:length(signal)/Fs))

but the PSD isn't centered at Fc. I need to plot PSD and find the relation between the centered freq and the target Fc.


texts:
So I have
$$x_1=2 \cos(.6\sqrt\pi x+\pi/6)$$ and $$x_2= \sin(1.2\sqrt\pi x-\pi/3)$$ and need to find the period of $(x_1+x_2)^2$.

Let $$a=.6\sqrt\pi x+\pi/6 ~~~\text{and} ~~~ b=1.2\sqrt\pi x-\pi/3$$ so that
$$x_1=2 \cos(a) ~~ \text{and} ~~ x_2=\sin(b).$$

And finally we get:
$$(x_1+x_2)^2=1.5+2\cos(2a)+2\sin(a+b)+2\sin(a-b)-.5\cos(2b)$$

Now, the how do I calculate the time period of it?

Edit:

$$\text{period of the individul sinusoids in the square}~~T_1=5\sqrt\pi/3 ~~ T_2=10\sqrt\pi/9~~T_3=10\sqrt\pi/3 ~~ T_4=5\sqrt\pi/6 $$

$$\text{The ratios are}~~T_4/T_3=1/4~~T_4/T_2=3/4~~T_4/T_1=1/2$$

$$\text{LCM of denominators is 4 } $$

$$\text{Hence period }~~T=4T_4=10\sqrt\pi/3$$
is that correct?


texts:
I have the problem of masking tinnitus. I have the following questions:

Can broadband noise mask tone tinnitus, or any kind of tinnitus (such as narrowband, or chirp)?
Assume an audiogram test has identified tinnitus as tonal with loudness level of $x$ dB and  frequency/pitch of $y$ Hz. How can I create broadband noise  using this information (note that we don't know the variance of the noise)? How could this be implemented in Matlab?

Thanks.

sedy


texts: Does sum of random variables follows gaussian distribution although each have different mean and variances?

texts:
I understand Central limit theorem, but cannot understand the result when it applies to diverse situation.
As far as I understand, Central limit theorem states follows:

No matter what random variable has its distribution, if we pick n samples and mean (or just sum) them and do this many time, those values will follow normal distribution (if n is big enough).

And there is a good example for this: a Brownian motion.
If we measure the distance that particles moved suspending in a fluid, distance will follow normal distribution because sum of random hit(movement) of fluid particle will follow normal distribution according to Central limit theorem.
However, for central limit theorem applies, random variables which are merged should follow all the same means and variances. In upper example, all random particle movement will follow same mean and variances, because they have same temperature.
But as far as I understand, there are many cases where noise follows normal distribution but there components are not necessarily follow same mean.
(S_n = (X_1 + X_2 + ... X_n) / n and S_n follows normal distribution but X_i s have all DIFFERENT means)
For example, electrical noise will be composed of many other things which are not necessarily follow equal to each mean. But why electrical noise can be approximated as gaussian noise? Not only electrical noise, why many other things are treated as normal distribution(S_n follows normal distribution) although their components don't have equal mean?(X_i s have all DIFFERENT mean and variances)
Thank you for reading!


texts: Alternatives to Hough transform for detecting a grid-like structure

texts:
I have an image which is composed of multiple 'angles' which form a grid shape:

After some searching, Hough seemed like a good fit, because it isn't troubled by breaks in lines. However, the problem I have is that my lines are 'fat', and any edge detection I run (Canny in this case), picks out the edges of the line, and not the middle:

This means that the Hough transform ends up picking out one (or both) of the 'sides' of my grid lines, and not the middle.

Given that I know what I'm looking for (this grid-like shape, always in roughly the same orientation), is there a better way to perform the 'edge detection' part to give me the centre lines, or should I be looking at a totally different method?


texts: Why are binary signals drawn continuous in time despite being a digital signal

texts:
The conventional definiton of a Digital signal is as follows:
A digital signal is a signal that is discrete in time and quantized in amplitude. Almost all resources (textbooks, online sources,etc) stick to this defintion and gives emphasis to the point that a digital signal is discrete in time.

A binary signal is a  Digital signal.

But according to the defintion, the signal should be discrete in time to be a digital signal. In the plot, a binary signal is drawn as continuous in time. Then how can this be a digital signal according to the defintion.

A digital signal according to the definition should look like this:

Also I read that a digital signal has different meaning/definition in different contexts.
For example the above mention definition is apt in the signal processing context, whereas in digital electronics where the binary signal mention above is used, a digital signal is a signal that takes only discrete amplitude values(ie. it is quantized in amplitude) and it can be continuous or discrete in time.

I am confused that why is the above definiton given a strict emphasis even in digital electronics context usually. Almost everywhere I look in internet and even some teachers give the conventional definition of a digital signal without mentioning the context.

Are my above findings correct?
I would like to know the exact definitions of a digital signal according to different contexts.


texts: In image processing, a Guassian filter is used to blur an image. A low-pass filter is a filter that attenuates the high frequencies, preserving only smooth variations in the provided image. Is a Guassian filter a low-pass filter because it smooths the edges (or, in general, the parts of the image where there is a high variation of the intensity)? Why exactly is the Guassian filter a low-pass filter?


texts: Are circular buffers relevant to transposed direct form IIR filters?

texts:
I'm currently working on a project where I'm programming IIR digital filters. I have already finished the direct form 1 and & 2 implementations.

When doing direct form 1 and 2, I was able to leverage the use of circular buffers for storing data. This allowed me to easily insert new values into a tap line and save the cost of shifting data in memory.

However, I've just started working on the transposed direct form 1 filter and am having a difficult time in identifying whether or not a circular buffer is needed. Unlike the direct forms 1 and 2 where the memory was simply shifted, it seems like the transposed forms require all the previous values to be rewritten.
Essentially, the block diagram appears that every memory state will change depending on some current value.

Referring to the transposed direct form 1 diagram illustrated here, it shows that each 'state' will be dependent on a previous state as well as some instanteanous value. The instantaneous value in this case is v[n].

So my questions:

Do/can transposed direct form filters benefit from circular buffers?
If not, does this mean that transposed realizations are computationally 'more expsensive' due to the fact that every state (memory) has to be recalculated for every filter update?


texts: The estimation deviation in specific angles of Circular array DOA in circular harmonic domain

texts: Recently, I study the MUSIC doa in the circular harmonic domain, but I found the estimation results always have a big bias in some specific angles(angles near to 0 or 180 degree), as showing in the  Figure, I'm so confused because the estimation deviation in other angles is small, can someone told me the possible reason?


texts: Is there any method to find K value in KNN?

texts: I am new to Matlab. For me the task is to perform data classification on some data set. The given data set consists of numeric values. One thing that bothers me is I have to perform all KNN, ANN, and SVM. In performing KNN, I faced a problem of how to find the value of K. If it is user defined? From which value we have to start and when to stop it?


texts: How to Validate Bilateral Filter Implementation?

texts:
For this may be a X-Y question, I'm providing the full background story:

I'm trying to test for the correctness for a fixed point implementation of bilateral filter written in C.

My current approach is to compare it's output with a double-precision Matlab version.

This helps me capture issues like insufficient precision, pointer out of bound and uninitialized variables and other (stupid) bugs.

Now the C version matches Matlab version with sufficient precision and with no obvious bugs, but I'm not very confident that Matlab version is correct at all, for it is not fully tested or reviewed by anyone.

Having worked as a tester for a while, I have the feeling that be best way, if not the only way, to test for correctness of the implementation of a signal processing algorithm, is to check for it's properties.

For instance, this CDF 9/7 wavelet example uses "perfect reconstruction" property and "N vanishing moments" property as test cases, and it indeed established a fair amount of confidence that his implementation works.

The only property of bilateral filer is "edge preserving", which isn't a strong proof of correctness.

Does bilateral filter has other properties that can be used as proof of correctness of an implementation?


texts: Please suggest me good algorithm for video segmentation based on changing background?

texts: Iam having 1 min video.I need to cut the video into 5 segments depending on changing background.Please suggest me good algorithm which can be easily implemented in matlab.Please provide me helpful links.


texts: What would the plot of an two sided digital signal look like?

texts:
Please, take a look at section, 1.2.3 (Signal Duration), Page-03, of the book Shaum's Outlines: Digital Signal Processing by  by Monson H. Hayes.

According to the definition, I can imagine how a right-sided and a left-sided signal look like.

But, I cannot visualize a two-sided signal.

What would an two sided signal look like?

All I need is to see a double-sided signal. As far as I know, a double sided signal is a complex exponential signal. So, that means it should be a plot of a complex exponential function. Am I correct?


texts:
I have to calculate the Fourier coefficients of this signal. I found that signal equation is $$ y = \frac {A(2t-T)}{T} $$

To find Fourier coefficients I wrote

$$ x_k = \frac{2A}{T} \int_{0}^{T/2} \frac{2t-T}{T} e^{-i2 \pi k f_0’ t } $$

In this case $$ f_0’ = f_0 $$ because the period is T_0

I calculate the integration by parts of the first integral and I obtained $$ - \frac{-e^{-i \pi k }( i \pi k ) +1 - e^{-i \pi k }}{4 (\pi k f_0 )^ 2} $$

( i control This with wolfram and should be correct, I hope !)

After solving the integral by parts I obtained that

$$ x_k = \frac{A( e^{-i \pi k} + 1 - \pi i k )} { (\pi k )^2} $$ but the result should be $$ \frac{iA}{k \pi} $$

I can also post all my resolution. Can someone help me ? Thank you


texts: Energy of coefficients of wavelet decomposition?

texts:
I have recently been working with a dataset associated with the paper Human Activity Recognition from Accelerometer Data Using a Wearable Device.
In Section 3.1 - Feature Selection for Motion Data, the authors describe how they derive the vectors they use for classification from the accelerometer data. One of the features they list is "energy of coefficients of seven level wavelet decomposition". I am unable to determine the meaning of this phrase through google searches. Specifically, I do not know what they mean by the "energy of coefficients". I am able to perform the seven level wavelet decomposition, however. Is anyone familiar with this method?


texts: Discrete Wavelet Transform (DWT) Filter Bank

texts:
I have some stumbling block in my thesis writing.

Do we use the same filter pair while implementing DWT filter bank with downsampling of the filter output, or filters do change also from level to level?
Though on the Wiki page and in the book "Biosignal and Medical Image Processing, 3rd edition" by J. L. Semmlow and B. Griffel there are same labelling of filters at each decomposition level on the filter bank schemes:

,
the description in Wikipedia states: "The filter output of the low-pass filter g in the diagram above is then subsampled by 2 and further processed by passing it again through a NEW low- pass filter g and a high- pass filter  h with half the cut-off frequency of the previous one.."(c)

This resulted in big confusion for me. Logically, as I have been thinking before, for DWT we "travel" in frequency domain by signal downsampling and leaving the filters untouched (while e.g. in Stationary Wavelet Transform it is achieved through upsampling the filters themselves without signal modification).
The word "new" in Wiki frustrated me a lot.

Please, help me to resolve this issue.

With respect,

-Andrey.


texts: Sensor rise time compared to experimental step input rise time

texts:
I have a dynamic calibration system. With it, I am applying a experimental step input to a pressure sensor. The goal is to measure the step response of the sensor and use it to calculate the frequency response.

The problem I have is that the sensor has a fast rise time. Due to the nature of what I doing, I cannot make the rise time of the input signal much faster than it already is. So I am looking for some reference on how the non-ideal input rise time of a signal affects the measured step or frequency response. Would it be reasonable to quantify error based on the difference in the frequency domain between ideal and non-ideal step inputs?

I have looked my school's library a number of times for papers on this, but I could just be using the wrong words.


texts: Removing white pixels from a b/w image in MATLAB?

texts:
Consider this MATLAB code:

mg=imread(........bmp');
level=graythresh(mg);
x=im2bw(mg,level);
figure,imshow(x);
BW2 = bwperim(~x);
figure,imshow(BW2);

operating on this image (NOTE has white margin, see here):

The result was (original link here):

How can I remove the white pixels from the second image and then obtain the first image with everything but the white pixels removed from the second image.

In other words, how can I remove the boundaries from the second image and then get the original image without these boundaries?


texts:
I am trying to process an audio file in Matlab by filtering out all frequencies except those within $\pm 25\ Hz$ of $523\ Hz$ (as well as its harmonics up to the Nyquist).

The resulting waveform should look like the green wave displayed below (blue being the original):

However, my resulting waveform is entirely zero:

Here is the simple code I wrote:

[s, Fs] = wavread('file.wav');
n = length(s);
f = linspace(-n/2, n/2, n)/(n*Fs);
S = fftshift(fft(s)/n);

filter = zeros(size(S));
f0 = 523;
while (f0<(Fs/2))
    filter(abs(f-f0)<25)=1;
    filter(abs(f+f0)<25)=1;
    f0 = f0+523;
end

s_filter = real(ifft(fftshift(S.*filter)*n));
s_filter = int16(s_filter);

Tspan = n/Fs;
t = linspace(0,n,n)/n*Tspan;

plot(t,s, t, s_filter);

The problem is that the filter array returns only zeros. But what exactly causes that?

Any help would be greatly appreciated.


texts: how to extract meaning from signal (distance estimation)?

texts:
I have 3 times series representing detected rssi signal power from 3 emitting devices. The devices are at 1 meter distance from the receptor, plotting the 3 time-series gives the following results :

My question is : Is there a way, a general mechanism, a filter, or an algorithm for processing these signal, so that I can find some common regularities between them to which I can assign the distance 1 meter, and predict that distance for different time-series?


texts: Features for audio levels imbalance in films between speeh/music/effects

texts:
What would be the key features of an audio track or set of tracks (like 5.1) for identifying film audio tracks that have a clear unbalance between speech levels and sound effects levels (apart from the obvious rms diference between tracks)? And how could they be extracted or calculated?

It's for a machine learning project about automatic identification of such files and ulterior processing/fixing. The imbalance could be on the same track, or in a combination of several ones.

Thanks in advance.


texts:
Please, explain in layman's terms,

Why do we need a Homomorphic Filter?
In what kind of situations should we use Homomorphic filtering?
What kind of images need Homomorphic filtering?


texts: why total energy of a finite duration continuous signal becomes infinite after sampling

texts:
If I have a continuous-time energy signal and multiply it with an impulse train, the frequency domain representation has infinite replicas. The total energy if we sum them up becomes infinite. What causes it to have infinite energy now?

I understand the derivation provided in many texts but I am trying to get intuitive understanding.


texts: What is the most efficient type of software bandpass filter?

texts:
I'm writing a C++ application to extract four modulated carrier signals at four separate frequencies, from a single input signal. I've designed four FIR filters at t-filter.appspot.com but they run very slowly, even when I reduce # of taps to 80.

Is there a better option? People seem to point to biquad filters – are these different from FIR filters, and do they run more quickly in software?


texts:
Given the signal shown below, what is the best way to remove the steps and local maximas it contains. The signal contains some steps which can last up to 100 Samples before they return to about the same value as before the step (Marked with red circles). There are also some peaks which last only for one sample which should also be removed.

First Dataset: On this set, the median Filter works as expected (not shown here).

On the following Dataset, the Medianfilter with the same settings fails. To many samples are replaced by the median value.

What I've tried already:

Work with a moving average. Advantage: Small peaks have less influence and are nicely removed. Disadvantage: Long lasting steps remain in the signal.
Get the first difference of the signal (diff(X)) and correct the value in X if a big positive change is followed by a negative change immediately. Advantages and disadvatages are the same as above.

What are some good methods to remove/correct these unwanted values?


texts: Sharpening Using Laplacian Kernel - How to Handle the Output (Specifically Negative Values)?

texts:
In order to sharpen an image using Laplacian kernel, it should be convolved with the original image.

It is evident that the result might have negative values. I am not sure what to do with these values:

Subtract the minimum from laplacian then map to [0, 255]
Clip negative values to zero and map to [0, 255]
Just clip negative values to zero

I know the next step is to add/subtract the laplacian to/from the original image and map to [0, 255] but I have doubts about the laplacian.

Indeed, I tested all three methods and 2, 3 got me to the right results but according to my Image Processing textbook, Laplacian should be scaled but it is not mentioned clearly that which version of laplacian is used to derive the sharpened image.

Thank you!


texts:
I have a file which is a recorded voice of a single word. The format of this audio file for me is unknown. Could you help me to decode or figure out how it is compressed?
I was trying to open it as a PCM (8/16 bits), VOX, uLaw, aLaw, but it does not work.. all I can hear is a loud noise.
Audio file example is at:
http://www45.zippyshare.com/v/91135513/file.html
It contains hearable word in english: "approaching", but I don't know how to decode this.
Have you ever seen something like this?


texts:
Suppose my dataset consists of $N$ example vectors $\mathbf{x}_{1}, \ldots, \mathbf{x}_{N}$ where $\mathbf{x}_{n} \in \mathbb{R}^{p}$ $\forall n$. I assume that each vector  $\mathbf{x}_{n}$ is comprised of an underlying true datapoint $\mathbf{s}_{n}$ that is corrupted by additive Gaussian noise $\mathbf{x}_{n} = \mathbf{s}_{n} + \mathbf{w}_{n}$.

What I want to do is estimate the $\mathbf{s}_{n}$. Can I do this with ICA?

So the ICA model is of the form:

$$ \mathbf{x}_{n} = a_{1,n} \mathbf{s}_{1} + a_{2,n} \mathbf{s}_{2} + \ldots + a_{N,n} \mathbf{s}_{N} $$

Does this mean I need to fit my problem to the model by assuming that $ \mathbf{s}_{n} = a_{1,n} \mathbf{s}_{1} $ and $\mathbf{w}_{n} = a_{2,n} \mathbf{s}_{2}$ ? If so, how do I recover the vectors $\mathbf{s}_{n}$ $\forall n$?

I ask because I see the ICA problem formulated as:

$$ \mathbf{x} = \mathbf{A} \mathbf{s}  $$

Would this then imply that: $\mathbf{s} = \mathbf{A}^{+} \mathbf{x}$, where $\mathbf{A}^{+}$ is the psuedo-inverse of $\mathbf{A}$? But how would I get the $\mathbf{s}_{n}$ out of this formulation?

Note: I cross-posted this on stats.stackexchange to get the statisticians' point of view, but I'd like to hear what the signal people have to say.

Edits:

So I do not know $\mathbf{A}$ but I do know that each $\mathbf{s}_{n} \sim f_{s}(\cdot | \theta)$ for some parameter vector $\theta$. I have specified $f_{s}(\cdot | \cdot)$ but $\theta$ is unknown. I also know that the noise vectors are not sampled from that same distribution, but that they are independent of the signal vectors.


texts: Removing vocal but retaining all background ambient noises

texts:
I have one audio file containing human speeches, a lot of ambient noises like audience laughter, birds chirping, sounds of natures etc..

Now I want to separate it into two audio files where one should contain all human vocals and other should contain all ambient noises like audience laughter, birds chirping, sounds of natures etc..

I have look into some methods like voicefilter paper from google AI but the result here is the human speech and it's not possible to subtract the resultant with the source sound to get the audio file for other ambient noises, since we can't just assume they are a linear combination.


texts:
In wikipedia, I read the formula to convert a power ratio to db. This formula is :

10*Math.log10(power_out / power_in);

But, for the sound pressure, I read the formula is :

20*Math.log10(soundLevel_out / soundLevel_in);

I read in some places a reason : it is because the sound pressure, like the voltage, have to be squared in the ratio and this squared becomes a 20 instead of a 10. Ok, but why ?
When I want to double the sound "feeling", I was told I need to double my power amplifier so, I understand it's a question of power (with no squaring) and not a question of voltage, but it's wrong.

Who can help me to understand where does this square comes from ?


texts:
For OFDM synchronisation, we are using two training symbols according to the Schmidl and Cox method of frequency synchronization and timing synchronization. The paper says:

The first OFDM training symbol has only even numbered subcarriers applying a PN sequence.The result is two identical half symbols in time domain each consisting of Nc/2 samples each.
The second training symbol consists of even numbered subcarriers that are differentially modulated with even numbered subcarriers of first training symbol using a PN sequence. The odd numbered subcarriers of second training symbol can be used for data, pilot or reference symbols.

I have two questions on this.

In OFDM, every subcarrier corresponds to one symbol which is a complex value. So what does it mean by saying  even numbered subcarriers are modulated in a symbol using a PN sequence? How does that ensure that it results in two identical halves of a time domain symbol.

what is differential modulation using a PN sequence. How is it achieved?


texts: Is there any way to align temporally two signals in spectrogram?

texts:
I am keen to know that If I have two signals say :
Farend_signal (y[n]) and Nearend_signal (x[n])
and x[n] also contains an echo of y[n] with some delay.
Is there any technique to align these two signals temporally is Spectrogram?
For example, any correlation technique to find the temporal displacement between signals after making a spectrogram(STFT) of two signals?


texts:
I have generated sinsuoids containing fundamental with harmonics using C++. Fundamental frequency is 50 Hz and each of the harmonic has phase offset of 60 degrees. I have applied flattop window before performing and N point FFT. Magnitude repose is correct. Phase reponse is wrong. I should expect 60 degree in all 100,150,200,250 Hz.
I have attached the results.

Sampling rate : 40000
Timeduration : 1s
Maximim amplitude of each of the harmonic : 1

Any help would be highly appreciated.

Regards,
Faisal


texts: Implementation of CUSUM to segment stable parts in a pitch contour

texts:
I've got the pitch contour of a person singing several different frequencies after each other (octave errors cleaned up). I'd like to segment the stable parts from the transitionary ones (gliding up down). Below is an example of the my data.

After searching the internet and this stackexchange, it seems what I'm really trying to do is step detection, and a common way to tackle this is the CUSUM algorithm (source). I am however at a loss on how to implement this correctly (my statistics math isn't that good).

From what I've read CUSUM is based on the log-likelihood ratio. I've read up on that, but don't seem to be able to wrap my head around how that applies to sample-per-sample dsp coding. My head spins from all the math notation in Bassevile and Nikiforov and I'm coming from a coders' background.

Is anyone willing to point me in the right direction? Are there resources available for this? I'm of course very willing to learn.


texts: How to implement Matlab welch in python with the same result?

texts:
I want to implement Matlab pwelch function in python.
The Matlab code is shown blew:

[PSD,f] = pwelch(data,length(data),[],[],2000);

which data is a row vector of double type with size (1 * 1547600)

My python code is:

f, Pxx_den = signal.welch(data, fs=2000, window=signal.hanning(len(data)), return_onesided=True, detrend=False)

The output of python code doesn't equal to the output of the Matlab code and I don't know how to set python welch arguments to reach Matlab output results.

Thanks for your attention.


texts: What's the computational complexity of MMSE equalizer in OFDM system

texts:
As I know that in case of one tap OFDM equalizer, (ZF equalizer), we should have $N$ division complexity since we divide every subcarriers by its correspondent channel tap in frequency domain.

But I couldn't calculate how much exactly the computational complexity in case if we used MMSE equalizer for the same OFDM system.

Could you please help me how to calculate that?

Thank you


texts:
I was reading circular convolution topic from Digital Signal Processing Using Matlab  3rd Ed,by Proakis. I came across a strange term/symbol; I have highlighted it in attached snapshot
Update:Pg150; same chapter,same book(just before example 5.4) contains this notation and mentions that it is a rectangular window of length N
I have also attached snap of eq 5.24,in 2nd snap, where this RN(n) symbol appears also:


texts:
There is a Matlab-based package called Chebfun that (among other things) computes polynomial approximations of functions. See here: http://www2.maths.ox.ac.uk/chebfun/.
I don't know anything about signal processing, but it appears that this sort of approximation process is the foundation of some kinds of filter design. Apparently, the "Parks-McClellan" algorithm is the one typically used for this purpose. The PM algorithm just looks like a form of Remez algorithm, and the Chebfun code claims to be a "modern" version of this.

So, has anyone tried to use Chebfun in place of the older Remez or PM codes?
If so, do you find that it's any better?


texts:
In order to meet the user requirements in the next
generation radio access technology, the ongoing standardization within 3rd  Generation  Partnership  Project  (3GPP)  offers flexibility in terms of employing mixed numerology.

I have read many papers about it, such that: This link.

I think it's a new technique but it's difficult for me to understand it well. It's like to use different carrier spacing instead of one fixed of 15 KHz in LTE, but that's not sure.

Could you please explain what is that mean in an easy way, and what's the benefit of it?


texts: Phase of signals in real and complex DFT

texts:
I have been reading chapter 8 - The Discrete Fourier Transform of the book The Scientist and Engineer's Guide to Digital Signal Processing and chapter 12 - Discrete Fourier transform of the book Continuous and Discrete Time Signals and Systems. I'm not sure if I have understood real DFT properly.
From what I understood, in real DFT, if the samples in time domain have size $N$, then the output is consist of $\frac{N}{2} + 1$ complex number. Denote the output as X[ ], then Re X[ ] (real part of the complex numbers) is a list of amplitudes of cosine wave, and Im X[ ] (imaginary part of the complex numbers) is a list of amplitudes of sine wave. As is illustrated in the image:

And all of these waves have phase equal to $0$.
Yet if we use the forward DFT formula $$ X[r] = {\sum}_{k=0}^{N-1} x[k]e^{-j(2 \pi k r / M)} $$ to compute ($M$ is usually considered to be equal to $N$), the output is a sequence consisting of $N$ complex numbers, for a input sample with size $N$. And each of those complex numbers represents a frequency component. Denote a complex number in the list as $a + bi$.
Is it the case that the frequency components have amplitude $A = \sqrt{a^2 + b^2}$, phase $\varphi = \arccos{(\frac{a}{A})}$ and they are shifted sine waves?


texts: Finding inverse z transform for two sided ROC?

texts:
I have a z transform   $Y(z)=(z^2-z) /(z^2+1.3z+0.3)$

In this case i have two poles ,one at -0.3 and one at -1.0

I want to find inverse z transform of Y(z)

Following is my matlab code:

clc
clear all
close all
syms z n
num=[1 -1 0]
den=[1 1.3 0.3]
[r,p,k]=residuez(num,den)

We know that ztransform of δ(n) is 1 and ztransform of u[n] is 1/(1-z^-1)

Keeping value of r,p and k in mind,our partial fraction becomes:
$$Y(z)= \frac{2.86}{z-(-1)} -\frac{1.86}{z-(-0.3)}$$

keeping in view that ztransform of u[n] is 1/(1-z^-1)

$y[n]=2.86(-1)^nu(n) - 1.86(-0.3)^nu(n)$
This above line is inverse ztransform for ROC |z|>1

$y[n]=-2.86(-1)^nu(-n-1)+1.86(-0.3)^nu(-n-1)$

This above line is inverse ztransform for ROC |z|<0.3

My question is that,how can i find inverse z transform for ROC  0.3<|z|<1

I have also attached a snapshot of a table of common z transform and i have higlighted two cases that i have used


texts: IIR Cascaded Filter Response, Unexpected Results

texts:
I am attempting to understand how to manipulate portions of a cascaded series of biquad notch filters in a control system I am working with.

As part of determining the composite response of all the cascaded filters, I am starting with looking at the individual biquad filters. I have taken the existing control system coefficients that I have for the filters and have saved the various biquad filters in the Filter design tool. When I use the MATLAB/Simulink filter design tool, I obtain an unexpected response as well as an unstable root/pole plot. I have excerpted an image below of one of the filters from the control system.

The system sampling frequency is 10 khz. The Form is Direct Form II. The a0 coefficient is normalized to 1.

My specific questions are:

Is this response still consistent with a notch filter?
If this is still applicable as a notch filter, why would the filter start with a negative magnitude and then return to a positive magnitude? For context, I am used to the analog realm and a notch filter starting at 0 db and ending at 0db.
If I needed to attenuate a specific frequency as viewed from power spectra of the feedback in the control system, would it be appropriate to modify a particular notch filter of my cascaded series to focus in on that frequency or since they are cascaded, would I have to modify all terms slightly?

Thanks for any insight.


texts:
I am trying to smooth a series of data in order to obtain a continuous function that could represent that given data set.
It came out that the Savitzky-Golay method could be a good way.

Now, I don't know much about smoothing and/or interpolate, but I managed to obtain a good result, at a first glance:

The blue points are my data, and the red line is the result from a SG filter applied with a window = 15 and a polynomial order = 13.
Now, I could try some other combinations of window&order, but more generally I would like to know the principles of the best meeting of these two parameters, especially in my case, where the data have no smooth trend (like a sinusoidal).


texts: Books that explain DSP well to those not directly in engineering?

texts:
I do work with computer graphics and am dipping my toes into ray tracing.  That field involves a good number of the subjects covered in DSP (Fourier transform, time vs frequency space, etc) but I was hoping to find a book in the realm that didn't also deal with, say, digital devices or electrical engineering-- not that I have anything against those subjects, but they're not germane to what I'm doing and I'd prefer not to wade through them on my way to DSP understanding.

Could anyone recommend some books for someone in my position?  I've taken calculus and differential equations & linear algebra in the past and so am reasonably proficient as far as the mathematics involved.  Thanks much.


texts: Explanation relevant to the filter response ($\mathrm{sinc}$ interpolation) - Equation $(2)$ in my question

texts:
At present, I am learning the theory of operation of resampling for bandlimited periodic discrete signals using $\mathrm{sinc}$ interpolation. I am developing a design flow and having difficulty in understanding a particular expression/equation, hence I am stuck! Here I go:

Suppose we have a samples $x(nT_s)$ of a continuous time signal $x(t)$, where $t$ is time in seconds and $n$ is sample points that ranges over integers and ofcourse $T_s$ is the sampling period. $x(t)$ is bandlimited to $\pm F_s/2$, where $F_s = 1/T_s$.

Now, we know that the original signal $x(t)$ can be reconstructed or synthesized by the samples of $x(nT_s)$ using the equation:

$$
x'(t) = x(nT_s)+H_s(t-nT_s) = x(t), \quad \text{for}\quad n =\ldots,-3,-2,-1,0,1,2,3,\ldots\tag1
$$

and

$$
H_s(t) = \mathrm{sinc}(\pi F_s t)
$$

To resample $x(t)$ for the new rate i.e. $F'_s = 1/T'_s$, we have to evaluate equation $(1)$ at integer multiples of $T'_s$ i.e. $nT'_s$.

We know that, when the new sampling rate $F'_s$ is less than the original    sampling rate or frequency $F_s$, the lowpass cutoff must be placed below half the new lower sampling rate.

Doubt - Based on the highlighted statement made above, the ideal low pass is given by:

$$
H_s(t) = \min\left\{1,F'_s/F_s\right\}\mathrm{sinc}\left(\pi\min\left\{F'_s,F_s\right\}t\right) \tag2
$$

where the scale factor maintains unity gain in the passband.

What does the equation $(2)$ represent? I understand that, if $F'_s$ is lower than $F_s$, then the filters cut off frequency should be half the $F'_s$, however, I am having trouble understanding this equation $(2)$ and how to benefit from it in the design process. Any explanation regarding this would be appreciated.

Source/Reference:

$\scriptstyle{\textrm{Julius O.Smith & Phil Gosett "A Flexible Sampling Rate Conversion Method" IEEE, 1984}}$.


texts: How do you apply a filter after DFT on an image?

texts:
Let's say size of the image is 100 x 100 and the kernel matrix is 5x5. I took the DFT of both the image and the kernel. But how do I multiple these two matrices? And which parts involve in these multiplication? real, imaginary or magnitude? Thanks

Is this what am I supposed to do? And at what locations I put 0s to make the kernel 100x100?

    for i to 102
            for j to 102
            {
                newReal = realImage * realKernel - imaginaryImage * imaginaryKernel
                newImaginary = realImage * imaginaryKernel + imaginaryImage * realKernel
            }

        and do InverseFourierTransform(newReal, newImaginary)


texts: Conditions for unique (not exact) recovery from noisy compressed measurements

texts:
I am looking for theory on whether compressed sensing reconstruction via ℓ1-minimization is unique and under which conditions.
I have looked through:

  Tropp, J. A., "Just relax: convex programming methods for identifying sparse signals in noise," IEEE Transactions on Information Theory, 2006, 52, 1030-1051.

This paper states that the minimizer is unique but I can't quite boil down exactly what is required for this uniqueness (Eq. (ℓ1-Error) and Theorem 14) to hold.

I also looked at:

  Candès, E. J.; Romberg, J. & Tao, T., "Stable signal recovery from incomplete and inaccurate measurements," Communications on Pure and Applied Mathematics, 2006, 59, 1207-1223.

However, they do not seem to claim that the minimizer is unique.
Since both of these papers are from the earlier days of compressed sensing, I suspect that there may be newer results on this uniqueness of the solution. Do any of you have some hints?


texts: Hi, If I really want to focus on the mathematics of signal procesing, Should I do a Masters in EE or Math?

texts: I'm an undergraduate electrical engineering student who has an interest in mathematics of signal processing. I want to be able to go to a graduate school where I can focus on more the mathematics and theory behind signal processing. Can this be achieved in a Masters in EE or is it more efficient to go to my Masters in APPLIED MATH?


texts: Equivalence of FFT and PSD based output based on the Frequency Response Function

texts:
Correct me please if I am wrong...

I have just started working in the domain of signal processing using the Fourier Transform ($\mathbf{FFT}$) and Power Spectral Density ($\mathbf{PSD}$). I am trying to adjust the Frequency Response Function ($\mathbf{FRF}$) so that response $Y$ computed using relation:

$$\mathbf{FFT}(Y)=\mathbf{FRF} \cdot \mathbf{FFT}(X)$$

match with actual response. $X$ is the input.

I was successful in determining $\mathbf{FRF}$ of system concerned. Then I realized that the input signal used ($X$) is a random one. Literature suggested that instead of above approach $\mathbf{FRF}$ should be obtained by using power spectral density approach, i.e.:

$$\mathbf{PSD}(Y)=|\mathbf{FRF}|^2 \cdot \mathbf{PSD}(X)$$

I adjusted the Frequency Response Function to match actual $\mathbf{PSD}(Y)$ with $\mathbf{PSD}(Y)$ computed by $|\mathbf{FRF}|^2 \cdot \mathbf{PSD}(X)$. FRF obtained by this approach is much different from FRF obtained by FFT approach.

PSD was determined by FFT of autocorrelation of a signal, as it was simple for me to code. Signal is collected once, one realization.

Thus my questions are:

Do $$\mathbf{FFT}(Y)=\mathbf{FRF} \cdot \mathbf{FFT}(X)$$and
$$\mathbf{PSD}(Y)=|\mathbf{FRF}|^2 \cdot \mathbf{PSD}(X)$$ give same FRF for same input $X$ and response $Y$?
If yes then what could have gone wrong in my case?
If no then what are reasons for difference?
Is there any connection between these to relations (FFT and PSD).

Dinesh Zanwar,

Nagpur, India


texts:
If I convolve a periodic signal $x(t)$ with period = 1sec with an aperiodic signal $h(t)$ whose Fourier transform $H(f)$ is exactly equal to 1 at frequencies $f = 0,\pm 1,\pm 2, \ldots \textrm{Hz}$, but has some arbitrary and finite values at non-integers, will the resulting waveform $y(t) = x(t) \star h(t)$ be the same as $x(t)$?

I think it should, but I want to validate my reasoning.

My reasoning is that since $x(t)$ is periodic with period=1sec, its spectrum is discrete and is non-zero at integer values.

So if $H(f)$ equals 1 at integers, it should not distort $x(t)$ regardless of what its values are in between integers.

Note that I am referring to frequency in terms of Hertz and not $\omega$ (angular frequency).

Is this reasoning valid?


texts: Derive Time-Domain Biquad Coefficients from Z-Domain

texts:
I'm trying to derive the time-domain coefficients of a biquad filter based on its z-domain coefficients. The purpose is to import externally-generated EQ filters (in z-domain) into Max/MSP (in time-domain).
Could someone kindly explain how to do so?
Z-domain:
$$H(z) = \frac{b_0+b_1 z^{-1}+b_2 z^{-2}}{a_0+a_1 z^{-1}+a_2 z^{-2}}$$
Time-domain:
$$y[n] = a_0 x[n] + a_1 x[n-1] + a_2 x[n-2] - b_1 y[n-1] - b_2 y[n-2] $$


texts: How to enhance thermogram image in grayscale?

texts: I'm trying to do some image processing to improve the image below but I'm having some trouble. I already tried to do histogram equalization followed by laplace sharpening, I tried to implement a buttersworth high pass filter but the image became all black. Do you have any suggestions on what techniques to use ti improve this image?


texts:
I have some smartphone recorded accelerometer data, so I have acceleration along 3 axes: $$a_{x}, a_{y}, a_{z}$$

The accelerometer data was collected by securing a phone to a walking subject. I'm primarily interested in being able to identify the time between each step they took. Normally, I could just search for peaks in the vertical acceleration vector, but in this case I don't know the orientation of the phone during the walk so I cant be sure which axis the vertical movement is coming in on

Individually, the 3 signals dont tell me anything useful because of the orientation problem, so I'm trying to condense them into a single vector. Presumably walking steps will cause the largest change in acceleration, so I can just time the peaks in this combined signal. Ultimately I'm looking to create a vector that will tell me the amount of total acceleration at each time point of the walk.

I've seen some people apply the following:

$$A = \sqrt{a_{x}^2 + a_{y}^2 + a_{z}^2}$$

A few questions about this:

What is the correct name for the resulting vector? I've heard it referred to as magnitude of acceleration, but when I google that term I see that its calculated as the following and unsure if they're referring to the same thing: $$\Delta v/\Delta t$$
If I wanted to calculate that value in Python, would it be as simple as taking each acceleration vector, element-wise square each one, element-wise sum the 3 vectors together, then take the root of each individual element? I know this is just the Pythagorean theorem, but unsure how to apply it in the case of vectors. Should the result be a vector?
How would you interpret the resulting value? Would it be the total amount of acceleration at each time point?
Given my goal of identifying time between steps, is this an appropriate approach? Or is there a more preferred way of combining the 3 acceleration signals?


texts: Doubling the frequency of a sound fragment in real time?

texts:
I'm given given a stream of sound, as a serie of little buffers .

Is it possible to make this stream sound one octave up ? Or an arbitrary number of semitones up ? My goal is to add it to the original sound and to pass this through a reverb to create a "shimmer" effect .

My research so far was in the direction of doubling the frequency by creating a new buffer, and copying every other sample of the old one. This works, but I have a lot of noise and artefacts. I guess this is because the buffer length is not an exact multiple of the frequency but I can't change the buffer length and I have no prior knowledge of the frequency of the sound.

I don't think this is the place to post C/C++ code so I won't do it but I guess you get my idea.

I'm not looking for a high quality sound at all, i.e, a perfect, one octave up, reproduction of the sound,but at least something decent.

Any ideas please ?


texts:
I am using an FFT function in PHP language (https://gist.github.com/mbijon/1332348) which works very well, but cant produce PSD from its output:
$fft = Fourier($data,1);
// $fft[0] is real portion of 1
// $fft[1] is imaginary portion of 1
// $fft[2] is real portion of 2
// $fft[3] is imaginary portion of 2
// ...
// $fft[n-1] is real portion of n
// $fft[n] is imaginary portion of n

PSD formula In Matlab:
PSD = Y.*conj(Y)/N

I cant understand this formula in math notation form...
How can I adapt this formula to work with that output?


texts: Amplitude calculation of the original signal from its FFT

texts:
I have a signal whose FFT has a one prominent harmonic ($f_1$) and few other harmonics with a lower amplitude. In order to calculate the amplitude of the original signal I can use a well known theorem: a value of $f_1$ divided by half number of data points in the original signal.

But what if I have harmonics $f_2, f_3, \ldots$? Should I take their amplitudes into account for such calculation?


texts:
I am trying to implement an NLMS algorithm for a multi-input single-output(MISO) structure.

We take a reference signal x, then we made a new set of P input signals from it as follows: x_op (k) = x(k)^p. k denotes the k-th sample of our reference signal x.

For the case where P = 1, our adaptive filter is just a vector of length N. But for P > 1, we have a matrix H (N x P) containing all the adaptive filters. (where N is the length of each filter).

Now I am confused as what would be dimenstion of the estimated output at each iteration (for each sample). For the case where P = 1, we can simply write:

y_hat = h_hat' * xk; where xk has the last N samples of x.

and y_hat is then a scalar. What about this case when H is a matric and not a vector anymore?

The way I understand it, y_hat for this case is no longer a scalar. But if it's not a scalar, then how I am supposed to define the error for each sample k, in order to write the adaption law equation?


texts: How to name every row of 100*2500 matrix in MATLAB?

texts: currently i am working with a matrix. The dimension of the matrix is 100*2500. I need to assign each row the matrix to a new variable. How i can do this?


texts: Estimating a Power Spectrum from a Time Series

texts:
What are the best ways to estimate the power spectrum of a given time series?  Any pointers to review articles or book chapters would be appreciated.

A little more information: When estimating a power spectrum from a time series, I typically use Welch's method (matlab command pwelch) with the default parameters.  My understanding is that this is standard practice in the community, but that it became so in the days when computing power was limited.  With modern computing abilities, are there better (more accurate) ways to estimate a power spectrum? What are the differences between the methods?


texts: Get displacement from acceleration with DFT

texts:
I looked at the already existing topics:
here, here or matlab code, finally here
I tried to create my python code but it is not working :
from scipy.fft import fft, rfft, fftshift, ifftshift, ifft, irfft

acc = np.random.random(100).reshape(-1, 1)
n1 = len(acc)
n = int(2**(np.ceil(np.log2(n1))))
a_t = np.empty((n, 1))
a_t[:n1] = acc - acc.mean()

if n > n1:
    a_t[n1:] = 0

dt = 1 # for the example)
df = 1 / (n*dt)
nyq = 1 / (2*dt)
f = np.arange(-nyq, nyq, df)

a = fftshift(fft(a_t))

d_f = np.zeros(a.shape, dtype = "complex_")
v_f = np.zeros(a.shape, dtype = "complex_")

j = complex(0, 1)

for i in range(n):
    if f[i] != 0:
        d_f[i] = a[i] / (2*np.pi*f[i]*j)**2
        v_f[i] = a[i] / (2*np.pi*f[i]*j)
    else:
        v_f[i] = 0
        d_f[i] = 0
d = ifft(ifftshift(d_f))
v = ifft(ifftshift(v_f))

fig, axes = plt.subplots(3)
for ax, values in zip(axes, [acc, v, d]):
    ax.plot(values)

I don't understand where in my code I make a mistake.
If I juste divide the acceleration by (i*w)^2, the image of the displacement is similar to the acceleration, that is not normal. And here, with this code, I've a pike and a flat velocity and displacement.
I'm looking for help to resolve this. My objective: just get displacement from acceleration data.


texts: Ways to analyze electrical signals without FFT?

texts:
I am collecting a 15Hz sine wave at 1500Hz. Therefore, every 100 points of data collected should contain a single complete sine wave.  If I sample for 10 seconds, I will have 15000 points of data. If I perform an FFT on this data I will have very high frequency resolution.  However, If I wanted to divide these 15000 points into 100 point sections and average them together to get a mean signal of 100 points, and performed an FFT on that, my frequency resolution would be very low.  So, by averaging my data I am losing frequency resolution.

The reason I would like to get an average is because high amplitude noise is periodically injected into the sine wave.  I would like to throw away the sections containing noise and only have the frequency information of the average of clean data.

I'm fairly new to DSP so I'm not quite sure how to approach this problem.  Any thoughts would be greatly appreciated.


texts: Can Normalized Cut be used to find connected components in binary images?

texts: I'm unsure whether Normalized Cut can or can't be used to find connected components in binary images. I would argue that it could, but could not validate this argument.


texts: Understanding Phase noise of a Hard Limited Sine Wave

texts:
I need help in understanding the frequency spectrum of a sine wave with phase noise that has been hard limited.
Background:
Typically, textbooks define phase noise for a  sinewave, however in many applications, like in the case of a mixer, this sine wave is hard-limited. I am using a simple signum function to convert the sine wave to a square wave, and then am trying to make sense of the spectrum of the hard-limited sine wave having a sinusoidal phase noise.
Experiment description:
I have taken a sine wave of frequency 100MHz, sampled at the rate 100GHz. To this sine wave, I have added a sinusoidal phase noise of magnitude "alpha" and frequency 10MHz. When I take the FFT of the resultant signal, I get the expected frequency spectrum.
%Code is written in MATLAB
clear all
close all;
f0 = 100e6;
df = 10e6;
tTotal= 1e-6;
Fs = 100e9;
Ts = 1/Fs;
t = 0:Ts:tTotal-Ts;
alpha = 1e-6;
a = sin(2*pi*f0*t + alpha*sin(2*pi*df*t)) ;
afft = fft(a)/length(a);
afftdb = 20*log10(abs(afft)+1e-8);
figure(1)
plot(afftdb);

The strength of the spur at the bin 111 is 20log(alpha/2) relative to the carrier as expected. Next, I have converted this sine wave into squarewave, then hann-windowed, then low pass filtered and finally I've taken the FFT.
asquare = sign(a);
y  = lowpass(asquare,200e6,Fs,'ImpulseResponse','iir','Steepness',0.95);
win = 0.5*(1-cos(2*pi*t/tTotal));
y =y.*win;
%asq_fft = fft(asquare)/length(a);
asq_fft = fft(y)/length(a);
asq_fftdB = 20*log10(abs(asq_fft)+1e-8);
figure(2)
plot(asq_fftdB)

I get spur of strength -64dB which is unexpected for me. I didn't expect to get this high spur. I expected the spur to still be 20log(alpha/2) relative to the carrier. I also don't understand why I get so many harmonics too.

I also tried changing the value of alpha from 1e-6 to 1e-11. The FFT plot for alpha of 1e-11 is given below:

Still the strength of the spur didn't change. This is surprising to me.
Could anyone please explain why does the spur's strength of -64dB makes sense?
I believe this is not due to folding back of harmonics of square wave, because when I make alpha = 0, I don't see any spurs as shown below.

If I change the offset frequency of the phase noise (df = 7MHz), the spur location change as shown below.


texts: How does mic combined with loudspeaker work?

texts:
There is variety of loudspeakers on the market that have built-in microphone so that they can produce sound and perceive it at the same time (and do it surprisingly well).

How they managed to overcome audio feedback problems?