texts: How to think about beamforming when there's no "space" between receivers?

texts:
I'm trying to wrap my head around how does "beamforming" work when there's no physical "space" between receivers.

My background knowledge:
I've always thought about beamforming as a sort of spacial FIR filter. We have a number of antennas (or in this case microphones) that are at some distance one from another. Due to that distance, the signal will arrive with different phase at each of the receivers. Afterwards, we multiply the received signals with weighting factors that basically decide in which direction we'll look at.

What I did:
I have a laptop with an integrated stereo microphone and stereo microphone input. Driver for the soundcard, among other options, gives option to enable beamforming.

I connected a LW/MW/SW/FM radio with stereo signal output to the microphone input of the computer. Signal provided by the radio is a mono signal from an AM station duplicated to two channels for stereo output on the radio.  In time-domain, signals on both channels are completely same and in phase.

What happened:
I was quite surprised that after enabling beamforming under soundcard options, I got a significant noise reduction.

My thoughts about this:
My understanding so far was that since I have two channels that are 100% same, that should be equivalent to having two microphones in same physical location. Because the distance is zero, beamforming should not be possible.
From what I could dig up, the laptop itself uses this product as the audio DSP. There's not much information available on the manufacturer's web site and the whitepaper they show doesn't tell much above the usual beamforming stuff with space between microphones.

Question:

So my question is what could be happening here? How do I understand this application of beamforming where both receive channels are getting the same signal and yet the beamforming does work.

Update
So commenters think it's not beamforming at work. Could it be that they are using noise-shaping and then low-pass filtering as well as as step in-between?

Here I have a spectrum with "beamforming" on:

and with it off:


texts: Sourse separation from known underdetermined mixing matrix

texts:
How to recover uncorrelated N sources from given N-1 signals and known mixing matrix M, (e.g. 9x8 matrix)?

If I just use pseudo-inverse matrix M+, my source estimates are correlated with each other in the way that each i'th estimate S* equals:

Correlation arises from that sum of all sources S, present in every estimate S*. How can I get uncorrelated source estimates?

From this formulae, using preudo-inverse mixing matrix is correct, only when sum of all sources S equals to zero ("zero signal").

So, I suppose that I should find some other missing mixing weights for "zero signal", such that decorrelate my source estimates. How to do it?


texts: How to add bandpass filter to recorded sound in matlab

texts:
I have a sound that is being recorded but I am trying to apply bandpass filtering to the sound so that it filters out anything above and below a selected frequency range. I have tried the tool in matlab to create the filter but for some reason can not get it to work. The code below is the record portion that I have the sound being recorded but need help applying the filter. Any help would be greatly appreciated.

function soundRecord (signal)
fs = 44100; %Sample Frequency
f = 15:22; %Frequency range
recObj = audiorecorder(44100, 16, 2);
get(recObj)

%save sound to wave file
%filename = 'location.flac';
audiowrite('input.wav',signal, fs);

if ~exist('inFile')
inFile = 'input.wav';
end

if ~exist('outFile')
outFile = 'output.wav';
end

if ~exist('frameWidth')
frameWidth = 4096;          % size of FFT frame, better be a power of 2
end
frameHop = frameWidth/2;

 analWindow = hanning(frameWidth);

 [inBuffer, Fs] = wavread(inFile);

 for arrayCol = 1:2
 % if(arrayCol == 1)
 %     x = [inBuffer(:,arrayCol); linspace(0, 0, frameWidth)'];                   %     `    left channel passed through, zeropad one frame at the end`
 % end
 %if(arrayCol==2)
    x = inBuffer(:,arrayCol);
    %x = inBuffer;                   % left channel passed through, zeropad one frame `    at the end`
%end
%clear inBuffer;

numSamples = length(x);

numFrames = floor(numSamples/frameHop)-1;

% disp(frameWidth);
% disp(numSamples);
% disp(frameHop);
% disp(numFrames);
% disp(size(analWindow));
% disp(size(transpose(analWindow)));

y = linspace(0, 0, numSamples)';

n = 0;                              % init sample pointer.  unlike MATLAB, i like `   counting from 0`

for frameIndex = 1:numFrames

     xWindowed = x(n+1:n+frameWidth) .* analWindow;     % get and window the input        `    audio frame`

     X = fft(fftshift(xWindowed));              % do the FFT

     Y = X;                         % copy the input spectrum to output

                                % do whatever processing to Y that you like

     yWindowed = fftshift(real(ifft(Y)));           % convert back to time domain,           `    toss the imaginary part`

     %disp(size(x(1:frameWidth)));
     %disp(size(yWindowed));

     y(n+1:n+frameWidth) = y(n+1:n+frameWidth) + yWindowed;

     n = n + frameHop;
%spectrogram(X,256,250,f,1E3,'yaxis');
%surf(f,10*log10(abs(p)),'EdgeColor','none');
%axis xy; axis tight; colormap(jet); view(0,90);
%xlabel('Time');grid on;
%ylabel('Frequency (Hz)');grid on;

pwelch(X);grid on;
end

soundArray(:,arrayCol) = y;

end

%wavwrite(y, Fs, 'output.wav');
wavwrite(soundArray, Fs, 'output.wav');


texts: Need help finding the frequency response

texts:
So I have this system:
$$
y(n) = \frac{1}{N+1}\sum_{k=-N}^{N}\left(1-\frac{|k|}{N+1}\right)x(n-k)
$$

Now for the impulse response I'm getting:

\begin{cases}\frac{1}{N+1}\left(1-\frac{|k|}{N+1}\right) &\text{for}\quad|n|\leq N\\ 0& \text{otherwise}
\end{cases}

But now I'm supposed to find the frequency response and supposedly a closed form expression can be found for it.

So the frequency response is just the Fourier transform of the impulse response so I have this function:

$$
F(s)=\frac{1}{p(N+1)}\sum_{k=-N}^{N}\left(1-\frac{|k|}{N+1}\right)e^{\frac{-2\pi isn}{p}}$$

From here I used Euler's formula and the $isin$ parts cancel themselves and then I was able to use Legendre's summation formulas to find a super messy closed form but I think that can't be right.  I think instead I have set up the frequency response wrong.  Could some one help me?  Thanks.


texts: Implementation of IIR Filter in dsPIC 33EP - Q15

texts:
I am implementing an IIR controller in dsPIC 33EP (16-bit, fixed-point, two's complement, wrap-around, 40-bit accumulator, 32-bit multiply, 12-bit ADC) and I am using cascaded, Direct Form I second order sections (ordering up).

I am using Q15 (fractionals), but my coefficients are within the range +/-1. The question is: If a coefficient is exactly +1, will it fit in Q15?

The confusion is due to the fact that Q15 allows values from -1 to 0.99999999906 only. So I am afraid it will be quantized to 0 or -1 in 2's complement wrap-around.

I would very much appreciate any help.

Ben


texts: Is a notch filter for 50 Hz without delay possible?

texts:
I am processing an EEG signal (2 kHz sampling frequency) from hardware and the built-in filter doesn't work as intended. FIR gives a delay, and IIR is unstable.

The signal of interest is from 4 Hz to 360 Hz, with the goal to clear the utility signal (AC 50 Hz) from the signal. The main constraint is to get as many untouched (no noise, perturbance, and leaks) samples as possible. The tradeoff here is that gamma brain waves starts from about 40 Hz and goes up through 50 Hz and further.

Are there any options available to get no delay or at least a very small one (a 357 tap FIR gives more than 130 dB attenuation, but the delay with 2 kHz is about 180 ms. I aim at less than a 30 ms delay with at least 60 dB)?

The start of the pass band is 49 Hz and the end is at 51 Hz (in fact, it looks like this: https://www.swissgrid.ch/en/home/operation/regulation/grid-stability.html), so it varies in time and is non-stationary.


texts: How to eliminate noise that has the same frequency of my signal

texts:
I have an audio signal , and I want to remove noise from it. I have applied a bandpass filter in order to remove frequencies that are not part of mi signal. But if there is background noise (some people talking) , it is not removed , because it has the same frequency range that my signal.
How can I filter my signal , to eliminate the noise that has the same frequency as my signal?


texts: Digital low-pass filters; best practice application

texts:
I have time domain strain gauge data from a structure which is subjected to low frequency, random loading. The signal / noise ratio is pretty good, but I would like to try to improve on it as much as possible.

From the FFT, I know that the dominant loading and response is below a frequency of around 1 Hz, but my signal has a constant level of noise up to the 10 Hz Nyquist frequency, above which any frequencies should have been removed by the low pass filter that was used with the measurement system - but I have very little knowledge of how this works. Although I can determine the dominant frequency response from my data in it's current form, I'm interested in processing the time domain data for fatigue calculations, and so any additional noise will introduce error.

I basically have two questions that I'd like to ask anyone with a good understanding of modern measurement and signal processing systems;

1) How is the low pass filter implemented in best practice for a measurement system like this? Is this done with the standard RC circuit prior to analogue to digital converter, or is this done after digital conversion with a processor and a suitable algorithm?

2) What would be the most suitable method to remove the noise present in my data above 1 Hz? I've had a bit of success with simple smoothing algorithms in the past (such as localised regression fitting; LOESS), but wondered whether there are more appropriate methods that I am not aware of, as smoothing seems a bit crude!

Any responses or pointers in the right direction would be really appreciated,

Many thanks,

Trev


texts: Determine poles and zeros of a specific filter design

texts:
I have a design question and need to determine poles-zeros of a IIR bandpass filter.
Requirements are:

1-order should be 3

2-causal

3-real valued impulse response

4-stable

5-cutoff freq: pi/3-pi/2

I have tried butterworth design on matlab to determine poles and zeros but I do want to learn how are they placed analytically or by inspection. Also a problem of matlab is it designed a filter with order=4. Is it possible to solve this with n=3.

Thanks


texts: Transform lowpass filter to highpass filter, what happened to unit sample response and difference equation?

texts:
I know that multiple a lowpass filter signal by $(-1)^n$ can transform it to a highpass filter.
$$
s_{hp}[n]=(-1)^n s_{lp}[n]
$$
But exactly what happened to the unit sample response and difference equation? Assume that the original lowpass filter signal has a difference equation. Can someone explain to me?? Thanks!!!


texts:
I'm currently working with audio signals and have a problem:

C = A*B + N, where

C = recorded signal from microphone consisting of:

A = known music file data played on speakers next to microphone

B = some convolution on the recorded A-sound due to speaker->mic roundtrip
(I mean the recorded signal won't be 100% the same as the audio data from the file before it is played to the speaker and recorded by mic. (Is this an impulse response?))

N = some additional noise sounds recorded by microphone

My goal: an approximate estimation as to whether there is a signal N and how loud it is.

I don't have a need for accurate data!

Additional info:
I'm working with Apple's vDSP API. I have cross correlated the signals A and C, so I have the time window in which the signals overlap.

In the overlapping window, I have both signals in the time and frequency domain.

Currently I'm helpless if, for example, a Wiener filter is the right approach and if I'm capable to apply one with my known parameters(Is a known noise required? or the impulse response of the environment?).  I tried to apply a Wiener deconvolution by dividing C/A in the frequency domain with no success.

Once more: I don't need accurate data, just a rough guess how much N is there in the signal C. Actually a SNR like measure would be sufficient.


texts: Tricks for computing rapidly changing biquad coefficients

texts:
I have 5 'negative peaking' biquads that will change center frequency while maintaining a constant Q and A (amplitude reduction) on a realtime microcontroller (ARM cortex-m4) with a codec over i2s controlled by i2c system operating at 96kHz. I am concerned (with concerns raised by my oscilloscope) that I am going to be hosed by divisions and sine/cosine. What can I do to speed things up?

Using RBJ's EQ cookbook, a peak filter takes the following coefficients:

w0 = 2*pi*f0/Fs;
A  = sqrt(10^(dBgain/40));
alpha = (sin(w0)/(2*Q));

b0 =   1 + alpha*A;
b1 =  -2*cos(w0);
b2 =   1 - alpha*A;
a0 =   1 + alpha/A;
a1 =  -2*cos(w0);
a2 =   1 - alpha/A;

Furthermore, the feedback coefficients will take the form
    c0 = b0/a0
    c1 = b1/a0
    c2 = b2/a0
and the feedforward coefficients:
    c3 = a1 / a0;
    c4 = a2 / a0;

Expanding these divisions:

c0 = (1 + (sin(w0)/(2*Q))*A)/(1 + (sin(w0)/(2*Q))/A);
c1 = -2*cos(w0) /  (1 + sin(w0)/(2*Q)/A);
c2 =  (1 - (sin(w0)/(2*Q))*A)/(1 + (sin(w0)/(2*Q))/A);
c3 = c1;
c4 = (1 - (sin(w0)/(2*Q))/A) / (1 + (sin(w0)/(2*Q))/A);

Using simplify() in MATLAB with symbolic variables w0, Q, and A, we obtain:

c0 = (2AQ + A^2*sin(w0))/(2AQ+sin(w0))
c1 = -(4AQ*cos(w0))/(sin(w0) + 2AQ)
c2 = -(A^2*sin(w0) - 2AQ)/(2AQ + sin(w0));
c3 = c1;
c4 =  -(sin(w0)- 2AQ)/(2AQ + sin(w0));

If Q and A are constant, no problem, these can be computed ahead of time. What will kill me are the divisions and the sine/cosine computations.

What tricks or processes can be used to speed up the calculation or if at all, further simplify or approximate the filter coefficients?


texts: Is there an adjective describing a filter with kernel that has zero mean?

texts: A linear filter with a kernel that has zero mean could be thought of as a "DC-rejecting" filter. Is there a better or more commonly used adjective for such a filter?


texts: Bandpass filter is not working as expected

texts:
The sampling rate that I have currently is at 384kHz and I want to downsample it down to 44.1kHz. I want to use a bandpass from 5kHz to 200kHz but I am only able to bandpass up to 192kHz for some reason.
The following is my code:
# Importing data
datapath = "./Data/"
x, fs = sf.read(datapath + 'example_audio.WAV')

# Filtering function

def butter_bandpass(lowcut, highcut, fs, order=5):
    nyq = 0.5 * fs
    low = lowcut / nyq
    high = highcut / nyq
    b, a = butter(order, [low, high], btype='band')
    return b, a

def butter_bandpass_filter(data, lowcut, highcut, fs, order=5):
    b, a = butter_bandpass(lowcut, highcut, fs, order=order)
    y = lfilter(b, a, data)
    return y

# Main code

downsampling_rate = 44100
original_rate = 384000
rate_ratio = downsampling_rate/original_rate

listing = os.listdir(datapath)

for file in listing:
    print("Before: ")
    print(file)
    plot_spectrogram(file)

    x, fs = sf.read(datapath + file)

    # TO DO: figure out 191kHz limit situation and conceptual reason why
    x = butter_bandpass_filter(x, 5000, 191000, fs, order=5)

    x = scipy_signal.resample(x, int(len(x)*rate_ratio))

    print("After: ")
    print(file)
    plot_spectrogram(file)

But, the spectrogram and the PSD graph looks exactly the same (before and after) which makes me think that the band pass filter is not working properly.
Any insight would be greatly appreciated!


texts:
I am looking to create an algorithm which adds a bevel effect to a bitmap using it's alpha as a bump map.

How would I go doing something like this? I have tried specular lighting but I only get the highlight and not the shade.

Here is the effect I am talking about(made using Photoshop):

All of these were done using size: 30px(The depth of the bevel from the contour of the bitmap), angle 130, altitude 50.

From left to right, top to bottom:

Chisel Hard bevel
Chisel Soft Bevel
Smooth Bevel
Chisel Hard with soften: 16px - a blurred bevel?

I am trying to create each of these effects, how would I go about creating the basic bevel? and what do I need to get to each of these from that bevel


texts: Cross-Correlation to find the similartity of songs

texts:
I have been working on a problem where I am given two songs which are of the same category but there is a time difference between them. Eg. one song starts at x sec and other song starts at y sec. So my task is to find the x and y.
The length of the two songs can vary but the content of the two songs will remain the same.

Currently I am using cross-correlation using FFT for finding the offset between them but it is not giving me correct results.

For making the length of signals same I am zero padding the signal which is shorter in length.

Can someone guide me what I am doing wrong in this problem ?

I really appreciate your responses.
Thanks

--

Thanks guys for replying..
I am doing in Python and using below algorithm for finding the offset:
1. Using librosa.load function to get the audio signals of both the songs.
2. Then I zero pad the shorter signal from last and make sure it is power of 2.
3. Find the FFT of the two signals using scipy library function of python.(spipy.fftpack.fft)
4. Once I get the fft , I take the cojugate of one of the signals.
5. Elementwise multiplication of the two fft signals
6. Doing ifft of the numpy array of the output signals after multiplication.
7. Finding the peak index of that array.

P.S. The song length can be around 5-6 mins so I am sampling at the rate of 44.1Khz . So you can expect very large sample space.
Also , the bitrate of the two songs can be different.(I am not sure that will effect it or not)

Any idea if I am doing wrong?

thanks


texts: Auto-correlation of C/A code with 30dB noise

texts:
I've a C# program that generates a GPS C/A code consisting of -1s and +1s.
Auto correlating the code with rotated versions of itself shows that the peak is 1023 and the next maximum value is 63 which agrees with what I expect.

Now my understanding is that in the GPS C/A signal the SNR is -30dB and the receiver is still able to detect a strong auto-correlation peak.

So I'm adding a random numbers between 0 and 30 (roughly 30dB) to one of the signals before the auto-correlation and now there's no strong peaks.

Where is the mistake in my reasoning?

using System;
using System.Collections.Generic;
using System.Linq;

namespace CrosssCorrelationTest
{
    class Program
    {
        static void Main(string[] args)
        {
            List<int> caCode = GenerateCaCode();
            var shiftedCaCode = new Queue<int>(caCode);
            AddNoise(caCode);

            double correlation = 0;
            double max1 = 0, max2 = 0;

            for(int i=1; i<1023; i++)
            {
                correlation = CrossCorrelate(caCode, shiftedCaCode.ToList());
                if(correlation > max1)
                {
                    max2 = max1;
                    max1 = correlation;
                }
                else if(correlation > max2)
                {
                    max2 = correlation;
                }
                RotateBy1(shiftedCaCode);
            }

            Console.WriteLine($"max1={max1}; max2={max2}");

            Console.ReadKey(true);
        }

        private static void AddNoise(List<int> caCode)
        {
            var r = new Random();
            for(int i=0; i<caCode.Count; i++)
            {
                caCode[i] += r.Next(30);
            }
        }

        private static double CrossCorrelate(List<int> caCode, List<int> caCode1)
        {
            int sum = 0;
            for(int i =0; i<caCode.Count; i++)
            {
                sum += caCode[i] * caCode1[i];
            }

            return sum;
        }

        private static void RotateBy1(Queue<int> shiftedCaCode)
        {
            int chip = shiftedCaCode.Dequeue();
            shiftedCaCode.Enqueue(chip);
        }

        private static List<int> GenerateCaCode()
        {
            int g1 = 1023; //10b'1111111111;
            int g2 = 1023; //10b'1111111111;

            var caCode = new List<int>();

            for (int i=1; i<=1023; i++)
            {
                int chip = (g1 ^ ((g2 >> 4) ^ (g2 >> 8))) & 1;

                caCode.Add(chip == 1 ? 1 : -1);

                g1 = (g1 >> 1) | (((g1 << 2) ^ (g1 << 9)) & 512);
                g2 = (g2 >> 1) | (((g2 << 9) ^ (g2 << 8) ^ (g2 << 7) ^ (g2 << 5) ^ (g2 << 2) ^ (g2 << 1)) & 512);
            }

            return caCode;
        }
    }
}


texts: How can I generate audio wave files of harmonic series/partials for a specific frequency in Matlab

texts:
this is the only code I know, but it is for one specific frequency and not for its harmonic series, I am trying to get all the partials as individual files, eg. If I want to generate 40hz sine wavwrite file and its harmonic series which would be 40-80-120-140hz etc, about 551 individual audio sine wav files all at harmonic series frequency values in one go generated with an Matlab Code...

fs = 44100; % sampling frequency
nbits= 16;
file = 'output.wav'
d = 40; % duration
f = 60; % wave frequency
phi = pi/2; % phase shift - will produce cosinusoid for pi/2
t = linspace(1/fs, d, d*fs); % time vector
y = sin(2*pi*f*t + phi);
plot(t,y);
wavwrite( y, fs, nbits, file)


texts: Confusion about shannon's entropy of the grayscale image after lossy compression

texts: I have a .pgm format 480 * 640 gray scale image named 'columns.pgm'. Using PCA (principal component analysis), by preserving 40 principal components I compressed original image with 1218 KB to 301 KB using a Matlab function which I wrote. Now about the entropy. The entropy of the original file was 6.93 and of the compressed file was 7.17. Actually the entropy of the compressed version must be lesser, right? I am confused. Can someone give me a intuition based explanation. And are the cases similar for lossy and lossless compression?


texts: Zero Order Hold with polyphase resampler

texts:
I'm trying to design a FIR filter(direct form) the coefficient of which will be used to design a polyphase resampler that does Zero-Order Hold resampling. If the direct form impulse response is triangular, then we get a linear interpolator.

Is it possible to imagine a filter response that would produce a ZOH interpolator? I have some constraints that prevent a simple MATLAB's repelem() based ZOH implementation.


texts: Can the magnitude of DFT of a triangular wave be max for at 0?

texts:
I'm taking an online class on Signal Processing, and one of the slides of from the class shows the magnitude of DFT for a simple triangular wave to have the maximum at 0.

How can this be possible? This means it only has presences of the component form a sine wave with frequency 0 right?


texts: How to crop a region with smooth edge and without holes?

texts:
I'm trying to extract a single region from the image in matlab. The light region looks well connected and distinct from surrounding.

However, I applied a hard threshold B = A(A>1e-3) and it produced

The edge of the extracted shape is not smoothing at all and there are lots of isolated pixels.


texts:
(Maybe this should be on Stackoverflow instead ...)

What is the best way to calculate the ambiguity function? There are different implementations out there for Python (like PyTFTB or from TooringAnalytics) and Matlab but there are many difficulties:

1. Python - PyTFTB

I am not sure whether the implementation of pytftb is what I am looking for because the plots for 200 Samples of my data always look similar. Here are two examples:

I'd expect more distinct plots. The plots were generated like this:

from tftb.processing import ambiguity
waf, tau, theta = ambiguity.wide_band(signal)
cntr = plt.contourf(tau, theta, np.abs(waf) ** 2, cmap="Greys", antialiased=True)
// even less difference when I use np.abs(waf) ** 2
plt.imsave("filename.jpg", np.abs(waf), cmap="jet")

2. Python - TooringAnalytics

Unfortunately I can't make this one work. Maybe this is content for another question.

3. Matlab

Is not an option. I tried my best to translate this to R but couldn't make it work.

4. R

Unfortunately I couldn't find an implementation yet in R.

I'd really like to ask Dreamcooled how he computed his ambiguity function.

Thanks for your help


texts: How do I extract n-dimensional cepstral coefficients with a sliding Hamming window in PyTorch?

texts:
I am trying to replicate the features from this paper, described  as follows:

MFCCs of speech frames are computed using a mel-scale filterbank. We extract 20-dimensional cepstral coefficients with a sliding Hamming window that takes in a 20-msec speech frame. The Hamming window is shifted forward with a 10-msec frame rate, resulting in a 50% overlap between the consecutive windowed frames. In addition, we extract 20-dimensional delta cepstral coefficients. The final feature vectors have 40 dimensions formed by stacking the cepstral and delta cepstral coefficients.

I am using PyTorch for my machine learning experiments and have written the following code:
import librosa
import torchaudio
import torch

y, sample_rate = librosa.load('path/to/file.wav', sr=None)

n_mfcc = 20
n_mels = 40
n_fft = int(sample_rate * 0.02)
hop_length = int(sample_rate * 0.01)

print('Sample rate: {}, Window length: {}, Sliding window length: {}'.format(sample_rate, n_fft, hop_length))

melkwargs = { "n_fft" : n_fft,
              "n_mels" : n_mels,
              "hop_length": hop_length,
              "f_min" : 0,
              "f_max" : None }

mfcc = torchaudio.transforms.MFCC(sample_rate=sample_rate, n_mfcc=n_mfcc,  dct_type=2, norm='ortho', log_mels=True, melkwargs=melkwargs)(torch.from_numpy(y))
mfcc_deltas = torchaudio.functional.compute_deltas(mfcc, win_length=3)
feature_vector = torch.cat([mfcc, mfcc_deltas])

print("Shape of mfcc: {}".format(mfcc.shape))
print("Shape of mfcc deltas: {}".format(mfcc_deltas.shape))
print("Shape of stacked features: {}".format(feature_vector.shape))

Sample rate: 44100, Window length: 882, Sliding window length: 441
Shape of mfcc: torch.Size([20, 30001])
Shape of mfcc deltas: torch.Size([20, 30001])
Shape of stacked features: torch.Size([40, 30001])

The audio file used in this code snippet has an exact duration of 5 minutes (300 seconds).
As my understanding on some of these concepts is limited and I am not well versed in audio signal processing, I would like to ask the following questions:

Is my calculation (sample_rate * 0.02) and assignment of n_fft for the 20msec speech frame correct?
Is my use of hop_length the same as a sliding Hamming window?
Is my calculation of the delta cepstral coefficients correct as well as the 'stacking' of these features with torch.cat?

Thank you for your time.


texts: Fractional Frequency and negative Frequencies

texts:
So, when we Sampled any signal at the rate lower than Nyquist Frequency we get aliasing,
for instance,

If the frequency of Cosine wave is 5Hertz and I had to make 5cycles in a second and if the sampling frequency is 8Hz,

Frequency = 5Hz

t = 0.2 <- 1 complete oscillation takes 0.2seconds

Sampling Frequency = 8Hz
then Sampling rate would be, 0.125seconds

which means every sample will be generated on each instance of 0.125s

the 8 samples would then be,

  0.1250    0.2500    0.3750    0.5000    0.6250    0.7500    0.8750    1.0000

signal can't be completely recovered at this sampling rate, and only first few cycles will be generated.

the Fractional frequency will then would be, 5/8
(8 samples per second and 5 cycles per second).

According to the above example the Fractional frequency is produced due to the aliasing of the signal.

but as i studied, the Fractional frequency is the reason which cause the imaginary part of the frequencies to be generated.

here is what I've found,
Here the cosine (real, labelled "R") and sine (imaginary, labelled "I") parts:

in figure #4 , both the waves are sine wave, so the Fractional frequency is -3/8
So if there is no Cosine does that mean that this point has no Real part ?
Then how it is generated while calculating the DFT ?


texts: I'm looking for a precise way to compute the key of a song. BPM would be cool too. Analog is ok. I tried to approach it from the DFT angle, but got stuck and can't really put a finger on what's the issue. New perspective would allow me to get out of the mental hole I'm in.


texts:
I have the RLS algorithm implemented in two different ways - transversal and lattice.

I was expecting them both to behave the same way, but they don't! Transversal seems to converge faster than lattice does. I'm not sure why. I plotted them together here:

Lattice is shown in red, transversal is in blue. This is MSE.

The lattice is actually a joint process estimator, so I calculate the error.

Is my implementation just wrong and they should be the same, or is this actually supposed to happen? I mean it could probably make sense because reflection coefficients are limited to 1 in magnitude, but I'm not sure.

Furthermore, in the RLS transversal implementation (with the tap weights), the filter response is symmetrical, so I know what the delay of the filter is. But I don't know what the lattice implementation delay would be like, because the regression coefficients do not look symmetrical to me.


texts: Bandpass filtering an audio signal with MATLAB's $\tt kaiserord$: unknown new frequency component

texts:
I am trying to filter an audio signal with kaiserord in MATLAB, but I'm having a problem. Here is my code:

fcuts=[50 100 20E+3 20.1E+3];
mags=[0 1 0];
devs=[0.05 0.01 0.05];
[n,Wn,beta,ftype]=kaiserord(fcuts,mags,devs, fs)  %fs from my audio signal
n=n+rem(2);
hh=fir1(n,Wn,ftype,kaiser(n+1, beta),'scale');
filtered=filter(hh,1,W) %W is my audio signal

I try to filter audio with $50\textrm{ Hz}-20\textrm{ kHz}$ bandpass filter but after applying filter; I realize that there is signal before $47\textrm{ Hz}$,

Where is my mistake?


texts:
I am working on Automated GUI components Segmentation problem. My Images are very simple as it has GUI components such as Buttons, text box and other polygons as you can see in the diagram (a).
Diagram (b) is the hypothetical and desired image of segmented portions.

image A and B respectively

My approach:

I have implemented the Watershed transformation in this regard, but the results are not satisfying.
The regions are over segmented and thus are not useful for automation. The results include very large
number of small portions of background image.

Actually, I couldn't get the right bg and fg markers to apply watershed upon.

I have followed this link:
www.mathworks.com/help/images/examples/marker-controlled-watershed-segmentation.html

Question :

How to select appropriate Markers to achieve desired result ?
Are there any better approach to attain desired goals ?
should the similar approach would work for text segmentation ?

Thanks


texts: Combining different Likelihoods - Particle Filter

texts:
I am new to particle filters and have a problem when it comes to the weightening (using SIR to be precise).
The problem is that my different state-variables are subject to different noise-realizations (e.g. one variable experiences additive gaussian noise while another one is log-normally distributed), how would one normally deal with these situations?

What I tried out first was to calculate the probability of each state-variable of a particle separatly according to the respective likelihood, then multiply all resulting occurence proabilities for the respective particle and afterwards noramlize the resulting final proabilities as weights.

Sadly, this does not work very well (I suspect this might be the case because it ignores possible correlations between the state-variables) so I am very thankful for any kind of advise in this matter.

EDIT:
From a more mathematical perspective, what I do is
$$f(\mathbf{z}\mid \mathbf{x})\approx f(z_{1},z_{2}\mid \mathbf{x})=f(z_{1}\mid \mathbf{x})f(z_{2}\mid z_{1},\mathbf{x})\approx f(z_{1}\mid \mathbf{x})f(z_{2}\mid \mathbf{x})$$

So first I assume that the multivariate distribution can be expressed by a distribution of its components, then in the second approximation step I ignore the correlation between the respective components. So I would like to know under which restrictions the first step is allowed (I for example know  that it its correct for a multivariate normal distribution) and also how I could enhance the second approximation $f(z_{1}\mid \mathbf{x})f(z_{2}\mid \mathbf{x})$ to balance the lack of the correlation.


texts:
I am working on a project in Object Tracking, i.e. need to predict the location of next bounding box.

I used a Hungarian algorithm with a Kalman Filter (which is a common method in this domain) which produced decent results. However, lots of the times detector has False Positive or False Negative detections (i.e. noise in the sensor) which limits Kalman's predictions.

I was thinking to apply Kalman filter in the backward time direction, similar to bidirectional recurrent neural networks. This way it would utilize information in the future, of course compromising on some latency. This way we would have 2 filters, one in forward direction and another in backward both of which would predict a current location and two results will be merged using another simple method. From my understanding of Kalman filters it would only be possible to have a backward filter only if I were to recompute the full state at every sequence step given next n states.


texts: Is it possible for Matlab to read and decode an mp3 file?

texts:
I have run the following Matlab code and I got a signal as shown in the Figure below.

[y, fs] = audioread(mp3file);
y1 = y(:,1);
y2 = y(:,2);
dt = 1/fs;
t1 = 0:dt:(length(y1)*dt)-dt;
t2 = 0:dt:(length(y2)*dt)-dt;
plot(t1,y1);
hold on
plot(t2,y2);

Is this a signal generate from a raw mp3 file or it is generated from a Matlab-decoded-mp3 file (which means Matlab has internally decoded the mp3 file)?


texts: Make use of a color scale in a random map

texts:
In my class I often need to work with color map images. I would show the image and try to make inferences/observations about different subjects. Often times I need to actually quantify some aspects, but it is always very approximate and somehow vague because the images are provided "as is" and I do not necessarily know their content a priori.

Let's imagine I'm working with two images (*). I would love to tell my computer to "learn" the color scale bar so I can click at any point in the map to get the value of altitude at that point? Image 1 is a discrete color scale bar, while Image 2 has a continuous color mapping. I included both examples because maybe there are differences in the approach of how to do this.

So, is there a software/way to do this? Preferably open source. I tried ImageJ and couldn't come up with a decent solution.

(*) Image 1: https://upload.wikimedia.org/wikipedia/commons/2/24/AYool_topography_15min.png

(*) Image 2: http://topocreator.com/ned-jpg/city_a/600/co.jpg

(*) I do not own any of these images, just examples I found online to illustrate my point.


texts: Precision measurement of sine wave amplitude with ADC

texts:
I want to measure amplitude of a sine wave input precisely with a limited resolution ADC.

As an example suppose that I have $1\textrm{ MHz}$ pure sine wave input to the $320\textrm{ Msps}$ $10$-bit ADC. I beleived there is many redundancy in data and with some signal processing I could get more Precision than $10$-bit.

Is there any way that I can do this without any change in circuit, like adding noise or other hardware change?


texts: What is it called if a system is "in rest" until time $t=t_0$?

texts:
I am a mathematics student, and am quite new to the whole control and system theory (haven't heard any lectures). I currently work with dynamic systems, but do not know the correct words for every attribute, yet.
I would like to describe a system as follows:

A system is in "rest" until time $t=t_0$ for some $t_0\in\mathbb{R}$ if the system response $y(t<t_0)$ and the state $x(t<t_0)$ are equivalent to $0$ for zero input $u(t<t_0) \equiv 0$.

I am quite sure, that there is a word describing this scenario.
I know the term causal in terms of systems, but I don't think this is the word I need.

EDIT: To maybe make it more clear what i want:
I want to say "A system is in XXXX, when for zero input there is zero output." (~the system does nothing before any input is applied)


texts: efficient spectrum/fft analysis of sparse signals (found in radar applications)

texts:
consider the classic scenario of identifying a radar frequency. You typically have a very short pulse of very high RF frequency. For example, a 50ns pulse repeating itself every 1MHz or so (PRF 1MHz and Pulse Repitition Interval 1us) and let's say there are 50 such pulses in each (radar) interrogation so that each set of coherent pulses takes 50us.

The RF frequency is generally in Gigahertz but let's assume it has been downconverted to lie somewhere between 200MHz to 400MHz. Now you want to analyze this signal after subsampling it at a frequency of 100MHz. The straightforward approach would be to sample the whole 50 us worth of data but in reality the only time is signal is on during the 50us period is 50 times 50 ns which is just 2.5 us. The rest of the signal is just zeros. My question therefore is:

is there a 'smart' way of getting rid of this apparently useless information and hence be able to do a much shorter fft?
is it possible to throw away long strings of zeros in between active pulses, stick the pulses together and perform fft? would that cause any sort of distortion in the spectrum?


texts: Object recognition using color information

texts:
I want to use the L*a*b color model for recognition of a particular colored object by calculating the euclidean distance between the desired color in current image and the same color in next image frame.

As the LAB color space was designed in keeping with human vision, I think it can be used for the purpose.  Is this correct?


texts: AM modulated signal not centered at carrier frequency

texts:
I am trying to modulate the signal bl_msg_time (this is a speech signal) using DSB-SC modulation however the signal doesn't appear centered at the carrier frequency.
Below is the matlab code and the result of the plot.

f_car = 1000000;
msg_dsb_time = bl_msg_time .* cos(2*pi*f_car*t);
msg_dsb_freq = fftshift(fft(msg_dsb_time));
msg_dsb_freq=msg_dsb_freq/length(msg_dsb_freq);
plot(fx,abs(msg_dsb_freq));


texts:
Hello I've been trying to understand the grayscale dilation operation using the following example, but my results are different.

$I = \begin{pmatrix}
\bf{5} & 2 & 4 \\
1 & -3 & 1
\end{pmatrix}$

is the image to be dilated, and the structuring element is

$S = \begin{pmatrix}
0 & x & \bf{0} \\
0 & 2 & -1
\end{pmatrix}$

I have marked the origin in the structuring element and the image (the bold $\bf5$ in the top left of $I$ and the bold $\bf0$ in the top right of $S$), and $x$ means that the pixel is not part of the structuring element.
The correct answer is supposed to be

$\begin{pmatrix}
5 & 2 & 5 & 2 & 4 \\
5 & 7 & 4 & 6 & 3 \\
1 & 3 & 1 & 3 & 0
\end{pmatrix}$

but my result is

$\begin{pmatrix}
4 & 7 & 5 & 6 & 4 \\
5 & 3 & 5 & 3 & 4 \\
1 & -3 & 1 & -3 & 1
\end{pmatrix}$

What I did was, put the center of the s.e. in each pixel, for each pixel in the neighborhood sum pixel to pixel their values and take the max of the neighborhood as the new value.

For example, when the s.e. is in pixel $I(0,1)$ then

$$
\max( I(0,0)+SE(0,-1), I(0,1)+SE(0,0), I(1,0)+SE(1,-1), I(1,1)+SE(1,0) ) =\\ \max(5+x=x, 2, 3, -4)
$$

Can someone explain to me what is the correct way of doing this?
In the dilation do we need to flip the structuring element? What about erosion?


texts: Two voice pronunciation comparison similarity MFCC + DTW

texts:
Calculate each MFCC to compare wave file A and wave file B, and then use FastDTW to measure the distance after two sets of MFCCs.

We compared the four wave files and obtained the Euclidean distance value.

The values below are the Euclidean distance values.

  675.0095954620155 A.wav vs. A2.wav

  998.7554375714773 A.wav vs B.wav

  976.1293903229977 A.wav vs. B2.wav

  856.4364672719398 A.wav vs C.wav

  645.8353052519245 A.wav vs C2.wav

I do not know how the Euclidean distance values look for similarity.
Is the similarity rate high when the distance value approaches zero?
How do you know there is a high match with this distance value?
Is not DTW a library to see how similar the voices are?


texts: How to analyze multiple amplitude modulated signals?

texts:
What I'm doing is that I send an audio signal consisting of a single frequency into a resonator. To check whether and how the signal has changed I perform a QAM demodulation.
I do not need intend to recover the signal or something like that, I'm just interested in the magnitude of the change/modulation of the input signal.
In the next step I would like to use multiple frequencies simultaneously and analysed how the amplitude of each signal has changed.
Is there a different/better way than just analysing the signal by Fourier transform?


texts:
I have an application where I do this:

DFT->Filter->IDFT on a range

For computational performance I'm zero-padding my FFT to a power of two, but when I take the IDFT I want to get out an interpolated image instead of the zero-padded image. A minor detail, is that the IDFT is performed over only a certain frequency window.

What can I do in the Fourier domain to stretch my signal so that the IDFT returns the image without the zeroes I padded it with?


texts: How to Design Nonlinear Phase FIR Filter?

texts: I've recently encountered a rather clever low-pass filter that appears to have been designed to sacrifice uniform group delay in the pass-band to get better frequency response relative to the filter length. What methods are available to design FIR filters that maximize frequency performance relative to length while allowing phase to become nonlinear (but still continuous) in the pass-band?


texts:
if i have two adcs(analog to digital converters) sampling a signal. Is it possible to synchronize the two adcs with deep learning?
as far as i know, with super-resolution on image processing it is the same process. If you have multiple images and fuse them together, theoretically its the same as finding out the different sampling points of the signals(registration) and after that the reconstruction with interpolation.
Therefore I ask myself if such a solution is known in signal processing to use a neuronal network to synchronize two signals. The signals I use are from accelerometers. I know, that they dont sample the same signal if i have acceleration in different axis. But if the vibration  is on a rotating machine, there is a correlation between the signals on the different axes. So signals on the axes can be considered as different sampling points on a signal.
if the question is unclear, pls give me hints and i will improve it.
EDIT:
Yes, the waveforms are 90° out of phase in theory, and yes, the speed can change over time. What I want, is to find the shift between the signals and then line them up. If the signals are aliased because of undersampling, the "line up" together is difficult. You can't just use a correlation because aliased signals are different although they sample the same signal (only out of phase). An easy line up is only possible, if they are not aliased. Not aliased signals would not improve the resolving power, because they don't contain information about higher resolution in the form of alias-effects. In super-resolution, you use aliased signals and try to find the offset between the signals(the shift/phaseshift). If you find them, you can interpolate the sample points and you can double or triple the resolution like using multiple adcs with synchronized sampling points.


texts: What's the difference between the Gabor and Morlet wavelets?

texts:
The Gabor wavelet is a kind of the Gaussian modulated sinusoidal wave (source)

  Gabor wavelets are formed from two components, a complex sinusoidal carrier and a Gaussian envelope.  (source)

and

  In fact, the wavelet shown in Figure 2a (called the Morlet wavelet) is nothing more than a Sine wave (green curve in Figure 2b) multiplied by a Gaussian envelope (red curve). (source)

Are these just different names for the same thing?

Update:

Not to be confused with the "Gabor transform", which seems to be just another name for "STFT with a Gaussian window".  There's also the Gabor atom, which I guess is the same as the Gabor wavelet?

Since asking this on math.SE, I've also found terms like "Gabor/Morlet wavelet" and "Gabor-Morlet transform", implying that they are the same thing.

Also this has been asked before: Gabor transform/wavelet vs. Morlet wavelet but the answers are not clear to me.


texts: Window functions with rippleless spectra

texts:
On Wikipedia I found the Hann-Poisson window, and the article claims the spectrum is smooth, but it isn't theoretically smooth, as it turns out. In practice you achieve partial smoothness by jacking up its $\alpha$ parameter.

Can I find what I'm looking for in a function with finite support? Is it mathematically possible?


texts: Can an EEG be re-sampled to fix a poor voltage resolution?

texts:
I’ve made quite a bad mistake in ca. 14 EEG recordings – I recorded at 10uV resolution @ 5000 Hz instead of 0.1 uV @ 500 Hz. I’m conducting an ERP experiment, and the signals of interest are on the order of ~5 uV. I’m wondering if there is any way to up-sample the voltage given I have way more time series data points than I need..? Some sort of interpolation?

I’ve seen a number of posts on up-sampling from say 500 hz to 1000 hz, but not sure if the principal is the same?

Is there a way to trade off the sample rate against the poor resolution? Maybe by means of interpolation, or an averaging method to apply directly to the raw data**

This represents about 42 hours of recording time and I’m anxious to know if I can recover any usable data from these recordings, or if I have to try to get participants back in (there is a treatment enrollment deadline which means I can’t simply acquire more data).


texts:
how do I find the group delay of multirate system.(sample rate converter) , IIR non-linear phase filter
Say decimation by 2 (with lpf) = tf1(num,den)
then again decimation by 2 (with lpf) = tf2(num,den)
In total decimation by 4.
i can do the inidividual stages
gd1 = grpdelay(tf1,fvec,Fs)
gd2 = grpdelay(tf2,fvec,Fs/2)
but how do i find the combined one of the entire system
can two group delays be added ?
Edited :
Assuming the can be added, is the following scaling inside and outside the grpdelay function correct ?
gd1 = grpdelay(tf1,fvec,Fs)/Fs/2 % converting from samples to seconds
gd2 = grpdelay(tf2,fvec,Fs/2)/Fs/4
Then we can plot it
plot(fvec/,gd1+gd2);
xlabel('Freq MHz');
ylabel('Group Delay (s)');


texts:
Short version:

How to calculate a likelihood of Unscented Kalman filter?

Long version:

Likelihood for linear Kalman filter (KF) is:

$$\mathcal{L} = \frac{1}{\sqrt{2\pi S}}\exp \left[-\frac{1}{2}\mathbf y^\mathsf T\mathbf S^{-1}\mathbf y\right]$$

Other words likelihood of KF depends on residual and uncertainty:

$$\mathcal{L} (\mathbf y, \mathbf S)$$

We can see that uncertainty depends on process noise $\mathbf Q$ which is function of a time $\mathbf t$:

$$\mathbf{S} (\mathbf P) \Rightarrow \mathbf{P} (\mathbf Q) \Rightarrow\mathbf{Q} (\mathbf t)$$

This allows conclude that likelihood of KF depends on time:

$$\mathcal{L} (\mathbf y, \mathbf t)$$

For Unscented Kalman filter (UKF) instead of uncertainty $\mathbf S$ is used covariance of sigma-points in measurement space $\mathbf P_z$, where:

$$\mathbf P_z = \sum w^c {\left(\mathcal Z - \mu_z\right)\left(\mathcal Z - \mu_z\right)^\mathsf{T} + \mathbf R}$$

In this case the likelihood can be found as:

$$\mathcal{L} = \frac{1}{\sqrt{2\pi P_z}}\exp \left[-\frac{1}{2}\mathbf y^\mathsf T\mathbf P_z^{-1}\mathbf y\right]$$

But, neither $\mathcal Z$ no $\mathbf R$ depends on process noise $\mathbf Q$, so likelihood of UKF doesn't depend on time.

In practice it means the following: if I try to find likelihood of KF consequentially increasing time which passed after last measurement then likelihood will be reduce, but for UKF likelihood will not be changed.

Where is my mistake?


texts: Three Projective Cameras in the Same "Projective Frame" - What Can I Do With This Info?

texts:
[I originally posted this under Mathematics, but I didn't get any replies.  I thought I'd try here.]
In Hartley & Zisserman's Multiple View Geometry in Computer Vision, in the chapter on trifocal tensors (section 14.1.5 in the linked copy), the authors take extra steps to ensure that the three retrieved cameras are in the same projective frame.
Can someone explain what this buys me, in terms of camera models and reconstruction?  In particular, given three projective cameras $\{P, P', P''\}$ in the same projective frame, if I "upgrade" camera pair $\{P, P'\}$ to an affine or metric reconstruction, can I then use this common frame to upgrade pair $\{P, P''\}$ to a corresponding reconstruction? [I have to admit that I don't precisely know what I mean by "corresponding"; intuitively, I want both reconstructions to represent the same 3D structure.]


texts: Can I compute signal-to-noise ratio on a vector-valued or multi-channel signal?

texts:
I have a dataset that contains multiple channels recorded over time (think EEG or EMG), and I'm working on a computational model for this data. When I have a working version of the model, I'd like to compare the model's predictions to some held-out test recordings. I thought it would be nice use some sort of signal-to-noise analysis to do this comparison, but I can't find much help on whether it even makes sense to try to compute SnR for multi-channel data.

Everything I've seen so far about computing SnR assumes that you have a single time-varying channel to analyze. Should I compute the SnR for each channel of my data independently, and then average the values across channels? How is this sort of analysis typically handled in signal processing?


texts: Frequency Response Error for IIR Butterworth in GNU Octave

texts:
I'm wondering why the following code for GNU Octave appears to be incorrect in the frequency domain by a magnitude of 2. For example, in Figure 1. (Sorry, I'm apparently not allowed to post images!) it can be seen that the -3dB points of the bandpass butterworth filter are at 150 and 300Hz instead of the design requirement of 300 and 600Hz. I can't really see that I'm doing wrong?

%Start from nothing!
clear;

% Set the sampling frequency used by our digital filtering system:
fs=8000;

% Start designing a butterworth filter, passband. (In Hz)
pass_lo = 300;
pass_hi = 600;

% The order of the filter
order = 4;

% Determine the low and high frequencies of the passband as fractions of the
% sampling rate:
flo = pass_lo/fs;
fhi = pass_hi/fs;

% Use the butterworth filter design function to get the coefficients for a
% bandpass filter with the settings above:
[b,a] = butter(order, [flo fhi]);

% Determine the frequency response of the filter design above. Get the output
% in frequency rather than rad/s. Use 512 plot points.
[H,f] = freqz(b, a, 512, fs);

% Plot the result so that we can see if it is correct:
figure(1);
plot(f, 20*log10(abs(H)));
xlabel('Frequency (Hz)');
ylabel('Magnitude (dB)');


texts: How to calculate Eb/N0 for a digital BPSK modulated multicarrier waveform

texts:
Suppose that I have a  BPSK modulated multicarrier carrier waveform $L$ samples long at a sampling rate of $f_{s}$:

$$ x_{tx}[l] = \sum\limits_{n=0}^{N-1} A \cdot \cos\left(2 \pi \frac{f_{n}}{f_{s}} l + \theta_{n}\right) \quad l=0,1,2,\ldots,L-1 ; \; \theta_{n} \in \{-1, 1\}$$

where $A$ is a constant amplitude, and $f_{n}$ is the $n$-th carrier.

I pass this into an AWGN channel where the elements $v[l] \sim \mathcal{CN}(0, \sigma_{v}^{2})$ are iid. This results in the received signal:

$$ x_{rx}[l] = x_{tx}[l] + v[l] = \sum\limits_{n=0}^{N-1} A \cdot \cos\left(2 \pi \frac{f_{n}}{f_{s}} l + \theta_{n}\right) + v[l] \quad l=0,1,2,\ldots,L-1 $$

Question:

How do I calculate $\frac{E_{b}}{N_{0}}$ of the received waveform $x_{rx}[l]$?

My attempt:

$E_{b}$ stands for Energy per Bit. Therefore, I first need to calculate the total energy of the waveform. This is simple:

$$E_{t} = \sum\limits_{l=0}^{L-1} x_{tx}[l]^2$$

Then, due to the modulation type, the energy per bit is just:

$$E_{b} = \frac{E_{t}}{N}$$.

Now $N_{0}$ is the noise spectral density. Therefore if we are given a two sided bandwidth of $f_{s}$ Hz, then:

$$N_{0} = \frac{\sigma_{v}^{2}}{f_{s}}$$

Therefore, our $\frac{E_{b}}{N_{0}}$ ratio is:

$$ \frac{E_{b}}{N_{0}} = \frac{f_{s}E_{t}}{N \sigma_{v}^{2}} $$

Am I correct? Or am I missing something?


texts: I had a doubt regarding the selection of minimum mixed variance, if a situation arises that same minimum mixed variance occurs two times. Is there any way to break this tie?


texts:
I am learning about signals in school but I found it very hard. Can someone help me by giving some references about any books?

We are studying Fourier transform, signal power, filters, digital and analog etc.


texts:
I have a 50-60Hz signal being sampled at a frequency of 25 kHz & I'm trying to filter all frequencies beyond 70 Hz with a reasonable steep transition band (approx 4 Hz) & good attenuation (~40+ dB).

For this, I tried a Windowed sinc filter using the following parameters :-

Cutoff frequency, fc = 70 / 25000   = 0.00280

Bandwidth,        BW = 4  / 25000   = 0.00016

Filter length,    M  = 4  / 0.00016 = 25000

The problem here is the filter length. The value of 25000 means a window that's 1 second wide while my target is typically around 500-1000 samples, i.e. 1-2 cycles at 50 Hz.

I can't increase the bandwidth & I'm not sure what other options I have to meet this filtering requirement. So, my questions are,

Is the windowed sinc not a suitable filter for this application?
Considering that the sampling frequency is so high, shouldn't it be quite easy to achieve this type of filtering with a small filter kernel?
Is there any other filter that I can use for this? My requirement is to offer good attenuation to all signals beyond 70 Hz using a small window. The choice of the filter isn't of much concern.


texts:
I need to implement an ASK (ampliltude shift keying) demodulation using a DSP ( a dsPIC ) and programming in C. Especifically talking, I need to demodulate a signal from a car's key transponder. I already have a circuit of antenna that receive the signal and I already can sample it, but I still have a doubt of how could be the best way, faster and reliable, to filter the signal.
I was using a FIR filter using Kaiser windowing and 13 taps, but it demanded a lot of processing time and I still have some errors. Is there a better way to do it ?

With my best regards,
Daniel.


texts: “Subtracting” one audio stream from another audio stream

texts:
I am a long time software engineer but have practically zero experience with signal/audio processing. I am interested in learning about signal processing via a use-case we have for one of our audio components. NOTE: this is just a learning exercise for me... it is not a priority that the end result be useful.

We have a component (A) which produces audio (via a speaker). We have another component (B) which records that audio (via a simple microphone).

What I would like to do is use A to record B's audio. Then I would like to, if even possible, compare the two streams. The goal would be to remove the audio that was present in stream A - leaving the ambient conditions which existed during the recording - I understand full removal is not possible.

I realize that there are phase and magnitude issues. I also realize that it isn't just a simple matter of "subtracting" B from A. That said, my assumption is you can subtract A from A.

I would like to understand how to approach the problem. Again, this is a learning experience for me (there are no deadlines); I am more than willing to start from the beginning.

Any advice/suggestions would be much appreciated.


texts: Linear approximation of a system described by a logarithm - how?

texts:
The system described by a logarithm of any base, let's call it $y(t) = \ln(t)$, is non-linear.

Is it possible, by any means (transforms, operators etc.), and for small values of $t$ (for example, $t>0$ and $t\leq 0.5$), to obtain a linear approximation of the system (in such $y(t_1+t_2) = y(t_1)+y(t_2)$) with an acceptable percentage error (i.e, up to $5\%$)?
Is there any log base more suited to perform the task?


texts: In cyclic codes, a code vector can be obtained from another by simple circular shift. Why then the other method?

texts: In cyclic codes, a code vector can be obtained from another by simple circular shift.  Why then the other method is taught that is a bit round about?  Take the code polynomial. Multiply it by the polynomial with power equal to the circular shift amount and then take the modulo of another polynomial and then convert this resulting polynomial to the codevector to find that the code vector obtained by circular shift and this polynomial method are the same.  Apart from this interesting property is there any advantage of the polynomial method in implementation or in any other way?


texts: Amplitude reduction of Simple Moving Average on sinusoid

texts:
When a -causal/non-centered- simple moving average filter (arithmetic mean) with length $n$, is applied to a sinusoidal curve with period $p$, and the resulting curve is compared to the original input signal (the sinusoid),
2 things can be observed:

The phase is shifted by $360*((n-1)/2)/p$  degrees
The amplitude is reduced.

How do you calculate the amplitude reduction?

Please give a numerical example:
say $n = 10$, $p=40$, the amplitude of the sinusoid=$1$.
My measured result is $0.8984644$* (the maximum of the red curve on the image below), but can you compute this analytically?

Thank you.

*It was actually 0.90124: please see below to the kind answers why this was wrong: Dan Boschen: "the output simply wasn't sampled right at its max value".


texts: Bessel filters: linear passband phase characteristic only for low pass filters?

texts:
I've found a test (internet) from the contest to signal processing teacher and it has a question (true) or (false).

I cant find any book or paper to argue this statement. Is it really true?


texts: Using the Inverse Filter to Correct a Spatially Convolved Image (Deconvolution)

texts:
As part of a homework assignment, we are implementing the Inverse Filter. Degrade an image then recover with an Inverse Filter.

I convolve the image in the spatial domain with a 5x5 box filter. I FFT the filter, FFT the degraded image, then divide the degraded image by the filter. Inverse FFT the result into an image and I get garbage.

If I FFT the image, FFT the filter, multiply the two, divide that result by the FFT'd filter, obviously I get very close to the original image. ((X*Y)/Y ~== X)

I have an inkling the math is not as simple as "spatially convolved == FFT multiplication".

What is is the correct way to use the Inverse Filter? I have the exact kernel used degrade the image. I'm not adding any noise.

Bovik's textbook, The Essential Guide to Image Processing is almost completely dismissive of the Inverse Filter. Gonzalez&Woods is a bit more hopeful but almost immediately skips to the Wiener Filter.

I have a similar question on stackoverflow.com
https://stackoverflow.com/questions/7930803/inverse-filter-of-spatially-convolved-versus-frequency-convolved-image

(This questions should also be tagged [homework] but the tag doesn't exist yet and I haven't the rep to create it.)

EDIT. For some of the great suggestions below.
@dipan-mehta Before I FFT, I am padding the convolution kernel to the same size as the image. I'm putting the kernel into the upper left. I ifft(ifftshift()) then save to an image and I get a good result. I've done the ifft(ifftshift()) on both the kernel and the image. Good(ish) results. (Images are in my https://stackoverflow.com/questions/7930803/inverse-filter-of-spatially-convolved-versus-frequency-convolved-image question.)

@jason-r is probably correct. I don't understand the mathematics of the underlying convolution + transform. "Deconvolution" was a new word for me. Still have much to learn. Thanks for the help!

My solution for the homework assignment is to do everything in the frequency domain. I spoke with the professor. I was making the assignment harder than necessary. She wanted us to add noise then try the Inverse Filter, Wiener Filter, and Constrained Least Squares Filter. The point of the exercise was to see how the filters handled noise.


texts:
I am trying to find the time lag between two time series over t = [0,1000] using MATLAB (not that it matters). The first time series is simply t^2. The second is (t-15)^2 which is, of course, shifted to the right 15 units (e.g., seconds). My approach has been to find the cross correlation (computed using FFT) and then use the maximum of these to determine the appropriate time shift. For some reason, the answer I keep getting is 0, which doesn't make any sense. Can anyone tell me what I'm doing wrong? Thanks!

I've calculated the cross correlation using FFT as shown (all code is in MATLAB; note fft is the Fast Fourier Transform function and ifft is the inverse Fast Fourier Transform function):

t = [1:1000];
a = t.^2;
b = (t-15).^2;

if (length(a) < length(b))
  c = [zeros(1,length(b)-1) a zeros(1,length(b)-length(a))];
  d = [b zeros(1,length(b)-1)];
else
  c = [zeros(1,length(a)-1) a];
  d = [b zeros(1,length(a)-length(b)+length(a)-1)];
end

c_fft = fft(c);
d_fft = fft(d);

cross_spectral_density = c_fft.*conj(d_fft);
cross_correlations = ifft(cross_spectral_density);

[max_xcorr shift_idx] = max(abs(cross_correlations));
shift = shift_idx - max(length(a),length(b));


texts: Comparing Images by Defining a Reference Model

texts:
I have a microscopy system which periodically captures an image to be used for shading correction.  Because these images are captured on tissue slides containing, well, tissue, as well as possibly debris, I would like to define a known, good image as the reference with which to compare subsequent images.

These images are captured over clear glass using a line scan camera, so, optimally, there will be little variation across the Y axis, and a quadratic like curve across the X which models the light drop-off at the edges of the field of view of the camera.  An intensity profile, averaged along each column, looks like this:

As you can see, I'm currently using a quadratic fit to model the data.  What I'm now grappling with is what measures to use to compare this image to a future sample.  My initial approach was/is statistical in nature; mainly, comparing residuals.  The difference in residuals between the reference and an arbitrary sample is currently my strongest measure, but I'm not a statistical whiz, and I'm not convinced it is the correct approach yet.

For reference, here are a few samples which should be rejected.  I can add raw data if needed, but I'm really just looking for ideas from the DSP side of things.  The green line is the plot of the reference image, the red line the fit for the image in question.  That last one was captured over faint tissue, and it's a bugger if I continue to use a quadratic fit model.  I may end up using a different approach for that situation.


texts: Finding Correlation response in fourier domain

texts:
Lets say I have a system that is trying to find a small image (assume all images are grayscale) within in an image by using correlation. So this system has the baseline image, and I input 5 different images (the five input images are bigger or have more data points than the baseline image) and do correlation of my baseline images against the five input images. From this I would get 5 "tables" of correlation values, and from each tables I select the highest value as the metric to how similar the input image is to the baseline image.

Now lets say I want to upgrade my system to do the correlation in the fourier domain. I pad the smaller image with zeros, do the fft, multiply the data by the conjugate of the baseline to do correlation, and I get the power spectral density at each point through some PSD estimator method, like Bartlett, welch, blackman-tukey, etc.

From my understanding, the more spread out, or the less dense the power spectrum is over a set number of frequency bins, the less correlated the two signals are, and vice versa.

But my question is, in the frequency domain, particularly for a two-dimensional signal, would the metric for measuring how spread the power is simply be the maximum value within the table I would attain after the correlation and PSD estimate, as in the spatial domain case?

Also if you could cite your answers whether it be a book or article, that would be much appreciated


texts: Lower peak to average power ratio by phase shifting

texts:
A particular, frequency-domain sequence of +1 and -1  as follows:

$X=[-1, -1, +1, +1, +1, +1, +1, +1, +1, -1, +1, -1, -1, +1, +1, -1, -1, -1, +1, +1, -1, -1, -1, -1, +1, -1, +1, -1, +1, -1, -1, +1]$

is being transformed to the time-domain and transmitted over a wireless channel. It was stated that if $X$ is phase shifted i.e. multiplied by the following sequence

$w= [1, j,-1,-j,1, j,-1,-j,1, j,-1,-j,1, j,-1,-j,1, j,-1,-j,1, j,-1,-j..]$

The resulting time-domain sequence would have a lower peak to average power ratio.

Can anyone tell me why?


texts:
I am trying to generate GPS Acquisition signals using frequency code phase search acquisition.

I generated C/A gold codes and digitised at 16.368e6 MHz(sampling frequency)
I generated carrier signals using exponential function at sampling frequency
I have input data with IF of 4.092e6 and sampling frequency as mentioned above. my input data has 163680 samples
I multiplied input data with carrier signals which produces 1023 samples by considering 1023 samples from input data and converted into Frequency dmain using FFT
I converted gold codes into frequency domain using FFT
I multiplied gold codes with step 4 to get final output with 1023 samples.

Now I want to plot and check for peak. But I don't know how to plot the below graph.

Help Needed in:

Understanding the Energy grid like below. The 2 axis are Code Phase and Frequency.
Steps/Hints at the RX side to get such grid.


texts: Model of modulator and demodulator in Simulink. Why is MER so lowest?

texts:
I created a simple model in Simulink of a quadrature modulator, amplifier and quadrature demodulator. On the oscilloscope(scope in Simulink) and spectrum analyzer the displayed results look normal (at least I think so), but on the constellation diagram I have very low MER, about 15 dB.

Where is mistake?

[3
[4


texts: How could one can say that frequency spectrum having Nyquist frequency 'x' is the most appropriate representation of a given signal?

texts:
I have a sinusoidal signal which has  a period of 2 and I want to find the frequencies that are present.I assumed sampling interval as 0.01 and based on this I sampled the signal.The Nyquist frequency i got from this is suppose 'x'.Now if I change my sampling interval to 0.001, Nyquist frequency in this case is '10*x'
So my question is,which frequency spectrum will represent the signal correctly, the one with Nyquist frequency 'x' or the one one with Nyquist frequency '10*x'


texts:
I have a beamformed output, say

y = weights * signal,

where the signal is gaussian,i.e signal = randn( 1 , 1e5 ).

Now I want to visualise the output in angular domain, i.e I want to plot the gain of the resulting signal y as a function of elevation angles. I am considering the mainlobe of 'signal' to be pointing in (0 azimuth,0elevation). The weights are combination of amplitude weights and phase weights(exp(phase terms)). I am computing the antenna pattern in the following way:

pattern = abs(arrayFactor.* y).^2;

Is it correct to plot the antenna pattern of such a signal y by multiplying it by the array factor and then plotting its squared magnitude?(in case of isotopic element pattern.)

I would highly appreciate any input.


texts:
I am trying to make filters for days but now I just want to know the experience of others rather than go on to wrong way and finally decided to put my query over here with full detail rather then short question of every day . What is the best way of making image filters like Instagram or aviary or many other photo editing application , Can we make it using OpenCV or we need to make them by using operation on bitmaps like simple color operations of giving weights to them.

How they made the filters?
What is the logic behind it?
How we can perform the same operation?
Whats the best way of making them?

I read Quora - How Does Instagram Develop Their Filters?, but it didn't give the best way to operate with the tool for android . I don't even know that this question is right for this forum or not , but I just want to consult the algorithms , the best way to do it for android and simple the way from which I need to start ? I saw simple OpenCV - How to Implement Sepia Filter operation but its not easy to find that type of values for other filters like which we want to make like other colored shades in which only little effect can change the whole look of the image and the last thing is it the helpful if we make filters in Photoshop and then follow the steps in our program.
Thanks


texts: Is fft2 in MATLAB unitary? Some differences happen

texts:
I meet a problem when implementing fft2 in MATLAB.

The question is I try to simulate the realistic measurements $Y = |FCXF^H|^2$ - the intensity of Fourier domain of object $X$, where $F$ denotes the Fourier transform matrix $C$ denotes $\{+1, -1\}$ matrix.

But I want to replace the $C$ to realistic $D = \{0,1\}$ with $2D - 1 = C$. Therefore, after some simple calculations, the measuremnts $Y$ becomes $Y_{real} = 2(|FDXF^H|^2 + |F\bar{D}XF^H|^2) - |FXF^H|^2$, where $\bar{D}$ denotes the inversion of $D$. The calculations are from a paper.

For original $Y$ and $C$ the algorithm could work. Therefore, I try to verify with $Y_{real}$. Strange things happen, although the intensity of Fourier domain of $Y_{real}$ looks similar with $Y$. They are totally different!!!

I am very confused, the equations are right, but why they are different? I think the problem is from fft2 function. Could anyone tell me the principle of fft2? Thanks in advance!!!

Here is the code:

This implements the original algorithm with $C$:

Y = abs(fftshift(fft2((2*D-ones(n1,n2)).*x))).^2;

This implements the equation - realisitic measurement:

Y_real = 2*(  abs(fftshift(fft2(D.*x))).^2 + abs(fftshift(fft2( ( ones(n1,n2) - D ).*x ))).^2 ) - abs(fftshift(fft2(x))).^2;


texts: What are the parameters of transducer that I can get from an Anechoic chamber?

texts:
I have a bunch of piezo elements, that I want to use as "Mics", for that I will test their reaction in a Anechoic chamber. My question is what the are characteristics that I can measure that describe those elements and can help me analysing the generated sound later, I already have in mind the following :

Amplitude response
Phase response

Thanks for any help in advance !


texts: Recursive filter with truncated polynomial impulse response

texts:
How can we recursively implement a causal discrete-time truncated infinite impulse response (TIIR) filter with an arbitrary truncated polynomial impulse response:

$$h[n] = \begin{cases}\displaystyle\sum_{k=0}^K c_k n^k&\text{if }0\le n<N,\\
0&\text{otherwise,}\end{cases}$$

where real $c_k$ are the arbitrary coefficients of the polynomial, nonnegative integer $K$ is the degree of the polynomial, $0^0 = 1$, and positive integer $N$ is the length of the part of the impulse response that may be non-zero?

Perhaps a recursive form allows time complexity to be not dependent on $N$, giving an efficient implementation when $K$ is small, even when $N$ is large. Moving average can be implemented recursively as an integrator with tail cancellation. That's a $K=0$ degree truncated polynomial impulse response. Perhaps higher degree polynomials are also possible.

A cascade of identical moving average filters gives a B-spline impulse response, which is a piece-wise polynomial of any desired degree but lacking arbitrary control of the polynomial coefficients. Perhaps some form of tail cancellation allows to isolate a single piece of a higher degree B-spline impulse response and to linearly combine the piece with the same of lower degree B-splines to get arbitrary polynomials of any degree. Or maybe there is another approach.

Some promising literature I found:
Oscar G. Ibarra-Manzano, Yuriy S. Shmaliy, "Implementation of Digital Unbiased FIR Filters with Polynomial Impulse Responses", Circuits Systems and Signal Processing, April 2012.


texts: Parameters of standard audio channel filters

texts: I want to do some simulations of speech recorded on microphones. In order to simulate the channel response, are there any standard (FIR) filter parameters available that I can use?


texts: Use of pulse shaping in digital modulation

texts:
Sorry, I am a little bit confused here cause I thought when we say QPSK, the signal looks like the following.

I thought the bits to send/receive depends on the phase shift of the carrier, or is the above picture wrong or will never happen in real world?
So the discussion from here is to use pulses to send 1's and 0's? What does the signal look like in air actually? Pulse Shaped or like my attached picture? I am confused, so does the phase shifted carrier signal indicate a symbol or does the amplitude of a pulse shaped signal carries the bits?


texts: Checking for VHF pulse with SDR and python

texts:
So I have a small NooElec Software Defined Radio and I've got it working well with my Raspberry Pi using GQRX as a controller and to visualize the SDR output.

My goal though is to use a python script to listen for pulses (10ms long every 1s) from small VHF beacons on animals that we've tagged. These tags give out a ping around 151MHz and I've been able to find them fine in my GQRX output but I would like to use the pyrtlsdr tool and matplotlib's mlab functions to pull this into python so I can trigger some other equipment once that signal pulse is detected above a certain strength. Basically I'm using signal strength as a proxy for distance to zero in on the tag. My experience with RF is pretty limited but I think this should be a relatively basic operation.

So I ingest the samples from the SDR with pytrlsdr use mlab.magnitude_spectrum() to convert that to signal strength and frequency in order to find out whether or not the signal meets my threshold and this sort of works but I feel like I'm pushing through the dark and wanted to double check my methods and see what else I need to check for when running through this procedure.

Specific Questions:

What is the ideal sampling rate? How can I calculate this?
Is anything about this method going to hurt my detection radius, as usual it is critical that is a large as possible. Any way to improve the detection radius? I assume I need to filter some noise but I'm not quite sure of the best method.
I'm not exactly sure how the find the peak but have been using
around with this code from github, is this appropriate for peak finding in this situation?

So here is my current method:

from pylab import *
from rtlsdr import *
import numpy as np
from scipy import signal
import peakdetect

sdr = RtlSdr()

tag_list = [151.129, 151.029, 151.229]

# configure device and settings
sdr.sample_rate = 2.6e5     # Hz
sdr.center_freq = 151e6 + 0.05e6 # Hz, offset because of artifact on central frequency
sdr.gain = 8
num_samples = 1024*1024

samples = sdr.read_samples(num_samples)
# use matplotlib to estimate and plot the PSD
power, psd_freq = psd(samples, NFFT=1024, Fs=sdr.sample_rate/1e6,
Fc=sdr.center_freq/1e6)
xlabel('Frequency (MHz)')
ylabel('Relative power (dB)')
show()

power_db = 10*np.log10(power)

maxima, minima = peakdetect.peakdet(v=power_db, delta=1, x=psd_freq)
print(maxima)

.

# > [[ 151.09901953  -38.86662917]
# > [ 151.12898047  -17.83309643]
# > [ 151.179       -17.72161527]
# > [ 151.22394141  -32.65342774]
# > [ 151.22901953  -24.08179541]
# > [ 151.25898047  -39.26995763]]

.

proximity = .002 # Hz, offset because the tags drift a bit and the SDR isn't exact

for tag_freq in tag_list:
    for mx in maxima:
        if abs(tag_freq - mx[0]) < proximity:
            print('Near tag', tag_freq, mx[0])

.

# > ('Near tag', 151.129, 151.12898046835249)
# > ('Near tag', 151.229, 151.22901953164751)

.

I certainly have some reading up to do on RF Signal Analysis but I feel like I'm close to a working system.


texts: How to perform carrier phase recovery in software?

texts:
What are the options for recovering the phase of a BPSK signal in software? The only resources I can find online contain circuit diagrams – there seems to be no one willing to explain this to people unfamiliar with analog circuits.

I'd like any explanation of how carrier recovery works in theory, and would also love pseudocode or code examples.


texts:
As the signal $m(t)$ is Baseband signal after modulation it wil be bandpaas signal will look like this

So I need to use the Baseband sampling

Here $f_L=15kHz,f_H=25kHz,B=5kHz,$Now Undersampling formula

$n\leq\frac{f_H}{f_H-f_L}$
,$n\leq2.5,$ so $n=2$ (maximum),

Now $\frac{2f_H}{n}\leq f_s$,$25\leq f_s$,

so minimum sampling rate will be $25kHz$

But the answer given is $10kHz$,What should be the correct answer?

Also i am confused whether will I get back the signal m(t) after bandpass sampling like this?

What is the mistake  I am doing?

PS:Please answer it with some graphical approach if possible i am confused with the theory from this question

EDIT:

Please have a look at this

Also that means modulation will not effect sampling if we want to recover the baseband signal back,so for this minimum sampling can be calcuated by baseband sampling as $2f_m\leq f_s$


texts:
Background: I was reading the article Application of Higher Order Statistics for Atrial Arrhythmia Classification, and they mentioned using the higher order cumulant
$$C_3^x = m_3^x(i, j)=E[x(n)x(n+i)x(n+j)]$$
and applying independent component analysis on it. Specifically, they mention

In the present study, the performances of two methods are compared: (i) 3rd order HOS cumulants and (ii) HOS bispectrum. The 3rd order cumulant and bispectrum coefficients are subjected to dimensionality reduction using independent component analysis (ICA) and classified using classification and regression tree …

How specifically to apply ICA on the 3rd order cumulant to reduce the dimensions? You may assume that $x[n]$ is the heart beat signal and that we only consider the third order cumulant on the domain $(i, j) \in [-2, 2]\times[-2, 2]$.


texts:
Would it be possible to use a conventional Canon DSLR camera to do some kind of vaguely meaningful spectrum analysis with GNU Octave?

My niece needs to do a biology science project for school so I was thinking we could use her digital camera to periodically take images of a sample like a test tube of broth+yeast or proteins+enyzme or similar and then do some kind of image processing using Octave to do some kind of crude spectroscopy.

We have the computer doing tethered image capture no problem and I have octave processing the images and doing basic fft type stuff. But I'm not terribly familiar with signal processing and definitely not image processing so what would you recommend given the problem?

I am thinking the image should be processing in a homogeneous way. Meaning no one area of the image is more important than another. So some kind of averaging might be done first? Then an FFT?

How can I create an actual visible light spectrum?

For example, let's say we use a phenolphthalein type of reagent such that, as the pH of a sample changes, the absorbance of particular colors changes accordingly and so the camera and image processing ultimately yields some values that can be calibrated to different pH values.


texts: Sample & Hold: Estimate jitter delay of an ADC

texts:
I've got a question regarding the effects of sample and hold.
My input signal is $x$, and my output signal $x_{SH}$. The error between the signals is $e_{SH} = x_{SH}-x$.

The sampling frequency is set to $f_s = 1000kHz$ and the jitter delay to $t_{jitter}=4\cdot 10^{-4}s$.

The influence of the jitter is implemented in Matlab as the following:

t = (0:N-1)/f_S;
x = sin(2*pi*f*t);
t_SH = t+Tjitter*(2*rand(size(t))-1);
x_SH = sin(2*pi*f*t_SH);
e_SH = x_SH-x;
rxx = xcorr(x,x,'biased');
ree = xcorr(e_SH,e_SH,'biased');

Now I'd like to estimate $t_{jitter}$ using the formula:

$SNR = 20 \log_{10}\left[\frac{1/\sqrt{2}}{\Delta v_{rms}}\right]=20 \log_{10} \left[\frac{1}{2\pi f t_{jitter}}\right]\\$
$\Rightarrow t_{jitter} = \frac{1}{ 2\pi f \left(\sqrt{ \frac{P_{signal}}{P_{noise}} }\right) }=\frac{1}{ 2\pi f \left(\sqrt{ \frac{max(r_{xx})}{max(r_{ee})}} \right) }$

Now I only achieve the same result of $t_{jitter}$ if I add a factor of $\sqrt{3}$, which I can't explain why.

$\Rightarrow t_{jitter} = \frac{1}{ 2\pi f \left(\sqrt{ \frac{P_{signal}}{P_{noise}\cdot 3} }\right) }$

I'd be happy for some help! Thanks in advance!


texts: Can $\delta(t+\infty)$ be a legitimate signal?

texts: Mathematically speaking, when I try to use some signal to disprove a system is invertible, can I use the signal like $\delta(t+\infty)$ ($\delta$ representing the Dirac distribution)? For example, the two inputs $0$ and $\delta(t+\infty)$ are distinct, but their outputs from the system $\int_{-\infty}^{t}e^{\tau}x(\tau)d\tau$ will then both be $0$. In this way, can I say the system is invertible?


texts: Generating drum sample in programming language

texts: How would you generate the sample of a drum, say "tom". Using the programming language and it's functions like addition, multiplication, sine, sqrt etc. I tried to generate the sine wave and then sharply cut the volume and add some white noise. This trick gave me something somewhat drumish, but far from perfect.


texts:
Is it possible to model the acoustic transfer function in MATLAB for a common set of headphones? i.e. I want to model the summation of a noise sample and the audio from the output of the headphone e.g.

signal = exteriorNoise + Music

Where signal would be the information the user would hear? I would imagine headphones would implement some attenuation and low pass filtering, but I cannot find any documentation. I am aware every headphone / in-ear would be different, but I merely wish to make a more realistic model that basic signal addition.

Many Thanks.


texts: "Ensemble averaging ... cannot track dynamic changes"?

texts:
A book claims this as a motivation for introducing exponential averaging:

  A disadvantage of ensemble averaging is that the resulting estimate cannot track dynamic changes occurring in the observed signal.

  -- L. Sörnmo and P. Laguna, Bioelectrical signal processing in cardiac and neurological applications

The authors seem to use the term ensemble averaging to refer to averaging all observations of a stochastic process. Modifying this method to keep a moving average, i.e. averaging only the past $n$ observations instead of all of them, seems very close at hand.

Such a moving-average smoother would be able to track changes in the stochastic process being observed, just like the exponential-average smoother. Is this the difference in dynamic capabilities that the authors are referring to, or have I missed a deeper difference?

$$ \begin{align}
Y_{\mathrm{ensemble,}N}(z) &= \frac{1}{N}\left(z^{0}+z^{-1}+z^{-2}+\cdots+z^{-(N-1)}\right)X(z) \\
Y_{\mathrm{exponential},\alpha}(z) &= \frac{\alpha}{1-(1-\alpha) z^{-1}}X(z)
\end{align}$$


texts: Orthornormal Wavelet scaling function coefficient calculation (filter design)

texts:
I stumbled upon an equation system as shown in the image below while designing an orthonormal wavelet filter. I tried solving the equation (5.63,5.64,5.65 => 5.66) but no avail. I'm not sure if there's any property or parameterization method to solve this equation?

The equation below is taken from "Introduction to wavelets and wavelets transform A Primer" page 66


texts: I have been given a OFDM signal of crest factor of 12dB. The crest factor is the ratio of peak power to the average power of the signal. Does anyone have any idea how crest factor of 12dB is derived for an OFDM signal?(assumptions on peak power,average or RMS power etc). I would highly appreciate any input on this.


texts: Speech signal formant spectrogram. How can we determine F1?

texts:
The formant spectrogram in this page points F1 and F2 as below;

In bottom-right F1 movement, I thought F1 could be below blue one. But how can we determine F1 is upper one not below one?

Is it because we know F1 and F2 have to be getting closer from [ε] to [ae]? Or, can we determine F1 only with spectrogram?


texts: Discrete Fourier Transform for text analysis?

texts:
I would like to determine the number of text-blocks verifying a roughly similar pattern. I have the intuition that I could do it using some Discrete Fourier Transform (DFT)-like methodology.

Example:

  Votre date de livraison estimée est :  Mercredi 7 octobre 2015 -
  Vendredi 9 octobre 2015

  Votre mode de livraison est :  Livraison Rapide

  Vos commandes     Votre commande sera expédiée à :

  M. X

  120 Road Nowhere

  Floor 1 Company Z

  City, Zipcode

  Country

  Votre date de livraison estimée est :  Mercredi 13 mai 2016 -
  Vendredi 1 juin 2016

  Votre mode de livraison est :  Livraison Rapide

  Vos commandes     Votre commande sera expédiée à :

  Mrs ZZ

  10, Street Paradise

  Another city, another zipcode

  Country2

  Votre date de livraison estimée est :  Mercredi 7 octobre 2010 -
  Vendredi 9 octobre 2011

  Votre mode de livraison est :  Livraison Rapide

  Vos commandes     Votre commande sera expédiée à :

  M. YX

  333, avenue WeirdName

  Door 5 Start-up U

  SF, ZIP

  US

I want to determine that there are 3 blocks (the 3 info for delivery address Amazon-like).

I cannot rely rely on vocabulary (it is not necessarily this kind of text-content). The structure of the blocks is similar (+noise).

Can someone (in)validate this idea, and help me to develop it?


texts: A question on Fourier Series and the frequency of the sinusoids

texts:
On studying about Fourier series, I encountered 2 doubts:

How is it that a non-periodic function has a Fourier series?
When expressing a periodic function as summation of sinusoids, why is the fundamental (minimum) frequency taken to be that of the periodic signal? Why cannot one of the sinusoids have a frequency less than the fundamental?

I mean, we think of representing the signal in terms of sinusoids with frequencies greater than and equal to the fundamental frequency, and of course, there is the DC part as well. But, why is there no sinusoid with frequency less than the fundamental as well?

Is there any mathematical logic for the second point?


texts: A sequence OFDM modulated with normalization factor

texts:
The following sequence is used to modulate 52 subcarriers. Twelve out of 52 are non zero. I was wondering

$S_{[–26, 26]} = \sqrt{13/6} \{0, 0, 1+j, 0, 0, 0, –1–j, 0, 0, 0, 1+j, 0, 0, 0, –1–j, 0, 0, 0, –1–j, 0, 0, 0, 1+j, 0, 0, 0, 0,
0, 0, 0, –1–j, 0, 0, 0, –1–j, 0, 0, 0, 1+j, 0, 0, 0, 1+j, 0, 0, 0, 1+j, 0, 0, 0, 1+j, 0,0\}$

The book says that The multiplication by a factor of $\sqrt{13/6}$ is in order to normalize the average power of the resulting OFDM
symbol, which utilizes 12 out of 52 subcarriers.

I tried to compute it..

My guess is that the average energy in such sequence before normalization would be $$12\times \frac{\sqrt{2}}{52}=\frac{3\sqrt{2}}{13}$$

where $\sqrt{2} = \sqrt{1^2+1^2}$ from the complex symbols withing the sequence.

Then why is the normalization factor $\frac{\sqrt{13}}{\sqrt{6}}$?

Thanks


texts: Frequency response of FIR (MTI delay line canceller) with non constant period

texts:
Short question

How to plot the magnitude of frequency response of the delay line canceller with non constant period using GNU Octave? Or more directly: how to plot magnitude of frequency response of staggered PRF (pulse repetition frequency) MTI (moving target indicator) processors?

Full question

I try to plot magnitude of frequency response of the MTI delay line canceller (some kind of FIR) which has the following structure using GNU Octave:

With tips in my related post I can plot frequency response for constant period:

close all;
clear all;

T   = 1e-3;
f   = linspace (0, 2 / T, 1000);
w   = 2 .* pi .* f;
z   = exp (-j .* w .* T);
H_z = 1 - z .^ -1;

plot (f, abs (H_z), 'r', "linewidth", 2);
hold on;
grid on;
title ("Magnitude of the frequency response of the delay line canceler.");
xlabel ("Frequency.");
ylabel ("Magnitude.");

But now I am interesting in frequency response for non constant period:

determinate values of period;
random values of period.

I try to do in the following way:

close all;
clear all;

T_1   = 0.001;
T_2   = 0.0012;
f     = linspace (0, 2 / min (T_1, T_2), 1000);
w     = 2 .* pi .* f;
z_1   = exp (-j .* w .* T_1);
z_2   = exp (-j .* w .* T_2);
H_z_1 = 1 - z_1 .^ -1;
H_z_2 = 1 - z_2 .^ -1;
k     = 1 / 2;
H_z   = k .* (H_z_1 + H_z_2);

plot (f, abs (H_z), 'r', "linewidth", 2);
hold on;
grid on;
title ("Magnitude of the frequency response of the delay line canceler for alternate values of period T1 and T2.");
xlabel ("Frequency.");
ylabel ("Magnitude.");

Another words, I mean that: common frequency response is the normalized sum of the frequency response for each value of the period.

Am I right? If yes, is this approach will be correct for random values of period?

Notes

Here is some related papers, when mentioned frequency response of staggered PRF MTI processors:

first (Pg 66 in books numeration or 81 in pdf-document numeration);
second (Pg 32).


texts:
I'm working on a project for the university about the anti aliasing filter.

I have a small audio file, which has a sampling rate of 22KHz. Now when I downsample it 8 times, the file sounds weird. So far so good.

Now I should design an anti aliasing filter to avoid that. But how do I choose the cut off frequency based on the spectrum of the 8-time downsampled signal?

Anyhelp would be appreciated.


texts: Practical Applications of upsampling and downsampling

texts: I'm a complete novice to digital signal processing, and I've started reading a few books on it.  In particular, I've run across the concept of upsampling and downsampling. As I understand it, given a discrete time signal $x(n)$, upsampling transforms the signal by (essentially) inserting $L-1$ zeros between each sample.  Similarly, one can downsample by omiting ever $L-1$ samples.  I'm not sure I understand why one would want to do so.  Why insert 'data' into the signal that wasn't there originally (upsampling)?  Wouldn't removing data (downsampling) remove features that are essential to its analysis?  I'm curious to know under what circumstances is this particularly useful?


texts: Transmission frquency in MIMO-OFDM system

texts:
What I understand in MIMO system, the user data is broken down into several chunks and transmitted over the antennas (say 3 Tx antennas) by using same frequency Fc. In order to use the interference as an advantage in this case.

And what I know of OFDM, the large BW is divided into several smaller ones, with each having a specific frequency. For example, 2.4GHz BW is divided into 14 channels, each channel has a different central frequency (say the 6th channel has a frequency of 2.437 MHz).

Now the question is while we combine this 2 method of MIMO-OFDM for transmission, does that transmit in same frequency from each antenna? Or at different frequencies?


texts:
I have quite a few noisy signals and I want to calculate their spectral tilt over time, preferably using a method from literature. So far, I can only come up with the slope of the line between the F0 and F1 peaks. The problem is, I don't know how to calculate the spectral tilt by hand for the below example (which is a cross-cut of the energy-frequency spectrum), because F1 is so low.

The frequencies and energies of all the peaks are the following:

 Freq (Hz) Energy (dB)
    95.465 -46.700
   142.06  -43.072
   178.24  -43.564
   269.82  -14.422
   405.93  -34.140
   537.26  -19.539
   803.47  - 2.081
  1060.3   -10.409
  1315.0   -14.574
  1581.0   -24.363
  1843.0   -29.801
  2214.9   -34.464
  2744.3   -28.979
  3197.9   -26.913
  3961.1   -30.493

Can someone help me with this?


texts:
After extracting audio features using some library, I just realized that sometimes it (MFCC) might or might not have zero values. At what time/event does MFCC could have zero values? Because it's (some zero values on MFCC) not appeared on every audio files.

And also, can we use some value (0 or anything) as don't care value on MFCC?


texts: Weird results out of fourier transform of unknown signal, what am I doing wrong?

texts:
It has been a long time since I studied engineering, please forgive my mistakes.

I got data sampled from a digital accelerometer. It is sampled at 20 hz, then collapsed into 1 second epochs. The data is then filtered to remove noise.  The system outputs 0 at rest, a lot more during activity.

I'm looking at the fourier transform of the signal, 1024 samples, sampled once per second. I'm  seeing this:

Here's a real-imaginary plot of the real-imaginary results of the Fourier transform.

The signal appears to be a helix in frequency domain.The system appears to oscillate around some limit cycle within frequency domain.

Is this possible?
Is Fourier transform completely wrong for the digital signal?
 Should using only the DFT for this kind of analysis?
Is my window size wrong ?
 Am I seeing aliasing due to incorrect window size?

It has been a few years since my last engineering class, and I'd really appreciate any help on the subject. I got 3 books on engineering, signal analysis and transforms, but it takes time for this kind of knowledge to come back to me.


texts: Dot or point pattern recognition for Braille Paper

texts:
we are very new to image processing field.
We are gonna do a study about braille to text conversion, by the way braille is a method of writing for blind.
!(https://fryemuseum.org/images/exhibition_images/23_Jannausch_Todd.jpg)

On our research, we find different algorithms. The procedure that we will use is first, find the edges of the braille paper using Canny Edge. But I find recently about the RANSAC. I wonder what should we use.

Another Thing is, we need to find a technique in recognizing the braille code on paper in real time using a smartphone. On our research, we think we will use optics algorithm first to group the code. Was it better or we should use the  Generalized Hough Transform that in here in the website.
Sorry for dummy question, for now we just want an idea for the image processing techniques.
~bad english~


texts: What filter to use in audio analysis filterbank instead of FFT?

texts:
Standard bandpass filters can make super precise analysis filterbanks with 1024 to 4096 filters, on reaktor4. I tried in code to used cookbook BandPass and the result was aweful.

Does someone know a precise BandPass Filter that transmits narrow bands of an intended frequency without noise and irregularity? resonance is an advantage because it takes the detected frequency's value and adds a large pure amount of that frequency as a sine wave, which is cool because ideally i would be letting through individual sine waves of given frequency. i want something of that kind. what kind of filter should be used on filterbanks? do you have an example in code?


texts: Why would I want to define a modulation index for each tone (DSB-FC)?

texts:
So the exercise is basically a signal $f(t)$ that is going to modulate the carrier $A\cos(\omega_ct)$ using a modulation index of $m=1$. I have to find $A$ and the power of the modulated signal:
$$
f(t)=\cos(\omega_mt)+2\cos(2\omega_mt)
$$

The minimum amplitude of $f(t)$ is $-2$. Then $A = 2$. The power of the signal is, assuming that $R = 1 \ \Omega$:
$$
P = P_c+P_s=\frac{A^2}{2}+\frac{\overline{f^2(t)}}{2}
$$

Having in mind that:
$$
\overline{f^2(t)}=\frac{1^2}{2}+\frac{2^2}{2}=\frac{5}{2}
$$

The power is:
$$
P =\frac{A^2}{2}+\frac{\overline{f^2(t)}}{2}=\frac{2^2}{2}+\frac{5}{4}=3.25
$$

In the book the author uses an effective modulation index that is defined as $m_t = \sqrt{m_1^2+m_2^2}$ where $m_1=1/2$ and $m_2 = 2/2$. So the power is:
$$
P = P_c\left(1+\frac{m_t^2}{2}\right)=2\left(1+\frac{1.12^2}{2}\right)=3.25
$$

My question is, why would I want to define a modulation index for each tone? What do I get from that?

Another thing that I don't understand is that according to this guy the condition that ensures that there's no overmodulation, regardless of the tone frequencies, is $m_1+m_2\leq1$. Obviously in this case the condition is not met but I'm pretty sure there's no overmodulation with $A=2$.