texts: What does the convolution mean, what is the convolution philosophy

texts:
I would like to know why the convolution is necessary.

that is, who said that multiplying numbers with others and then adding them would tell us something?

If you could give me analogies without mathematics, it would be a great help for non-mathematicians.


texts: Separating signal from noise in similar frequency range

texts: As shown in the figures, both of my signal and noise have the same frequency domain, how can I separate them?


texts: Understanding performance of Lucas Kanade Iterative Image Registration Technique

texts:
I am reading the paper:
Lucas, B. D., & Kanade, T. (1981). An iterative image registration technique with an application to stereo vision.

I am having some trouble understanding section 4.3 regarding performance. It takes into consideration two signals:

1) $F(x) = sin(x)$

2) $G(x) = sin(x + h)$

Then it says that h will converge to |h| < $\pi$. And that it suggests that range of convergence can be improved by suppressing high spatial frequencies in the image.

How was the conclusion regarding suppression of high frequencies obtained?

Edit:

Here is my interpretation. Consider a value/ point on F(x) at x = 60 deg. This will match with the value of F(x) at x = 120 deg as well. So, the difference in x (or h) is less than $pi$. Now, consider the first signal F(x) as it is and the second signal, G(x),  as set of signals that contains high frequencies as well as low frequencies. Superimpose these high frequency signals on the F(x). If F(x) is taken as reference, due to high frequency signals,  a smaller x will provide a match for the value at x = 60 deg. Thus h will be smaller. Is this the right way of thinking?


texts: Can I set a constraint on the first tap of an FIR filter such that its inverse is stable?

texts:
Let's say I have the following FIR filter $h[n]$, so the output $y[n]$ for an input $x[n]$ is
$$
y[n] = \sum_{k=0}^{m-1}x[n-k]h[k]
$$

The inverse of this filter is given by the IIR difference equation

$$
y[n] = \frac{1}{h[0]}\bigg(x[n] - \sum_{k=1}^{m-1}y[n-k]h[k]\bigg)
$$

Is there some constraint I can put on the filter taps such that the inverse is stable?

I know that if I keep the zeros of the FIR filter inside the unit circle, then the poles of the inverse filter will also be inside the unit circle implying stability. However, are there more simple constraints I can make on $h[n]$ to ensure the stability of the inverse? I was thinking something like $h[0] > \sum_{k\neq0} h[k]$, but I can't prove stability of that.


texts: I'm new to Matlab.As a beginner, I want to work on few signals which are used in day today life and extract useful information through it. Can someone please help me from where I could start or share a blog which might help me with this. Thank you.


texts: RF-Chain Signal Delay for Sensor Switching

texts:
Lets have a RF-chain as above with system bandwith from HP corner to the green line say 1 MHz.
The signal accumulates delay as it passes through this analog chain, and due to it being non-liner filter chain, the group delay is likely as shown. Now at the end of LP1 and LP2 we have some form of detectors, which taken in the signal and do some type of functional detection on it. However the most important part of the detection is the critical control of switches s1 and s2 to determine when the signal is actually valid ( coming out of the two LFs ?).
So, the question would be what is a valid signal out of the LPF1 , since the input can not be a fixed single freq. component, otherwise we could just use the phase delay. Here the bandwidth is large upto 1 Mhz.
So essentially we have to determine the optimum read-out freq or some statistical values to find the optimum switching times.
Can you please suggest how can one actually go on  to do it ?
Without any new hardware design . Just lets try signal processing and statistical analysis
Thanks


texts: Implementing a 2d butterworth filter for image processing?

texts:
I am at the moment trying to implement a bandpass butter worth filter which i then can use to apply on my original image. Problem is though My implementation of it using OpenCV doesn't seem to be correct.

I have written some code which is capable of displaying the DFT of an image, and based from that i able see what i want to filter out.

The freq spectrum of the image looks like this

My idea was to implement a butterworth notch  band reject filter, but something seems wrong my implementation, or I am just applying incorrectly.

cv::Mat bandpass(double d0, double n, int wy, int wx, int cx, int cy)
{
    cv::Mat_<cv::Vec2f> pf(wy, wx);
    for(int y = 0; y < wy; ++y) {
        for(int x = 0; x < wx; ++x) {
            // Real part
            for(int i = 0; i < 3 ; i++)
            {
                const double d = std::sqrt( double((x-cx)*(x-cx)) + double((y-cy)*(y-cy)) );
                const double d_k = std::sqrt(pow(x-cx-(cx+100),2.0) + pow(y-cy-(cy+100),2.0));
                const double d_mk = std::sqrt(pow(x-cx+(cx+0),2.0) + pow(y-cy+(cy+0),2.0));
                if(d==0) // Avoid division by zero
                    pf(y,x)[0] = 0;
                else
                    //  pf(y,x)[0] = 1.0 / (1.0 + std::pow(d0/d, 2.0*n));
                    pf(y,x)[0] *= (1.0/(1+pow((d0/d_k),2.0*n)))*(1.0/(1+pow((d0/d_mk),2.0*n)));
                    // Imaginary part
                    pf(y,x)[1] = 0;
            }
        }
    }
    return pf;
}

and i use mulspectrum to apply it. But the output image from an inverse dft is a black image, which in some way tells me that is not the right filter type i am using..


texts: Synchronization and downsampling after matched filtering - GNURadio polyphase clock sync

texts:
I am trying to model a QPSK transmission. For this, I am using the software GnuRadio and more specifically the block polyphase clock sync. This block performs timing synchronization for PAM signals by minimizing the derivative of the filtered signal. I modelised this on Matlab (for BPSK but that is the same problem) and here is a plot of the signal at the reception after matched filtering :

The FIR used here is a Root Raised Cosine. The thing is that the polyphase clock sync will find the minimum derivative of this signal to know where to downsample but this is for me not the right location. Indeed, if we look on the matlab plot of the signal above, the minimum derivative is located between the two first 1 bits samples and not at the locations of these two samples...

For example, here below we try to send the bits 101001. Between the two first 1 bits, there is a maximum that the block will find as the location to sample...
With GnuRadio, I use the simple blocks :

which give me the plot :

We see that this does not sample at the right place and does not return the right bits. Is there a problem in my comprehension of this block or of the way polyphase filters work?

Here are the parameters used on GNU Radio which are not visible on the picture above :

RRC : firdes.root_raised_cosine(gain,L,1,alpha,ntaps)

L = oversampling factor

Constellation : 00 = -1-1j, 01 = -1+1j, 10 = 1-1j, 11 = 1+1j

If I change the value of "Output SPS" (Output Samples per Symbol, to downsample) in the polyphase clock sync and replace it by the oversampling factor L, there is no decimation done and I obviously obtain the good signal which is actually a convolution between my delta of dirac + or -1 and a raised cosine :

This is actually this signal which has to be sampled at the right places to find the good original bits. Nevertheless I have the impression that the real part has become the imaginary part and vice versa : real part should be the bits 110 and imaginary part 001. This is the opposite here and I do not see why.

EDIT following the question of @Marcus Müller : Here is the plot of the signal after the block constellation modulator (which upsamples and applies the RRC FIR filter for the pulse shaping) :

EDIT 2 : Here is the signal obtained by replacing the polyphase clock sync block by a FIR RRC block which shows it works perfectly. The problem is that it does not synchronize the signal :


texts: Physical significance of resolution in image processsing

texts:
What is the physical interpretation/significance of resolution?

Technically, it is the number of pixels used to denote an image but what is it that this resolution tries to convey to us?


texts: Find $X(j\omega)$ after sampling of $2\cos(2000\pi t)+\sin(5000\pi t)$ at 5 kHz sampling rate

texts:
The Fourier transform of the first term has two spikes at -2000pi and 2000pi of magnitudes 2pi for both.

The Fourier transform of the second term has two spikes at 5000pi and -5000pi having magnitudes $-j\pi$ and $j\pi$ respectively.

Since sampling is at 5000Hz, the -2000pi and 2000pi spikes repeat at 3000pi and -3000pi respectively, while the -5000pi and 5000pi spikes repeat at 0.

Now we've got the spectrum in the big-Omega domain. We divide this by 5000Hz to get the spectrum in -pi to pi domain

So the answer I've derived has seven spikes, at -pi, pi, -2/5pi, 2/5pi, -3/5pi, 3/5pi, and 0. However, none of the options have seven spikes. What am I doing wrong?

EDIT - I forgot to scale by $\frac{1}{T}$. But my problem still remains. Only option 1 and 3 have spikes at -pi, pi, -0.4pi and 0.4pi.  But neither of these options have spikes at 3/5pi, -3/5pi, and zero.


texts:
I wish to simulate some sound sources convolved with a Room Impulse Response (RIR) and impinging on a spherical microphone array. I could find a couple of generators online (such as this one), though all of these are concerned with rectangular rooms.

Is there a way to generate such RIR for an arbitrary shape or to access a bigger variety of shapes for the room?
If there are simulators for such RIR, are there online implementations? (I could not find any)
Is there a common method to convert a rectangular RIR to an RIR for a different shaped room?


texts: I tried two approaches and gained the different conclusions of judging the stability of the transfer function of the system

texts:
We want to judge whether the system is stable or not.
Given the below transfer function.
$$ H\left( z  \right) =\frac{\left( 1+2 z^{-1}  \right) }{\left( 2+z^{-1}  \right) }   $$
$$ H\left( z  \right) =2-\frac{3}{2+z^{-1} }   $$
$$  2+\frac{-3}{2+z^{-1} } $$
$$S:=\frac{-3}{2+z^{-1} }$$
$$ S ~~\text{is the sum of each element of the geometric sequence.}  $$
$$ -3 ~~ \leftarrow~~ \text{initial term}  $$
$$ z^{-1} ~~ \leftarrow~~ \text{common ratio}  $$
$$ i \geq1 \rightarrow \text{ith term} = -3 \cdot \left( z^{-1}  \right) ^{i-1}  $$
$$ = -3 \cdot z^{1-i} =-3 \cdot z^{-0}~,~-3z^{-1}~,~-3 z^{-2} ~,~ \cdot\cdot\cdot     $$
$$ H\left( z^{}   \right) =\sum_{ n=-\infty  }^{ \infty  } h\left[ n \right]  z^{-n}   $$
$$ \sum_{ n=-\infty  }^{ \infty  } \left( 2 \delta\left[n  \right]  +\left( -3 \right) u\left[ n  \right]  \right)z^{-n}     $$
$$\displaystyle \therefore ~~ h\left[ n \right] =2 \delta\left[n  \right]  +\left( -3 \right) u\left[ n  \right]  $$
$$  \sum_{ n=-\infty  }^{ \infty  } \left| h\left[ n \right]  \right|    $$
$$ = \sum_{ n=-\infty  }^{ \infty  } \left|  2 \delta\left[n  \right]  +\left( -3 \right) u\left[ n  \right]\right|  = \infty  $$
$$  \therefore ~~ ~~\text{The system is unstable.}~~   $$
However from the another approach,
$$ H\left( z  \right) =2-\frac{3}{2+z^{-1} }   $$
$$ = \frac{2 \left( 2+ z^{-1}  \right) -3}{2+z^{-1} }   $$
$$2+z^{-1}  = 0  $$
$$  2+\frac{1}{z^{} } =0  $$
$$  \frac{1}{z^{} } =-2  $$
$$  z=-\frac{1}{2} =-0.5 ~~ \leftarrow~~ ~~\text{pole}~~   $$
$$  ~~\text{Since }~~ \left| \text{pole}  \right|  =\left| -0.5 \right| =\left| 0.5 \right| <1 ~~\text{is held, the system is stable.}~~  $$
Why the different concolusions were gained?
What I've been missing?


texts: Improving the communication speed on a 10km cable (with high capacitance)

texts:
I'm working on improving the modem communication speed that can be achieved over a 10km cable. The current modem achieves a speed of 9600 bps via hardware (phase locked loop) and I'm looking for ways to at least double this, and do it all in firmware. Here are some specs for the project.

Cable characteristics

Length: 10,000m
Capacitance: 1.48μF (148pF/M)
Resistance: 320 Ω (32 Ω/km)

Driver signal

10 Vpp (+10 V to -10 V) @ 250 mA
Can be used for Amplitude and Frequency modulation
Currently cannot perform phase modulation

Available bandwidth on cable

30 KHz to 100 KHz
Attenuation: 100KHz signal results in a third of the amplitude of the 30KHz signal

Current method of modem communications (want to improve)

A hardware implemented Phase Locked Loop (PLL)
Achieves a speed of 9600 bps

The aim is to improve the 9600 bps speed and also to implement the modem in firmware. The firmware target is an ARM based 32-bit microcontroller - Infineon's XMC4500 with onboard ADC (firmware to be written in C). I have a working prototype, but the best I can achieve so far is 10,500 bps which is only a small improvement over the current system. The method used was to implement FSK demodulation using the Goertzel algorithm. I was detecting 4 frequencies in the range of 40KHz to 80Khz, which gives 2 bits per signalling period. On the microcontroller performance, I've found that 4 frequencies is the maximum number that can be attempted using the Goertzel method. Also the microcontroller ADC's practical maximum sampling rate is 700 KHz.

Does anyone have a suggestion how to achieve a decent speed improvement using frequency and/or amplitude modulation with such limitations as these? I'm new to DSP so I've likely missed some other better techniques that could be used.

Many thanks in advance.

PROGRESS UPDATE (10/10/2013)

Since posting this question and after some simulation and testing, the communications scheme has been changed to be asymmetrical since only the downlink side actually needed to be upgraded. The uplink speed remains as is - a PLL running at 9600 bps, but the downlink speed ends up being a faster ~64,000 bps, with the downlink demodulator hardware running on something equivalent to PC level.

This hardware upgrade enables the use of an FFT and an 8-bit symbol using 8 frequencies. The FFT parameters being used are a sample rate of 512,000 SPS and a number of bins of 64. The frequencies being detected are in the range of 32,000 Hz and upwards, with a spacing of 8,000 Hz. The ADC is 12-bit. I've also implemented Reed-Solomon forward error correction, which may be used to reduce error rates.


texts:
What does the phase discriminator portion of the Costas Receiver do mathematically?

The output of the I-channel is $ \frac{1}{2}A_C \cos \phi \, m(t) $. Which means for small deviation of phase $ \phi $ , $ \frac{1}{2}A_C \cos \phi \, m(t) \approx \frac{1}{2}A_C \, m(t) $. Or it can be said that $  \frac{1}{2}A_C \, m(t) $ would be attenuated by a small amount. However, we have to keep in mind as the text says (as it not might be as innocuous as it seems):

The output of the Q-channel is $ \frac{1}{2}A_C \sin \phi \, m(t) $. Which means for small deviation of phase $ \phi $ , $ \frac{1}{2}A_C \sin \phi \, m(t) \approx \frac{1}{2}A_C \phi \,  m(t) $.
As per the text, the phase discriminator consists of a multiplier followed by a low pass filter.
Which means multiplication of $ \frac{1}{2}A_C \cos \phi \, m(t) $ and
$ \frac{1}{2}A_C \phi \, m(t) $ would yield:

$ g(t)=\frac{1}{2}A_C \cos \phi \, m(t) * \frac{1}{2}A_C \phi \,  m(t) $

$ g(t)= \frac{1}{4}A^2_C \phi \cos \phi \, m^2(t)$

Now, let's say $ m(t) $ is band limited to $ M $. then the term $ m^2(t) $ in the frequency domain would spread across  $ -2M $ to $ +2M $ centered around $ f=0 $ and the term $ \frac{1}{4}A^2_C \phi \cos \phi $ is a constant.
Now, if $ g(t) $ is subjected to a LPF, then the term $ \frac{1}{4}A^2_C \phi \cos \phi \,  m^2(t) $ would be retained as it is(if the cutoff frequency of the LPF is slightly > $ 2M $).
So, what does phase discriminator in Costas receiver do mathematically?

Also, if the phase error is significant (that is we have no idea at all about the probable phase of the carrier), then how does the analysis change? Because this is a possibility that we might have no idea about the phase of the carrier.

Text Used: Communication Systems By Simon Haykin


texts: Audio steganography using phase encoding technique

texts:
I referred the below papers to understand the working of Phase Encoding,but the explanation is not proper.Just a few steps have been given in brief.

ijcsi.org

www.ijarcce.com

Can someone please explain the concept of how Audio Steganography using Phase Encoding works?


texts:
If H(Z) is linear phase FIR filter, then what can 1/H(Z) represent?
  Can it be causal and stable?
  Can it be stable if it is not required to be causal?

I think it represents non linear phase FIR
 filter since linear phase FIR filter have  poles at Z = 0 , but 1/H(z)
 has poles different from zero and that what would introduce non linear
 phase.
Concerning the stability, It is causal and it is stable if all
 poles lie inside the unit circle, it can be stable also and anti
 causal if the unit circle lies is inside the region of convergence .

Is it correct?


texts: Why are there two phases for one dominant frequency?

texts:
I was playing with a set of time history, trying to extract its phases corresponding to the each distinguishable dominant frequency.

Just look at the figures: I got one of the dominant frequency in Fig.1, but in Fig. 2 there are two different phases close to the dominant frequency (f=0.05). Here I am confused; I do not understand why there are two phases near the dominant frequency.

Edit: it seems when I increase the threshold of masking noises, the negative phase disappeared.

Fig. 1

Fig. 2

Appendix: the code I used for phase extraction

    %     figure;plot(f,P1);
%     xlabel 'Frequency (Hz)';xlim([0 2.5])
%     ylabel 'A' %ylabel 'degrees' %
%     grid

    Yb=fft(y);
    ly = length(Yb);
    fb = (0:ly-1)/ly*Fs;

%     X3=Yb;
%     threshold = max(abs(Yb))/2; %tolerance threshold
%     %X3(abs(Yb)<threshold) = 0; %maskout values that are below the threshold
%     phs = unwrap(angle(X3));
%     %phs = (angle(X3));
%     figure;plot(fb,phs*180/pi)
%     %figure;plot(fb,(mod(phs*180/pi,360)))
%     xlabel 'Frequency (Hz)';xlim([0 2.5])
%     ylabel 'Phase (degrees)' %ylabel 'degrees' %
%     grid

    X1=Yb;%store the FFT results in another array
    %detect noise (very small numbers (eps)) and ignore them
    [maxYb, maxin]=max((abs(Yb))/ly);
    threshold = max((abs(Yb)))/2; %tolerance threshold
    X1(abs(Yb)<threshold) = 0; %maskout values that are below the threshold
    phase=atan2(imag(X1),real(X1))*180/pi; %phase information

    %phase(sum(fb<=0.05))% need to adjust manually
    %fb(sum(fb<=0.05))   %need to adjust manually

%     figure;plot(fb,phase); %phase vs frequencies
%     %disp(['at ',num2str(),])
%     xlabel 'Frequency (Hz)';xlim([0 2.5])
%     ylabel 'Phase (degrees)' %ylabel 'degrees' %

    disp(['Amax=',num2str(maxYb)])
    fmax=fb(maxin);disp(['f for Amax=',num2str(fmax)])
    phsmax=phase(maxin);disp(['phs for Amax=',num2str(phsmax)])
    phs=phsmax;

    %inverse fft test
%     X1i=ifft(X1);
%     figure;     plot(t,X1i)
%     hold on;    plot(t, y)


texts: PyAudio recording is taking much longer than planned

texts:
I'm trying to record sounds in chunks using PyAudio for 15 seconds, chunk size being 1024 and sampling rate is 1024 *40. I understand the number of chunks would be (time of recording) * (sampling rate) / (chunk size).

However, when I timed the time it takes for the for loop to finish, it's much longer than 15 seconds, around 2 than 3 times longer than expected. I wonder why? Granted I have a lag in each loop to display the FFT of each chunk, but that's only 0.001 second.

Is this because Windows is not a real time system?

import time
import image
import numpy as np
import os
import pyaudio
import matplotlib.pyplot as plt
from scipy.fftpack import fft

CHUNK = 1024
FORMAT = pyaudio.paInt16
CHANNELS = 1
RATE = 1024*40
RECORD_SECONDS = 15

p = pyaudio.PyAudio()
stream = p.open(format=FORMAT,
                channels=CHANNELS,
                rate=RATE,
                input=True,
                frames_per_buffer=CHUNK)

input('Press key to start recording:\n')
print('2 sec delay started')
time.sleep(2)
print("* recording")

n = CHUNK
k=np.arange(n)
T = n/RATE #reciprocal of freq resolution
frq = k/T #k* freq resolution for plotting
window=np.hanning(n) #apply Hanning window to minimize spectrum leakage
num_frames=int(RATE*RECORD_SECONDS/CHUNK)

for i in range(0, num_frames):
    data = stream.read(CHUNK)
    decoded = np.frombuffer(data, dtype=np.int16)
    #decoded= decoded/2**15
    windowed=window*decoded
    fft_decode=fft(windowed)/(len(decoded)/2)
    mags=np.absolute(fft_decode)

    plt.ylim(top=200)
    plt.xlabel('Freq (Hz)')
    plt.ylabel('|Y(freq)|')
    plt.plot(frq[range(int(n/2))], mags[range(int(n/2))],'b')
    plt.pause(.001)
    plt.gcf().clear()

print("* done recording")
plt.close()


texts: How do I plot the spectrogram of a wav file?

texts:
I am dabbing a little bit into signal processing on MATLAB. And I have the following question that I would like to know the answer to.

What has to be done : Plot the Spectrogram of an audio file.
What I know : Since its an audio file, I use wavread to read it and use the array returned to plot any of the graphs that I would like to. Only recently, I found that wav files store data on multiple channels. All the files that I have, have two channels. I know that the Spectrogram is supposed to give you an idea of the fundamental frequencies present in your audio file.
What I would like to know : What does the Spectrogram exactly do? What do the parameters mean? This is the structure of the Spectrogram function call : S=spectrogram(x,window,noverlap,nfft,fs). What do the window and noverlap parameters mean? How do I set these parameters? Are they input file dependent? After all this, how do I plot the Spectrogram of the audio file since it contains two channels? The function returns an error when I try to pass the two dimensional(since there are two channels) array returned by wavread. It says that I can pass only a row or a column at a time. How do I go about plotting the Spectrogram of my wav file?

Thanks a million, in advance! : )


texts: Are there theories to manage states of signal volatility around a limit

texts:
Assume input signal and discrete output. The signal can cross the limit at 1000 times per second, but it is desired that the discrete output changes at the most once every 15 seconds.  See image below:

$U$ is the Signal, $A$ is the comparator output, $B$ is the filtered output.  The goal is to filter out the output changes in region $R$.

Are there theories to dealing with volatility around the limit such as in region $R$ ?
At this point I am thinking of an algorithm where state is only changed if the signal is persistent for time period $T$, is there a name for such an algorithm?


texts: Can I start testing my NMF with extension on sample that have only one source?

texts: I am testing my supervised NMF algorithm to extract signal from observation that have only one source inside. I am new here and I wonder this is very weak model or not? Is it acceptable in signal processing academic paper to start experimental result with factorization of only one source separation from the environment?


texts:
What is the reason that a periodogram is not a consistent method for obtaining information about frequency response of a system?

To be more precise, why even after increasing number of samples doesn't the variance of the estimator decrease?


texts:
are the low-pass filter and the sharp cut-off filter the same thing??

Here there is the definition of sharp cut-off filter https://en.wikipedia.org/wiki/Filter_(large_eddy_simulation) .

I tried to obtain with matlab the Fourier transform of the low-pass filter, but I noticed that I don't reach the low pass filter. What am I doing wrong?

x=-100:0.1:100
delta=5
G=sin(pi*(x+eps)/delta)./(pi*(x+eps))
H= abs(fft(G))
Tinc=0.01
Fs=1/Tinc;

freq =transpose( -Fs/2:Fs/length(G):Fs/2-(Fs/length(G)));
figure()
plot(x,G)
figure()
plot(freq,H)


texts: Homography valid for patch within the image but not the entire image?

texts:
The homography I have is non-degenerate (det!=0), and generated from a valid planar pose. When I use it to warp the four corners of image, it returns something like the following:
1 0
3 2

instead of something like
0 1
3 2

where 0 represents top-left corner, 1 top right, 2 bottom left, 3 bottom right. It doesn't follow the clock-wise order anymore, and it's twisted.
The weird thing is, if I apply it to a local patch within the image, i.e. where the plane is, the returned result is valid.
How can this happen? Shouldn't it always return a valid quadrangle?


texts: Separate static echos from acoustic signal (ICA?)

texts:
I am using acoustic waves to measure the thickness of material. My problem is that the acoustical lens produces static echos in the signal. I try to separate both because there is a short interference between both.

The frequency of the material echo and the static echo has nearly the same frequency. So spectral subtraction is not a valid method to separate the signals.

I will try the following:
The first measurement is without any object. So I am able to measure the static echo of the acoustic system. The second measurement I collect the signal with the object to measure.

My idea:
So I got two signals from different signal sources. Maybe I can separate both with Independent Component Analysis (ICA).

Do you think that this solution will work? Or is there a better method to separate static and echo signals (with noise) out the measured data.

Thanks for your help.


texts: Matlab: if given nothing but an audio file, how do I modify it to produce incrementally lower signal to noise ratios?

texts:
I have an audio file with a high sampling rate of 250khz. It contains animal noises. I've built a program which counts all the animal noises.

However, I want to find out how robust the program is and find what the minimum signal to noise is for the program to still work.

Hence the plan was to modify my audio file to produce different (incrementally lower) signal to noise ratios.

I would run the program for all of them and since I know how many the program should count, when I start getting lower counts, I will what the minimum signal to noise ratio is.

however I have no idea how to go about doing this. I still don't even know how to find the signal to noise of my audio as it is. my guess was to assume the background noise is similar throughout and hence, copy a section of the audio which has no animal calls, just noise, then use matlabs snr command:

r=snr(audio,backgroundnoise);

can anyone help with how to program this?

It is not enough to just randomly add noise, I need to know the actual signal to noise values in order to be able to quantify the minimum SNR needed for the program to still work


texts: Alamouti Scheme. MISO. STBC for real constellation

texts:
I have a real orthogonal design for codeword...

$$
\begin{bmatrix}
    s1 & s2 \\
    -s2 & s1
\end{bmatrix}
$$

$$
s=\begin{bmatrix}
s1\\
s2
\end{bmatrix}
$$

$$
Y^T=\sqrt{\frac{P}{Mt}} h^T X + n^T
$$

...and receive signal:

$$
Y1=\begin{bmatrix}
y1\\
y2
\end{bmatrix}
$$

So for:

$$
X = \begin{bmatrix}
    x1 & x2 \\
    -x2 & x1
\end{bmatrix}
$$

and
$$
Y = \begin{bmatrix}
    y1 & y2
\end{bmatrix}
$$

...i have:

$$
Y=\sqrt{\frac{P}{Mt}} \cdot \begin{bmatrix}h1 & h2\\ h2 & -h1\end{bmatrix}\cdot \begin{bmatrix}x1 & x2\end{bmatrix}^T+N
$$

...right?


texts: How to mix 8bit/8kHz unsigned linear PCM data in AppsScript?

texts:
I am having the most difficult time mixing simple unsigned 8-bit/8kHz linear PCM audio samples in JavaScript (AppsScript).  I've tried all the basic maths listed here, employing basic number arrays.

Sign, add, clip, unsign.  Subtract 128 from each byte, add them, clip, then add 128.
Produce the Average, each sample just a[x]+b[x]/2
Viktor T. Toth's, maths linked.

Full example is below.  This will ask you to authorize Google Drive to access the audio samples (no it does NOT touch anything of yours):
https://script.google.com/macros/s/AKfycbzMOWV5Z5soG3uinrFc0WcscNXxsDq9elE9rzG0t703vsvDJZMS/exec

As you can see the 3 mixed results are downright horrible.  I've always assumed the unsigned bytes were just offset by 128.  Not the case?  Do I need to fold half the byte to get a true linear representation?  Does a basic number in JavaScript not translate appropriately into signed/unsigned representation?  If that's the case the Java/AppsScript is somehow properly doing it with the two real samples.

Update
Here is some specific code below, and the output of this is in the link above.  Alas, it simply doesn't quite work (byte folding in JavaScript)?

   var vegaArray = DriveApp.getFileById('0B-e9EqGm0pWPQ3RUTXFyUERDVTA').getBlob().getBytes();
   var fdraArray = DriveApp.getFileById('0B-e9EqGm0pWPaUJQUmFRQWctNG8').getBlob().getBytes();

   for(var i=44;i<vegaArray.length;i++)
     vegaArray[i] = Math.round( ( 2 * (vegaArray[i] + fdraArray[i]) )
       - ( vegaArray[i] * fdraArray[i] / 128 )
       - 256
     ); // for
   // vegaArray[] is the mixed output


texts: Is there any audio DSP without biquad constraint?

texts:
I found a codec with audio DSP, ADAU1772. It supports 32 biquads, that is $32\cdot5=160$ parameters.

I need to calculate filter coefficients on-line. The result is in transfer function form, i.e.,

$$[a_1, a_2, \cdots, a_{m-1}, b_0, b_1, \cdots, b_{n-1}]$$

If I want to use an audio DSP, I must transform the result into SOS matrix.

In MATLAB, here is a function tf2sos does the job. It needs to solve high-order equations to find poles and zeros. Maybe it's difficult for MCUs.

Assume number of coefficients $m=n=32$, is there any method I can write all the 64 coefficients directly into a chip and make it work?
Or is there any audio DSP chips without biquad-structure constraint?


texts: What does filtering do to a signal in time domain? Does the signal gets distorted?

texts:
When considering a transceiver system, if we do a certain filtering operation on the signal, will the BER of the system be affected? My point is, since filtering in frequency domain filters a portion of the spectrum, whereas in time domain it is basically a series of MAC operations depending on the number of filter taps. So, eventually my original signal after filtering should have a totally different waveform than the original. Now, if I want to get the original signal back in an ideal channel condition, do we have to do some sort of inverse filtering operations that compensate the operations done in the time domain?

I will be grateful if you could help me in this regard. Thank you in advance!


texts: what is meant by biased and unbiased Autocovariance sequence estimate?

texts:
In nonparametric spectral estimation method what is meant by biased and unbiased Autocovariance sequence estimate and why most commonly biased one is used?
I have the answer to the second question from Peter Stoica (SPECTRAL ANALYSIS OF SIGNALS)but not getting what he wants to say.


texts:
When reconstructing the frequency domain for an FFT, what is the most self-consistent way to do this -- i.e. how is it best to define the bin width, $\Delta f$?

For example, previously I thought it a simple matter of saying,
$$\Delta f = span / N_{points,FFT}$$ where the span is the size of the window you want to look at and $N_{points,FFT}$ is the number of points that should appear in the final FFT result. This makes very clear sense especially when you deal with some FFT spectrum analyzer where you set the span and the number of points in the final FFT (some times called the number of FFT lines) can also be set but tends to have some upper value for that device.

However I have also seen definitions attached to the sampling rate for the incoming transient signal to be FFT'd, as $$\Delta f = f_{sr} / N_{points,FFT}$$ or even as $$\Delta f = 2 f_{sr} / N_{points,FFT}$$ depending on how you define $N_{points,FFT}$. I.e. the number of points that goes into making the FFT or the number of points that will appear in the final FFT result because half the spectrum is thrown away due to mirroring.

Maybe it doesn't matter and it just depends on the way you choose to define things. But if anyone has any insight that would be helpful!

I am adding a little more to clarify my confusion.

Suppose you have some FFT spectrum analyzer that can process at maximum 2048 points in a time transient. That then means The final FFT would have 1024 points -- as we discard the mirror image. I then (again this is all in the context of making an FFT with some FFT spectrum analyzer device) say I want to set my span of this FFT to $50\ \rm{Hz}$. This would give a resultant FFT with a bin width of $\Delta f = 50 / 1024 = 0.049\ \rm{Hz}$. To me this must imply that the sample rate, $f_{sr}$, must vary according to the desired span.

So is this is all question of what your free parameters are, whether the maximum number of points in a transient signal is fixed, or the maximum sample rate you can take, and so on?


texts:
I am currently reading a paper about speech enhancement. The paper uses Spectral Subtraction Method. On that section, The paper stated that ω is the "discrete angular frequency index of the frames"

Question: What is the discrete angular frequency index? Is it part of Short Time Fourier Transform?

  Assume that the noisy speech $\boldsymbol{y[n]}$ can be expressed as $\boldsymbol{y[n] = s[n] + d[n]}$, where $\boldsymbol{s[n]}$ is the clean speech and $\boldsymbol{d[n]}$ is the additive noise. As the enhancement is carried out according to the frame, the above model can be expressed as
  $$y(n,k) = s(n,k) + d(n,k),\quad n=0,1,2,\ldots,(N-1);\quad k=1,2,\ldots,N\tag{1}$$
  Here $n$ is the discrete time index, $k$ is the frame number and $N$ is the length of the frame.
  $$y(\omega,k) = S(\omega,k) + D(\omega,k)\tag{2}$$
  Here $\omega$ is the discrete angular frequency index of the frames.

The paper is:

Navneet Upadhyay and Rahul Kumar Jaiswal: "Single Channel Speech Enhancement: Using Wiener Filtering with Recursive Noise Estimation", Procedia Computer Science, Volume 84, 2016, Pages 22-30, doi:10.1016/j.procs.2016.04.061.


texts: I m assigned a project to create karaoke system on matlab. But im a noob in Audio processing and i don't know to approach this problem. Please help

texts:
Im simulating a karaoke system. I m giving a mono channel audio as input and i should get instrumental component of audio as output(all vocal component should be removed from audio).

i tried two approaches but none of them worked

[y,fs]=wavread('bb.wav');
left=y(:,1);
right=y(:,2);
wavplay(left-right,fs);

2nd

[y, fs] = wavread('Song.wav');
left = y(:,1);
right = y(:,2);
fftL = fft(left);
fftR = fft(right);

for i = 1:683550 %in my example 683550
dif = fftL(i,1) / fftR(i,1);
dif = abs(dif);
if (dif > 0.7 & dif < 1.5)
fftL(i,1) = 0;
fftR(i,1) = 0;
 end;
end;

leftOut = ifft(fftL);
rightOut = ifft(fftR);
yOut(:,1) = leftOut;
yOut(:,2) = rightOut;

wavwrite(yOut, fs, 'tmp.wav');


texts: Complex Morlet Wavelet piano sound analysis

texts:
my  project is monophonic music transcription I am using complex Morlet wavelet but over the 1000 Hz complex Morlet does not give all results right, my code is like that ;

fc=centfrq('cmor5-5'); % center frequency
fa=1047; % 5 Octave c note
scale=(fc*fs)./(fa);
coef=cwt(data,scale,'cmor5-5');
p=abs((coef).^2);

Does anyone give me information about complex Morlet wavelet ?


texts: Lpcm encoded data kept on an analog source

texts: Let us say i have some digital data placed in a wav file by lpcm method. At a sampling rate of 44.1khz i can place 5.5kb of data per second of audio by choosing two amplitudes (quantas) for each sample: 0 and 255. I can now save this audio file on an analog media and can retrieve the original digital data easily later. My question is this: What is the maximum number of quanta I could have used instead of 2 in the beginning so as to guarantee the integrity of my digital data on an analog media?


texts:
I'm trying to implement an FFT to understand how it works.
I'm using a random sound file (so i can't control the size of the signal), with a sampling frequency of 44,1Khz.
I'm using this library

  https://www.nayuki.io/res/free-small-fft-in-multiple-languages/Fft.java

The objective is to apply this formula to get the frequency:
F = n * Fs/N

With n number of bins.
Fs sampling frequency, and N size of the FFT

1)An Fft is supposed to have a length, most of them use a power of 2 radix. But how can i know the length of the FFT if i apply it to an entire array of data ? is it the size of that array ?

2)I don't understand the bins, how is it processed ? i know that FFT works with chunks of data, but if i give a full array of data, how are the bins "created".


texts: how to break the input signal into segments while calculating DFT

texts:
Possible Duplicate:
  breaking the input signal into segments while calculating DFT

Im reading a book about DSP and there is an example about investigating the sound that travel through the ocean. The sound was recorded as the time-domain signal and they tried to analyze it in frequency domain.

The input signal was broke up into 256 point segments. Each of these segments is multiplied by the Hamming window, then run through a 256 point DFT. The resulting frequency spectra are then averaged to form a single 129 point frequency spectrum. Please take a look at the figure

Could you please help me to clarify these questions or show me materials with which I can read to understand (I'm a student and brandnew to DSP):

How they break up the input signal into 256 segments?

How each segment was multiplied with the Hamming window?

How they calculate 256 DFT points?

How the frequency spectra was averaged?


texts: Can Aliasing Happen in Laplacian Pyramids?

texts:
I want to use the Laplacian pyramid framework for representing images. The The Laplacian Pyramid as a Compact Image Code's language seems to provide freedom in the choice of blurring/interpolation kernel, subject to certain constraints. However, as we are performing subsampling when constructing pyramids, would aliasing be a problem with an injudicious choice?

I read in the Toronto lecture notes on image pyramids(Slide 8) that a laplacian pyramid can reconstruct an image exactly, agnostic of the kernel. Can i take this to be a guarantee against aliasing, or can aliasing be "hidden" by the reconstruction process?


texts: If a digital LTI filter has phase response on the form $arg[H(e^{jw})] = -\alpha\omega$, what could one say about it's causality (and consequently, the causality of it's impulse response)? Also is Linear Phase a characteristic of only Causal FIR Symmetric Systems?


texts:
I had calculated 13 MFCCs coefficients of a speech signal and i got output in the form numerical vectors please see below figure.
My confusion whether it is in time domain or frequency domain.
suppose if i need to plot a graph of MFCCs, what should be in x axis and y axis?


texts: Calculating a delayed response of a system

texts:
Suppose I have a system:

$$y[n] = x[n] + x[n-1] + x[0]$$

To see if this system is time-variant, we can compare $H\{x[n-1]\}$ to $y[n-1]$ and check that they are different.

I think the delayed (by 1 unit) response to $x[n]$ is:

$$y[n-1] = x[n-1] + x[n-2] + x[-1]$$

Nevertheless, I'm having an issue understanding why. How does the $x[0]$ term (from $y[n]$) become $x[-1]$ while calculating $y[n-1]$?

Mathematically, to calculate $y[n-1]$, I thought it would be reasonable to replace $n$ by $(n-1)$ in the equation, which would result in $y[n-1] = x[n-1] + x[n-2] + x[0]$. I mean, if $y[n]$ response contains a constant tern $x[0]$, I expect this value to remain in $y[n]$ independent of the $n$ index.
Why that's not the case ?

I also have a problem with a different system:
$$y[n] = x[2n]$$

I don't understand why this system presents a delayed response:
$$y[n-1] = x[2n - 1]$$

(instead of $y[n-1]=x[2n-2]$) and why its response to the shifted (by 1 unit) input is $H\{x[2n - 2]\}$ instead of $H\{x[2n -1]\}$.

Looks like I have doubts about how to calculate the delayed response. Can you point out to problems in my examples to help clarify it?


texts: How to train and test deep neural network using MFCC features?

texts:
I am working on Voice Disorder Detection problem. I have extracted 13 MFCC features, 13 delta and 13 delta-delta features from each audio file (2 to 4 secs). I extracted these features for each frame (consisting of 23 ms). So for example an audio divided into 75 frames has 75 examples in my dataset i.e each frame act as individual example in the dataset.

I trained Deep Neural Network on this dataset (70% of dataset) and evaluated my model on the rest 30% of the dataset giving me accuracy of 96% and 84% respectively.

But the problem is, while testing my model on a single unseen audio data when I calculate MFCCs frame by frame and feed every frame to the model, the model prediction for every frame is not the same. So my question is:

What should I do so that my model will give consistent prediction for all frames belonging to the same audio file?

I tried taking the majority of the class predicted by my model for that audio but that too gave me incorrect result.

One thing that I think I might have done wrong is that I haven't used every frame belonging to a particular audio file for training and so some of them are in test dataset. Is that a problem or am I missing something important here?


texts: By using array antenna and a MUSIC algorithm, how many targets could be detected?

texts: By using an array antenna which has N receivers, How many targets could be detected and classified when we use the MUSIC(MUltiple SIgnal Classification) algorithm?


texts: Estimates sub-pixel shift directly in phase region

texts:
I try to estimates shift estimation directly in phase region, by following the proposed method in this Sub-pixel Shift Estimation of Image based on
the Least Squares Approximation in Phase Region by Fujimoto, Fujisawa and Ikehara (Proceedings of 26th European Signal Processing Conference, EUSIPCO '16, pp. 91–95. IEEE, 2016 PDF). Here is the flow chart described in the paper

If you're still with me, my issue raised when the author try to proceed with the subtraction of the integer shift with the phase difference $θ(k1,k2)$ (Equation (14) to smooth the phase difference. The authors however did mention that they obtained the slope $(a′,b′)$ of the integer shift using conventional phase-only correlation(POC) (Section III, paragraph above Equation (14)).

How can this step can be done? Since the phase difference is of a $60\times60$ matrix (assume the image dimension is so), while the integer shift consists only TWO values. How exactly were the slopes obtained?

Full matlab code I implemented:

function [ output_args ] = phasecorrlsa( refIm, shifIm )

F=(fft2(double(refIm)));
G=(fft2(double(shifIm)));
[m, n]=size(refIm);
[M,N] = meshgrid(1:m,1:n);
X = [M(:), N(:)];
R=(F.*conj(G))./abs(F.*conj(G));
r=(ifft2(R));
[ap, bp, rhat]=lsa(angle(r));   %this is my slope a' and b'
[~,w] = max(r(:));
[del_hat2p, del_hat1p] = ind2sub(size(r),w);
del_hat2p=del_hat2p-1;
del_hat1p=del_hat1p-1;
theta=angle(F)-angle(G);
R=exp(1j*theta); %E6
theta=atan2(imag(R),real(R)); %E9
[a, b, thetahat]=lsa(theta);
del_hat1_ts=(m/(2*pi))*a
del_hat2_ts=(n/(2*pi))*b
thetapp=theta-rhat;   %equation 14, I guess something amiss here
%figure;
%surf(theta);
%figure;
%surf(thetapp);
[app, bpp, thetapphat]=lsa(thetapp);
del_hat1=(m/(2*pi))*app+del_hat1p;
del_hat2=(n/(2*pi))*bpp+del_hat2p;
if del_hat1>n/2, del_hat1=del_hat1p-m; end
if del_hat2>m/2, del_hat2=del_hat1p-n; end
output_args=struct('a',del_hat1, 'b', del_hat2);

end

function [ a, b, hat ] = lsa( theta )

[m, n]=size(theta);
[M,N] = meshgrid(1:m,1:n);
X = [M(:), N(:)];
B=regress(theta(:), X);
a=B(1);
b=B(2);
hat=reshape(X*B,m,n);

end

Please lighten me on this issue. Thank you so much!


texts: Vector parameters in uncountably infinite-dimensional spaces

texts:
My question was, in an uncountably infinite-dimensional vector spaces, how to represent a vector by a list of parameters, as we do in finite-dimensional spaces? I was assuming that if we can not express a vector as a list of discrete parameters, we have a big issue...but during the writting up of this question, it seems that there is no big issue, the parameters just change to a function and the sum changes to integration.

But I am not sure if my reasoning below is correct, so I still post it below, please correct me if there are something wrong:

In a finite-dimensional vector space $\Omega$, each vector (or point) $\mathbf{v}$ is represented as a list of numbers $c_i, i\in\mathbb{N}$, which can be seens as the parameters or coefficients of the vector, in the sense that the vector is the sum of the products of the parameters with the respective base $e_i$:

$$\mathbf{v}=\sum_{i=1}^{n} c_i e_i$$

When $e_i=x^i$, then $\Omega$ is a finite-dimensional polynomial function space.

Now, if the dimension is not finite, it seems there are two possibilities:

countably infinite dimensional
uncountably infinite dimensional, e.g. $e_i=x^i, i\in \mathbb{R}$

For the first case, the vector $\mathbf{v}$ in the polynomial function space can be expressed similarly:

$$\mathbf{v}=\sum_{i=1}^{\infty} c_i e_i$$
and $\mathbf{v}$ can also be represented by its parameters, i.e., a list of infinite members, as $c_i, i\in\mathbb{N}$.

But for the 2nd case, it seems it's not possible to represent $\mathbf{v}$ by a list of discrete parameters any more...the parameters is itself a continuous function $c:\mathbb{R}\rightarrow\mathbb{R}$. In this case, the vector $\mathbf{v}$ should be expressed as an integration in terms of its parameters and related base:

$$\mathbf{v}=\int_{-\infty}^{\infty} c(x) e(x)\mathrm{d}x$$

My question was from Fourier transform. Now with the understanding above, I have the following: loosely speaking, all functions (who's Fourier Fransform exist) form an uncountably-infinite-dimensional vector space, with uncountably-infinite number of basis $e^{j\omega t}, \omega\in\mathbb{R}$. Each function's parameter in this space is a function $X(\omega)$, which is defined by the Fourier Transform formula:

$$X(\omega)=\int_{-\infty}^{\infty} f(t) e^{-j\omega t}\mathrm{d}t$$
The inverse fourier transform formular is just the way to express the vector $f(t)$ in terms of its parameters and related base:

$$f(t)=\frac{1}{2\pi}\int_{-\infty}^{\infty} X(\omega) e^{j\omega t}\mathrm{d}\omega$$


texts: Get spectrum from autocorrelation function using fft()

texts:
I would like to observe Fourier Spectrum, got through Autocorrelation function. This is my code:

    clear;clc;

%% generate x-axe
first_step=0;
step_t=0.01;
last_step=1;
t=first_step:step_t:last_step;

%% signal and fourier transform
y=  2*sin(2*pi*60*t) ;
figure(1)
plot(t,y);title('signal')
fourier=fft(y );
N_=length(fourier);
f_ = (1 / step_t)  *   (   0:    (N_/2)   )    /    N_;
a=(fourier.*conj(fourier))/(N_*N_);  % Spectral Density get half
a = a(1:N_ /2+1);
a(2:end-1) = 4*a(2:end-1);
figure(2);
plot(f_,a);title('Spectrum Power through signal');

%% through AutoCorrelation function
tau=0.01;
y1=  2*sin(2*pi*60*(t+tau)) ;
Y=y1.*y;
AutoCorr_func = cumtrapz(Y,t);

figure(3);
plot(t,AutoCorr_func); title('AutoCorrelation function');
fourier=fft(AutoCorr_func);
N_=length(fourier);
f_ = (1 / step_t)  *   (   0:    (N_/2)   )    /    N_;
a=fourier.*conj(fourier) ; % Spectral Density
a = a(1:N_ /2+1);          % spectrum is even, so get half
a(2:end-1) =  a(2:end-1);  % multiply by 4, since spectrum is square of amplitude, and we have two even halves

figure(4)
plot(f_ ,a );
title('Spectrum through AutoCorrelation funciton');

and I get this

so a few questions:

1) why I get so strang ACF? It has to be periodic, since y and y1 are strongly periodic. Is sonething wrong with it? maybe here

Y=y1.*y;
AutoCorr_func = cumtrapz(Y,t);

but Acf is an integral and I am trying to get an array numerically.

2) My tries to get power density through Acf are the same as in the simple case, without using Acf, but Figure 2 gives correct resultL frequency = 42 and power is square of amplitude, in my case it should be 4, but I have around 2. What is the problem...?

3) How to get correct power density through Acf, what am I doing wrong?

Any help would be greatly appreciate! Thank you in advance!


texts: Plotting a histogram of particle intensity vs pixel

texts:
I am trying to reproduce a figure, shown below, of a particle intensity binned by the pixel number then fit the distribution to a Gaussian. I have a similarly magnified intensity image of my particle, with 8-bit depth, loaded into MATLAB.

I am having difficulty understanding how the bottom figure seems to retain spatial information after binning. The goal is to fit the distribution to a Gaussian.


texts: What are the values on the x-axis when I plot the impulse response of a lowpass filter?

texts:
I am trying to develop a filtering routine, using Java, and I am using the windowing method.

From my studies, I was told that if I make a plot of the impulse response of an ideal lowpass filter, I would get a SINC graph. In this situation, what am I plotting against (i.e., what values are on the X-Axis?)?


texts: Does the frequency response assume the zero input response to be 0?

texts: I'm a bit confused about the frequency response and the state of a system. Is it simply the ratio of the output of the zero state response to the input of the zero state response? Or does it include the zero input response? Any clarifications would be greatly welcomed.


texts:
I am trying to implement the moving RMS by Matlab.
x = randn(50, 1);
xRMS = sqrt(movmean(x.^2, 21));
xRMSref = envelope(x, 21, 'rms');
plot(xRMSref,'DisplayName','xRMSref');hold on;plot(xRMS,'DisplayName','xRMS');hold off;
legend()

Why my estimation differs from Matlab's?


texts:
In this paper or multirate filtering, the author establishes the following mathematical relationship. Let $y_D$ be the output of a downsampler such that

$$y_D[n] = x[Mn]$$

where $M$ is the downsampling factor. In other words, we keep every $M$-th sample of the original signal. The author then goes on to state the following:

  ...the z-transform of $y_D[n]$ is given by

  $$Y_D[z]=\frac{1}{M}\sum_{k=0}^{M-1}X[z^{1/M}W^k]$$

  where $W^k$ is the $M$-point Discrete Fourier Transform kernel, namely
  $e^{(-j2\pi k)/M}$.

How can we go from the former expression to the latter? What is the relationship between DFT and the Z-transform that allows for such transition?


texts:
I wanted to simulate OFDM system in MATLAB. I'm using Fixed WiMAX OFDM parameters in my simulation, where the number of data sub-carriers are 192, number of Pilot sub-carriers are 8, number Null sub-carriers are 56.
Null tones can be obtained in MATLAB by generating zero matrix with the required rows and columns.

% Null subcarrier:
msg(1,1:100)=0;

similarly, for data subcarriers, digitally modulated data is sent.

% Data subcarrier:
msg(2,1:100)= 1*sign(randn(1,100)) + i*sign(randn(1,100));

my question is, what type of data could I send for Pilot tones?? all books and literature I have read says that: Pilot tones are just known data.
What type of Known data are the Pilot tones? What kind of data should I send in my specific problem? Please, clarify.


texts: Filter odd or even harmonics with notch or inverse notch filter

texts:
Hi i had the following question.
I have a signal containing a 200Hz sine wave and it's odd and even harmonics (no other frequencys or disturbing signals are contained).
What i'm looking for is a kind of filter which is able to seperate the odd harmonics from the even ones.
The end goal is to be able to determine the amplitude and phase of each single of the odd harmonics as accurate as possible.
I know that you normally would use an FFT for this purpose but i'm trying to figure out if this wouldn't also be possible with a filter instead.
So i thought about two options:

Use a parallel circuit of notch filters (one for each harmonic to be filtered) to cut out the even harmonics i don't want to use and seperate the odd harmonics from eachother.

Do exactly the opposite and use "inverse notch filters" to filter out the odd harmonics i want to use and seperate them from eachother by using a parallel circuit of "inverse notch filters" (one for each harmonic i want to filter out and take amplitude and phase from).

I've added a little sketch as png to make things clearer.

The problem is that it's very difficult to find understandable information about notch filter or inverse notch filter. (Inverse notch filter is not the same as a peak filter)
For notch filters i only find spurious and short information like these:
https://zone.ni.com/reference/en-XX/help/371325F-01/lvdfdtconcepts/notch_peak_filters/
https://www.onesdr.com/2019/11/21/fm-notch-filters-why-you-need-one-with-most-sdrs/
https://www.youtube.com/watch?v=tpAA5eUb6eo
And the only source of information i found about inverse notch-filter was this paper i mentioned (on top of the second page of the paper):
https://www.scirp.org/pdf/_2013060615443504.pdf
The problem is i would need way more information about both filter types and how derive them from simpler filter types and calculate their transfer function and Z-transform.
So my question is (if i'm not completely on the wood path) which of the both approaches described you would prefer and can you give me some good sources of clear and understandable information about the two mentioned filter types and thier implementation in hardware ?
Our would you recommend me a completely different filter type for this task ?
Greetings


texts: The error between the theoretical value and the simulation value of imaginary part of the FFT results

texts: As we know, a complex analytic signal can be obtained through Fourier transformation of a real value function, and the imaginary part can be reconstructed by Hilbert transform of real part. But I have simulated a real value function using Matlab and performance FFT on it, the imaginary part obtained through FFT is very different from that obtained through Hilbert transformation of real part, Does anyone know why.


texts:
In theory I have 3 axis: time, frequency and amplitude (which is scaled in by $20\log$). I have an audio signal. I noticed that I have very high amplitudes in the range of $1$-$1000$ $\mathrm{Hz}$. So I made 3 frequency bands: $y_{low}$, $y_{medium}$ and $y_{high}$, where $y$ refers to the signal and the subindex to the frequency band.

Now I defined a frequency vector for my bands:

LOW = 1:200
MEDIUM = 201:600
HIGH = 601:1000

Afterwards I wanted to know the values of my bin, depending on the frequency band. Basically y_LOW/4096   --> (fft points). Now I did an arithmetic mean with the values of my bins, which is saved in a single variable.
Before that happens, I am doing a STFT. So, a spectrum is shown every $50 \ \mathrm{ms}$. I want to plot my 3 values (since I have 3 frequency bands) every $50 \ \mathrm{ms}$. The values should be shown as a point or something similar.

If the code is required, I can post it.


texts:
How do we apply windowing of 50% (4 samples) to a discrete signal with the odd number of values as 1234567?
Is it done as: 1234 3456 567(0)
or 1234 3456 67(0)(0)?


texts:
I am new in dsp.. so please bear with me.

I want to plot FFT of a triangular wave. I am using the code below to first generate the triangular wave and then take its FFT

Fs=50e6;
Ts=1/Fs;
NFFT=2^14;
Runtime=(NFFT-1)*Ts;
t=0:Ts:Runtime;

fin=5*1e6;

factor=Fs/NFFT;
bin=round(fin/factor);
fin=bin*factor;

fin_MHz=fin/1e6;

y_in=sawtooth(2*pi*fin*t,0.5);

% Calculate Spectrum
Y = fft(y_in,NFFT)/NFFT;
f = (Fs/1e6)*linspace(0,1,NFFT);

Ydb = 20*log10(abs(Y(1:NFFT))) + 6.02;

% % Plot amplitude spectrum.

plot(f,Ydb)
hold on
grid on
ylim([-150 5])
xlim([-5 55])
xlabel('Frequency (MHz)')
ylabel('dB')
set(gca,'YTick',-150:25:0)
refline(0,-78)

The response when input is 5 MHz is as follows :

The response when input is 5.5 MHz is as follows :

My questions are :

Do i have any mistakes in my code ?
The response should have been sinc^2 .. i dont see it
Why the difference between two plots.. i mean more spurs when ip is 5.5 mhz
The amp peak should be in 1 in fft .. it -1.825 dbfs .. ? why ?

Thankyou so much.


texts: How can I accurately represent an mp3's wave form in respects to time?

texts:
I'm trying to programmatically plot a sound wave that I have placed in a 2d array, however, I cannot consistently get the sound wave to reach the end of the window. For example, when you load a sound in audacity, you get this:

In contrast, when I load a sound into my program I will often get something like this (red is the play head that moves at speed of one blue tick mark every second. The Green line is the end of the song in seconds):

As you can see, I can plot the complete wave form, but it does not sync up with the end of the song. Oddly enough, there are times during this song that the wave form is an accurate representation of what's being played. There are also a handful of songs that do not seem to have this issue (but more than a handful of others that do have this issue).

This is how I'm drawing the wave form:

    float drawStep = songLengthInSeconds / numberOfSamples;
    for(int i = 0; i < waveForm.length ; i++){
      for(int j =0 ; j < waveForm.length - 1; j++){
         renderer.line(x, waveForm[i][j], x + drawStep, waveForm[i][j+1]);

         x+= drawStep;
}

}

The renderer.line method signature is

renderer.line(beginningX, beginningY, endingX, endingY);

And I get the number of samples by just adding all of the waveForm[x].length together.

Finally, the top and bottom wave forms in the picture below are being drawn differently which is why they don't match. The bottom wave form is the one that is represented by the code above.

I've been fighting with this for a couple weeks now and would be very grateful if anyone has any suggestions that would push me in the right direction.


texts: Inverse Fourier Transform From Plots (2019 edition)

texts:
Hello I borrowed the title for another post.

I cannot figure out how to find the inverse fourier transform from this spectrum.

I know what the transform is

I'm sorry for the plot being hard to read, it is how we were given it and I understand the frustration. The magnitude plot goes from -w0 to w0 with a amplitude 1. The phase plot has the same interval but alternates from pi/2 to -pi/2. Apologies for formatting I am new and on mobile.
Can someone help me I am totally lost.


texts: Are there other filter models besides IIR and FIR for processing digital signals?

texts:
I am very familiar with IIR and FIR filters for processing digital signals (audio is my main interest). I am keen to know if there are alternative filters based on different mathematical models to IIR and FIR?

I have a degree in maths but learning about DSP is just a hobby (I didn't study it at university) so I haven't a clue whether this is a stupid question or not :-)


texts:
I would like to compute the product of two images. I tried with the code below. But the result is not like I expected. Can you tell me where is the problem in my code?

https://ibb.co/Njc8w3b

for (int i = 0; i < ImageWidth; i++)
{
    for (int j = 0; j < ImageHeight; j++)
    {
        PixelValueFirstImage = Giris1.GetPixel(i, j);
        PixelValueSecondImage = Giris2.GetPixel(i, j);
        Greyscale1 = Convert.ToInt16(PixelValueFirstImage.R * 0.3 + PixelValueFirstImage.G * 0.58 + PixelValueFirstImage.B * 0.12); //Converting RGB to grayscale
        Greyscale1 = Convert.ToDouble((Greyscale1 - 0) / (255 - 0)); // scaling between 0-1
        Greyscale = Convert.ToInt16(PixelValueSecondImage.R * 0.3 + PixelValueSecondImage.G * 0.58 + PixelValueSecondImageB * 0.12); //Converting RGB to grayscale
        Greyscale = Convert.ToDouble((Greyscale - 0) / (255 - 0)); // scaling between 0-1
        product = Greyscale * Greyscale1; // result of product
        product =(255*product)  ; //scaling between 0-255
        OutputImage.SetPixel(i, j, Color.FromArgb((int)product, (int)cproduct, (int)product);
    }
}

```


texts: Signals in real world?especially natural signals?

texts:
Do all the signals in real world ,that are of interest in engineering(for measurements or processing)are only continous/analog or there any other alternatives also?
For example birds make voice,animals make voices are examples of continous signals

Few natural discrete signals in my opinion
Number of teeth and number of bones in human
Number of mountains in a range,height of a mountain/hill
Please kindly give me other examples from natural world

Please kindly guide me if i am wrong in my understanding of continuous and discrete signals


texts: How to Calculate the Local Gradient of an Image in MATLAB

texts:
I know that the gradient function is supported by MATLAB, but the local gradient is not, so how do you calculate it?

  Local gradient is another texture descriptor, which is defined as:

  $$I_g=\sum_{z=-r}^{r} | \nabla I(x+\tau) |^2 $$


texts: Visualise/compare numpy arrays from Matlab/Octave to matplotlib

texts:
I'm new to python and matplotlib, and I'd like to visualise / compare 3 mfcc files stored as numpy arrays in txt format.
I have the Octave code below, and I'd like to know how it can be done using python/matplotlib.
Any help is much appreciated.
load /dir/k11.txt
load /dir/t11.txt
load /dir/a11.txt

subplot(1,2,1);imagesc(j11);axis('xy');colormap(jet);colorbar;subplot(1,2,2);imagesc(t11);axis('xy');colormap(jet);colorbar;

c=[k11(:,end),k11(:,1:end-1)];
figure(1);
Ncep=size(c,2)-1;
a=real(fft([c,zeros(size(c,1),512-Ncep*2-1),c(:,end:-1:2)]'));
imagesc(a(1:end/2,:));
axis('xy');
colormap(jet);

c=t11;
figure(2);
Ncep=size(c,2)-1;
a=real(fft([c,zeros(size(c,1),512-Ncep*2-1),c(:,end:-1:2)]'));
imagesc(a(1:end/2,:));
axis('xy');
colormap(jet);

c=a11;
figure(3);
Ncep=size(c,2)-1;
a=real(fft([c,zeros(size(c,1),512-Ncep*2-1),c(:,end:-1:2)]'));
imagesc(a(1:end/2,:));
axis('xy');
colormap(jet);
```


texts: Why do we need 2N-FFT at the receiver when we want to demodulate ZP-OFDM signal ?


texts:
I need to compensate a OFDM-16_qam constelation rotation but I could not find out how to implement it with MATLAB
I have a Matrix [48 x 25] where each colum is a OFDMsymbol without CP , pad and pilots, this matrix was passed through a Multipath channel using the matlab command Ch=rayleigh and filter(CH,OFDMsymbol) and so the pilots modulated in bpsk .
With this pilots I've constructed a Pilot_matriz with each colum (an OFDM symboll) has an angle to be compensate.
The OFDMsymboll  is a complex number as  +/-a+/-ib and I have the angles (theta) in rad from the pilot matrix but I'm not find a way to turn bach the theta angle from the complex number +/-a+/-ib.
any suggestions
Regards
Luiz


texts: What is DC level in white gaussian noise?

texts: Am studying unbiased estimators and keep seeing this term "DC Level". What is the expansion of DC and what is a DC Level? Even the Wikipedia page on WGN says nothing about it.


texts: How to filter my noisy square wave so that i can recover my signal using the Chebyshev Filter

texts:
I have a noisy square signal as input but it has a lot of noise.
I should use a Bandpass filter to recover my signal.
I know that the Chebyshev Filter is a bandpass filter; but it doesn't work. the data is still noisy after filtering.

Chebyshev Filter:
The Chebyshev filter  gives a sharper cutoff than a Butterworth filter in the pass band. A disadvantage of the Chebyshev filter is the exterior of gain minima and maxima below the cutoff frequency. Due to the ripples in the pass-band, it is not used in the audio systems. Though it is far better in some applications where there is only one frequency available in the pass band, but numerous other frequencies are required to eliminate.

 % I use A picoscope2000 serie for data acquisition. (MATLAB)
 ps2000_getdata;

 % The data is saved a cha_a (MATLAB)
 cha_a = (bufferChA/1000);

 % Here i use the Chebyshev bandpass filter to filter the noisy data(MATLAB)
 [A,B,C,D] = cheby2(10,40,[900 1100]/1500);
 d = designfilt('bandpassiir','FilterOrder',20, ...
'StopbandFrequency1',900,'StopbandFrequency2',1100, ...
'StopbandAttenuation',40,'SampleRate',8000);

  y= filter(d,cha_a); % convolution

  sos = ss2sos(A,B,C,D);
  fvt = fvtool(d,y,'Fs',8000);
  legend(fvt,'cheby2','designfilt')

This is the result of the magnitude response :

And this is the impulse response :

My input data is suppose to be a squared data.
And when you look at the impulse response of the output, it does not look like the impulse response of a square signal. There is stil noise. How can i adjust my filter ? Or did i used the filter well ?


texts: I have a speech file that was recorded with a sampling frequency of 8kHz. I read the file in Matlab as [x,fs,nbits]=wavread('speech.wav). Now I play the file in Matlab using soundsc(x,fs). But if I use the command soundsc(x,fs/2) and soundsc(x,2*fs) the speech changes. What is the reason?


texts: Why can convolution only be applied to compute the output of a linear filter?

texts: We apparently cannot compute the output of a bilateral filter (BF) using convolution (with the image) because the BF is a non-linear filter. In general, why can convolution only be applied to compute the output of a linear filter?


texts: Created Matlab echo signal: Is it an actual "echo?" Or am I just manipulating the signal to make it seem like an echo?

texts:
This is just an outline of what I did (assume that all my dimensions fit):

    (code that imports audio to read audio as function x)
    X=fft(x);
    (code to define time t and frequency f)

    H=L+M*exp(-1i*2*pi*f*N)+O*exp(-1i*2*pi*f*P);
    % This is where it gets tricky
    % In the frequency domain I have the function above where f is the frequency
    % variable and L M N O P are arbitrary values

    Y=X.*H;
    % again assume dimensions fit

    y=real(ifftshift(ifft(Y)*length(t)));
    %Taking the inverse fft and fftshift was the only way I could get back a signal
    % Once again assume the dimensions fit

Here L M N O P = [.9 .75 1.0 .5 .5]

Is this legit? or am I just pulling my own leg?
Is it an actual "echo?" Or am I just manipulating the signal to make it seem like an echo?


texts:
The scipy signal coherence function computes for two time series the coherence as a function of the frequency. For rotating systems however, it is sometimes meaningful to analyze the two recorded signal measurements as order spectra. For an intuitive difference between lines of constant frequency and constant order, I use Figure 2 from Order analysis in ArtemiS Suite - Head acoustics.

What is the most suitable adaptation of the scipy signal coherence in order to get the coherence as a function of the order, instead of the frequency?


texts: Averaging magnitude squared coherence across multiple time series

texts:
In a previous post, A. Donda had suggested that, in order to calculate the average magnitude squared coherence of more than one pair of time series (e.g. y1 and x1, and y2 and x2), one ought to follow the following steps:

sx1 = pwelch(x1, w, o, n);
sy1 = pwelch(y1, w, o, n);

sxy1 = cpsd(x1, y1, w, o, n);

sx2 = pwelch(x2, w, o, n);
sy2 = pwelch(y2, w, o, n);

sxy2 = cpsd(x2, y2, w, o, n);

sxa = (sx1 + sx2) / 2;
sya = (sy1 + sy2) / 2;

sxya = (sxy1 + sxy2) / 2; % NOTE THIS LINE %
ca = abs(sxya) .^ 2 ./ sxa ./ sya;

...where w,o,n are the window parameters, and the other variables should (hopefully) be self-explanatory.

Let me illustrate why this method can be problematic with an example, in the hope that someone might be able to help me with a solution.

Imagine two pairs of signals y1, x1, and y2,x2. All four signals contain the same frequency component (e.g. a 440Hz sine wave). In one pair, the sines waves are in phase w.r.t. each other. In the other pair, the sine waves are in inverse polarity.

Separate MSCs of both of these pairs of signals will yield approx. '1' at 440Hz in both results, identically, telling us that 440Hz is common to both signals in both pairs (i.e. the relative phase of each of the signals within a pair is ignored). If we now wish to calculate the average MSC, we must first compute the average PSDs and then the average CPSDs. Ideally, this average MSC for the two pairs would also yield a '1' at 440Hz. BUT the CPSD output is complex, so averaging the two CPSDs of the two pairs of signals according to the method above will result in cancellation, because the averaging is taken BEFORE the magnitude of the CPSDs is calculated.

I have offered one solution below - is this correct?


texts: Which is faster: image segmentation or line detection?

texts:
Some papers use image segmentation techniques and others use edge detection. I need to know which one is faster.

update:

I need to do semantic segmentation for outdoor sense and the data is optical image and LiDAR. Other researchers use segmentation before doing feature detection but I expect that if I use line/edge detection, the technique will detect image features faster.

Before I start doing experiments I want to know which one is better because this will effect on next step, i.e. feature detect.

This application should work in real-time and I plan to use GPU for faster processing, such as CUDA.


texts: Why does a longer observation time improve DFT resolution, but repeating a signal does not?

texts:
As was proven here: https://math.stackexchange.com/questions/228614/why-doesnt-repeating-a-signal-give-rise-to-a-finer-resolution-of-dft-fft repeating a certain sequence does not improve DFT frequency resolution.
However, it is known that oberserving a signal for a longer time will in fact improve the ability to resolve two tones in a signal (because the 'beamwidth' of the window in the frequency domain will become narrower: it is 2/NT with NT the total observation time).
I do not understand this discrepancy: If we assume the signal has two tones f1 and f2, and has a period T. Let's say we observe it over a time N*T such that 1/(NT) becomes small enough to distinguish f1 and f2. We have improved the frequency resolution by observing the signal over a longer time. Why is this not equivalent to simply observing the signal for 1 period, and then paste it together N times? This will give the same signal in the time domain, but according to the proof in the link that I posted, it will not improve the frequency resolution.
The only explanation that I can think of myself is: observing for a longer time period does not improve the frequency resolution further once the observation time becomes larger than T. However, I have written some matlab code where I do an FFT on a pure sine over a certain time. I clearly see the 'beam width' in the frequency domain associated with the windowing start to narrow down as I increase the observation time. Given that a pure sine is also periodic and the observation times that I used are bigger than this period, I must thus conclude that my 'explanation' is incorrect.
Could someone try to show me the correct explanation?


texts: Non-uniform sampling and over-sampling -- how to combine?

texts:
My instrument performs measurements at non-equal time intervals, i.e. non-uniform sampling. Apart from this, I usually oversample (by a factor of $n$) for reasons related to filter design, and afterwards downsample by taking every $n^\text{th}$ sample. However, with non-uniform sampling, things seem to be non-obvious. I cannot simply take every $n^\text{th}$ sample since the samples themselves are non-uniform.

I can argue that, since they are non-uniform in the first place, then my downsampling will itself by non-uniform, yet at the end it does not really matter since I still have a non-uniformly sampled signal but now down-sampled. Am I correct?


texts:
Given the below signals and a square pulse shape, I want to design the optimal receiver using complex baseband:
$s_0 = p(t)sin(300\pi t)$
$s_1 = p(t)sin(301\pi t)$
I know that I will be using a matched filter and try to find the filter with the max correlation with any particular signal. The part I am confused by is the difference in the frequency between $s_1$ and the demodulator signals at the receiver. How should this be incorporated into the receiver?


texts: Reconstruction of a windowed signal (specifically Hamming windowed)

texts:
Wondering about the resconstruction of the input signal when an overlapped windowing function has been applied.

I'm specifically applying a Hamming window with 50% overlap and I wish to reconstruct the input signal.

Here http://www.dsprelated.com/showthread/comp.dsp/105321-1.php it's given that summing the 50% overlapped windows gives a sum of 1.08.

In order to reconstruct the input signal (with the same exact amplitudes), then can I merely subtract the extra ~".08" from all the samples? Or, equivalently, divide by 1.08?

The overlapp-add does not result into the exact same signal though, but there's some miniscule variation for some reason. By testing with an array of 1.0s I get back varying values that are of the form 0.999 ...

I guess reconstructing doesn't always lead to the same exact input signal, depending on the windowing function and the amount of overlap?


texts: How does an image rotation affect the magnitude of a DFT?

texts:
Note: This is being applied only to images of b/w text
If we're given some image and plot the DFT spectra as

and then we plot the rotated image's spectra

Is there any way we could recover the angle the image was rotated by based on the magnitudes of the DFT?
The only information I could find on how I would approach this was by using a Hough Transform on the spectral image but that would defeat the purpose of trying to recover the rotation from the DFT.


texts:
For a set of $N$ orthogonal sequences $\textbf{A}^i = \{a_1^i,a_2^i,...,a_M^i\}, i =1 ..N$, the detection of these sequences can be done by calculating the inner product (dot product) of receive sequence $\textbf{Y}$ with all $N$ sequences $\textbf{A}^i$ to find the one maximizing the result:

$$\hat{i}=\text{argmax}_{1\leq i \leq N} \sum_{k=1}^M a^i_k y_k^* \tag{1}$$

This (1) works perfectly in AWGN channels:
$$\textbf{Y} = \textbf{X} + \textbf{W} \tag{2}$$ where $\textbf{X} \in\{\textbf{A}^i \}_{1\leq i\leq N}$ and $\textbf{W}$ is complex Gaussian noise.

However, in fading, specifically Rayleigh fading, channels, (2) becomes
$$\textbf{Y} = \textbf{H}\textbf{X} + \textbf{W} \tag{3}$$ where $\textbf{H}$ is fading coefficient matrix. To be more specific, the system is OFDM based and (3) is channel model in frequency domain. In practical conditions, channel can be severely selective, hence coherence bandwidth can be small (not like coherence time which is usually relatively large because of normal to walking-pace velocity). Then I assume the worst case where there is one $x_k$ per coherence bandwidth, hence the associated channel coefficients are decorrelated.

Therefore, (1) becomes
$$\hat{i}=\text{argmax}_{1\leq i \leq N} \sum_{k=1}^M a^i_k y_k^* =\text{argmax}_{1\leq i \leq N} \sum_{k=1}^M a^i_k h_k^*x_k^* +w_k^*\tag{4}$$
which simply fails because $\{h_k\}_{1\leq k\leq M}$ are decorrelated (assumption: one $x_k$ per coherence bandwidth).

How could we detect orthogonal sequences in channel model (3)? I am interested in Rayleigh fading. But I am wonder if there is universal method for fading channels.

I think this is basics of CDMA (coherence bandwidth may be replaced by coherence time) or sequence correlation in mobile networks such as 4G and 5G. I do appreciate any answer or any paper reference.


texts: Pattern recognition in time series 4x3000 vector

texts:
I have a vector, here is a sample of some data from some heat flow data:

I would like to identify features in this image. In the example above I have identified one feature I would like to automatically recognize. There are others I would like to identify. In this example, the data in all four vectors moves up at the same time, however this can happen at different rates and sometimes it can be delayed.

Like this one:

My regular set of tools is inadequate for this type of problem. I have no problem detecting peaks or using thesholding. This is the first time I've had to do this with multi dimensional data. The other problem is the data is very noisy so peak detection and thresholding yeilds false positives.

I would like to plug this into a neural network and classify it, but the problem is in this 4x3000 vector I might only have 4 or 5 examples of features that I could train with. So it might be hard to train a CNN if I don't have many examples.

There are many tools that work with 1x(n col) vectors, but I need to detect patterns that coincide in all four vectors. Another problem I have is

How can I compare a 4x5 section of the 4x3000 matrix and find similarities?

The think I would really like to do is take a 4x5 matrix and compare it with the rest of the vector and see if and where it matches (so really there would be 2995 matrices of size 4x5). Are there neural networks that can make multidimensional comparisons like this?


texts: Exponential decaying Swept / chirp signal

texts:
I'm trying to create a chirp/swept signal that has it's frequency going down exponentially using matlab/octave.  I can't use the built in chirp function because I'm trying to create a chirp/swept signal based on an equation/formula.  I tried creating some code below but as you see from the spectrogram the frequency does not end at the correct frequency, and the frequency doesn't go down exponentially.

clear all,clc
freq1=20; %start freq
freq2=200; %end freq
fs=44100;
dur=1; %duration of signal in seconds

t = linspace(0,2*pi,fs*dur);

f=freq1:(freq2-freq1)/length(t):freq2-(freq2-freq1)/length(t);
%20:(200-20)/lenght(t) :200-(200-20)/length(t)

data=sin(f.*t); %build signal
data=(data/max(abs(data))*.8); %normalize signal
wavwrite([data'] ,fs,32,strcat('/tmp/del.wav')); %export file
plot(t,data)

Here's a spectrogram plot

My goal:

1) create a signal based on a given equation/formula where the frequency is exponentially decaying (based on the formula 1/exp)

2) be able to type in the starting and ending frequency along with it's duration in seconds example
startfreq=20; endfreq=200; durseconds=2;

The spectrogram plot should look something like this if the start frequency is 200hz ending at 20hz.

Any ideas?


texts: Relative Computational Complexity for Channelizer Implementations

texts:
Suppose I want to separate a broadband input signal into multiple narrow subbands using an FFT-based analysis filter bank. The filter bank uses a prototype lowpass filter and is implemented using a polyphase structure.

See Matlab's Channelizer class

Does it require fewer FLOPS (floating point operations) to do the filtering in the frequency domain as a multiplication and sum or as a convolution in the time domain? Matlab implements the filtering in the time domain.


texts: Given a white noise image $W_{i,j} \sim U[a,b]$ where each pixel is distributed uniformly in $[a,b]$, how would I go about computing its power spectral density? That is, I want to find $E[|\hat{W}_{i,j}|^2]$. Am I supposed to write it out through the autocorrelation function and then use the fact that pixels are independent of each other to split the expectation? Would this just yield a non-zero term at the DC? That is, the squared mean grey value $E[W_{i,j}] = \frac{a+b}{2}$.


texts: What is definition of independent random variable

texts:
I wan't to ask that if

E{X}=0

E{Y}=0

and    E{XY}=0

then how can I verify if the two random variables are independent or not.

X , Y are both continuous random variables {I am not able to recall the exact equations for X , Y but  I am sure about the information given above and want some hint of how to proceed}.

What I know about independence {the definition that is causing confusion}

And so E{XY} should be = E{X}E{Y}

Which part of the below derivation doesn't sufficiently satisfies that X and Y are independent {where did it went wrong}

Transition from first line to second line is only possible if two random variables are independent and after it it's just rearrangement of terms.


texts:
I have implemented a paper regarding echo detection in real-time using MFCC coefficients. Now, I want to remove the echo from the mixed signal. Let me explain it as:

There are two signals, NearEnd signal (Signal Containing Echo) $N$ and Farend Signal (Original signal which causes echo when played) $F$
Echo is being detected in NearEnd Signal $N$. This signal also contains my voice.
Now if we want to remove the $F$ from $N$, is it simple like the addition of two PCM signals?

For example, If I want to mix two PCM signals, research papers show it can be done in multiple ways but the easiest way is :
$$M=A+B$$
Now, if I want to remove F from N, and we get a new echo-free signal $S_{new}$, then will it be like
$$S_{new} = N -F$$


texts: Explanation a flat fading channel in case MIMO OFDM

texts:
I am trying to understand flat fading and frequency selective channels.

As I understood, in the case of flat fading channels  MIMO channel elements, $h_{i,j}$, are random variables.

Which assumption can I make, if the channel flat fading of frequency selectiv for channel matrix?

Actually, I am reading about MIMO OFDM. In all paper which I have read, frequency selective channel model is given for MIMO OFDM. But in my task I need to assume a flat fading. Can i do such assumption?


texts: Convolution of Heaviside function with a sinc low pass, is it band limited?

texts:
Is the result of convolution of a heaviside function with a sinc low pass with cut off at fc, say 25khz, band limited ((sin(2 x Pi x fc x i))/(Pi x i))?
I've been working it out in frequency domain (taking ft of the signals and multiplying them). The ft of the sinc is a rectangular function with cut off at +/-fc. If I pass a continuous 5khz sine, I get a 5khz sine at output, if I pass a continuous 30khz sine, I get a 0 at output, and if I pass an impulse I get a band limited impulse with components upto 25khz at my output. All these results are band limited.
What about heaviside function? I am unable to get the result to look Bandlimited. The Fourier transform of heaviside step function looks very complicated. What am I doing wrong.
I am unable to embed what I've tried but I am linking the equivalent:

https://math.stackexchange.com/questions/736749/fourier-transform-of-sinc-function . This results in a rectangular function from -fc to +fc.
http://www.thefouriertransform.com/pairs/sinusoids.php . The result is energy concentrated at frequency of the sinusoid. If this frequency is inside the rectangular function, after multiplication, I Will get the result as same as before multiplication. If this frequency is outside the rectangular function, I will get 0 as result.
I am unable to come at a proper derivation for the heaviside function. It feels too complicated. Looking at resources. http://www.theochem.ru.nl/~pwormer/Knowino/knowino.org/wiki/Heaviside_step_function.html


texts: Why are there only a few high frequency components in the Discrete Cosine Transform?

texts: I am learning about the Discrete Cosine Transform (DCT) and I read somewhere that, in general, images have very few high frequency components. Can someone give me an intuitive explanation for why this is so? Is this assumption violated in any scenario?


texts: Cosine of amplitude 1 but GNU Radio shows FFT has amplitude > 30,000

texts:
I am doing an FFT on a cosine wave which has an amplitude of 1. The FFT is amplitude is not 1 but over 30,000. What am I missing here?
It's from the GNU Radio FFT wiki page:


texts: Compute filter output with given values of $n$

texts:
\begin{align}
x[n] &=\begin{cases}
 1& \text{for}\quad n \ge 0\\
0& \text{otherwise}
\end{cases}\\
h[n] &= \delta[n] - \delta[n-1]\\
y[n] &= x[n]*h[n]
\end{align}

  Find the values of $y[-1]$, $y[0]$, $y[1]$, $y[2]$.

I thought $\delta[0] = 1$ and $\delta[n] = 0$ otherwise, and that $y[n] = x[k]h[n-k]$:

\begin{array}{|c|c|c|c|c|c|}\hline
n&x[n]&d[n]&d[n-1]&h[n]&y[n]\\\hline
-1& 0 & 0 & 0 & 0&0\\\hline
0&1&1&0&1&1\\\hline
1& 1 & 0 & 1 & -1&-1\\\hline
2& 1 & 0 & 0 & 0&0\\\hline
\end{array}

So I put $\text{ 0  1  -1 0 }$ as my answer but apparently that's wrong. What did I mess up? Did I misinterpret the meaning of $\delta[n]$?


texts: bandwidth between the signal and the channel

texts:
I have a signal with a bandwidth $B=4$ kHz and the bandwitdh is between $6$ kHz and $10$ kHz. I want to transmit this signal in a channel with bandwidth $B'=4$ kHz but for the channel the bandwidth is between $1$ kHz and $5$ kHz.

This is my question:
Can we pass a signal in this channel even if the bandwidth support is not the same?


texts: Are there accepted ranges of "high", "medium" and "low" visual spatial frequency?

texts:
I have an image and have been able to quantify its power across spatial frequencies, using Python. What I am interested in doing is creating some measure of how much of the image's information is low, medium and high SF.

I figured a good way to do this would be to take the average power within three bins of frequencies. This leads to two questions:

Is that actually a good way to do it?
Are there agreed upon ranges of "low", "medium" and "high" spatial frequency?

Thanks!


texts: Techniques for variance stabilizing? Filtering Poisson noise?

texts:
This question is solely theory related so there isn't any sort of practical implementation I'm doing.
I'd like to know what are the different techniques for variance stabilizing(not necessarily used for Poisson noise), and if there's somewhere I can read some detailed explanations of those.
Also I am interested in methods used for removing Poisson noise (the one I found is Ascombe transform, which is technique for variance stabilizing at the same time), again the same goes here, if there's some detailed explanations of these it'd be really great.


texts: How can I manipulate the time signal to insert zeros in between frequency domain bins?

texts:
I generate Multi tones in the frequency domain with constant amplitude and phase, for a fixed distance between tones.
As the figure below, where r is the change in frequency spacing between different symbols, n is the tone index starting on the left in the spectrum, N is the total amount of tones, M is the modulation order, and m is the symbol index.
fc=2.45GHz, f_delta= 1KHz, r=0.5,N=3,M=4.
I want to send the information between tones; I think I can do it by FFT frequency bins.
My question: How can I make some bins refer to one and other bins to zero between those tones?


texts: Help with obtaining the power spectral density of a simple continuous cosine (using both forms of the definition for PSD)

texts:
I am trying to go through a simple example to teach myself about Parseval's theorem and calculating power spectral density (PSD) in practice and would be very grateful if someone could check my reasoning and help my understanding.

Specifically, I want to calculate the average power of a signal in the time domain and show that it is equal to the average power obtained in the frequency domain using the PSD (according to Parseval).

As an example, I am considering a simple cosine (non-causal) signal $x(t) = A\cos(2\pi f_0t)$, which should have infinite energy but finite average power (known as a "power signal", as opposed to "energy signal") given by:
$$P_{\textrm{av}} = \lim_{T\to\infty}\frac{1}{T} \int^{+T/2}_{-T/2} |x(t)|^2\mathrm dt$$

Since this signal is periodic, I should be able to calculate the average power by considering a single period only, where $T= 1/f_0$,
$$P_{\textrm{av}} = \frac{1}{T} \int^{+T/2}_{-T/2} |A\cos(2\pi f_0t)|^2\mathrm dt = f_0 A^2 \int^{+T/2}_{-T/2} \frac{1}{2}\Big[1+\cos(4\pi f_0 t) \Big]\mathrm dt = \frac{A^2}{2}$$

I would now like to arrive at this result by integrating the power spectral density over all frequencies (as should work by Parseval), to convince myself of what I'm doing. So first, I need to obtain the power spectral density. I have seen one definition of the PSD given as the Fourier transform of the autocorrelation function, $R(\tau)$, so I first calculate this:

\begin{align}
  R(\tau) &= \int^{+\infty}_{-\infty} x(t+\tau)\;x^*(t)\;\mathrm dt  \\
          &= A^2 \int_{-\infty}^{+\infty} \cos(2\pi f_0(t+\tau))\cdot \cos(2\pi f_0)\; \mathrm dt\\
          &= \frac{A^2}{2} \cos(2\pi f_0\tau)
\end{align}

where I have used trigonometric identity to evaluate the integrals. Now, calculating the Fourier transform of this to get the PSD:

\begin{align}
  \textrm{PSD}(f) &= \mathcal{F}\{R(\tau)\}   \\
                  &= \int_{-\infty}^{+\infty} R(\tau) e^{-2\pi i f \tau}\; \mathrm d\tau\\
                  &= \int_{-\infty}^{+\infty} \frac{A^2}{2} \cos(2\pi f_0\tau)  e^{-2\pi i f \tau}\; \mathrm d\tau\\
                  &= \frac{A^2}{4}\Big[ \delta(f-f_0) + \delta(f+f_0) \Big]
\end{align}

Is this correct for the power spectral density of a cosine wave, i.e. in units of [signal$^2$ per Hz]? It does indeed look like if I were to integrate this PSD over frequency I would get the correct average power $P_\textrm{av} = A^2/2$.

I have seen an alternative (or just different form?) of the definition of PSD in this question:

$$S_{xx}(\omega)=\lim\limits_{T\to \infty}\mathbf{E} \left[ | \hat{x}_T(\omega) |^2 \right]$$

How would I apply this definition to my cosine signal to arrive at the same PSD above, and show that the average power is recovered? Which method is the approach I should take? Is it true that the autocorrelation method is used more for stochastic signals when the FT does not exist, and for deterministic signals (such as in my case) we can directly use the FT?


texts: Understanding spectra in polyphase filter banks

texts:
I'm trying to fully understand the spectral effects in a polyphase channelizer / polyphase analysis filter bank. I don't really have a signal processing background, so please excuse some incorrect terminology ;-).

So let's consider a very simple case with two output channels. I'll be referring to Polyphase Channelizer Demystified
[Lecture Notes] in this question. Let's start with this block diagram:

and this input spectrum:

I want to understand what spectra at A1, A2, B1 and B2 look like. So obviously as the input signal is sampled we have a repeating spectrum somewhat depicted in the graph above (showing one repeated half of the grey channel on each side) the paper explains downsampling by factor 2 will scale the signals by factor 1/2 and linearly add one shifted version.

At A1 we have such a simple down-sampling operation, so we should get this:

the signal is downsampled by factor 2, so we have a new sample frequency. Still, the linearly combined signal is plausible, as the spectrum repeats according to the new output sample rate.

Equation (6) and (7) in the paper describe the spectrum of a downsampled signal with one unit delay. This should be the signal B1 and it should look like this:

However, this is not plausible, as the signal spectrum does not repeat properly according to the new sample frequency. What did I miss here?

The next question is: What is the effect of the downsampled filter phases? The filter-downsampling will lead to a 'repeated spectrum' filter transfer function as well, correct? So is this correct for A2?:

And what's the effect of the offset/shift of the filter coefficients in p1 caused by the polyphase partition?

Now if we only add up the Nyquist band of the A1 and B1 pictures we end up with the orange spectrum representing channel 0. If we do the same but with a phase shift A1 and -B1 gives the grey spectrum, channel 1. So the end result is plausible, but the intermediate signal at B1 is not.

EDIT:
To add some equations to this topic: According to R. E. Crochiere and L. R. Rabiner. Multirate Digital Signal Processing, pp. 84–88

Filter partitions:
$p_\rho(n)  =  h(nM + \rho)$

Equation for polyphase branches:
$x_\rho(n)  =  x(nM - \rho)$


texts: When do we divide by $2\pi$ while solving Nyquist problems?

texts:
I slightly lost the tempo in the course for a couple of days, so I apologies for the noob question if seemed so.
Why do we divide by $2\pi$ in Nyquist problems sometimes and sometimes not? I saw there is a frequency and a radial frequency. But I don't understand when do we divide max frequency by $2\pi$ and when do we not?
[Edit] for instance:
We have $cos(t\pi/3)$ for what T can we sample it with a dirac train, such as that we can recover the original signal afterwards?
On my lecture the max T is 3. I see the 3 but how the rest of $2\pi/3$ is gone?


texts: Sampling points on a face of a human body mesh

texts:
Is there a known shape analysis technique to sample points of a not necessarily naked human body mesh (more specifically the head part).

The goal would be to randomly sample (uniform distribution) vertices of the head part of the mesh and do some PCA analysis on those points. I know in the ML literature there're techniques to reconstruct human body etc, but I wonder if there's maybe a technique which is not ML based for this specific problem.


texts:
The pattern in which the sample points are distributed in 2 dims, is called a
sampling lattice, and can be defined by a generator matrix.. In 2 dimensions, the generator matrix consists of 2 vectors. My Question is how we choose those vectors to produce the sampling matrix? Can two different generator matrix produce the same pattern?

For example, given this

i think both of the pair vectors can produce the same sampling matrix


texts: Signal that destabilises a positive feedback path with nonunity feedback

texts:
I am just starting to learn about feedback systems. There are a few questions that have me stumped, this being one of them. Could someone please help? Thanks!
Question: Find a signal that destabilizes a system with a delayed positive feedback path and nonunity feedback gain.
My understanding so far is that we are reintroducing the output as an input into the system with a positive coefficient. So if the input is positive, the signal with be amplified. Nonunity feedback gain means only a fraction of the output is being fed back into the system. Is that correct so far?
Now we want to find a signal that is destabilised by this feedback system. That means the original signal should be stable.
A sinusoidal wouldn't work, because the negative inputs cancel out the positives. The square of a sinusoidal is already unstable. How about the absolute value of a sinusoidal? Would that work?


texts: Percentage difference between two signals

texts:
Apologies in advance for what I imagine is a simple question, however I can't work out how to do this.

I have two signals of the same type but with different sensor types, the figure below will give you an idea of some of the data I've got:

I very simply want to calculate the average percentage difference between the two signals. Methods I've attempted so far have calculated outrageous results, in the order of ~200% difference. My attempt is below:

  for i = 1:length(data)
      per(i) = abs((var1(i)-var2(i))/((var1(i)+var2(i))/2)) * 100;
  end

I believe the problem in this method is that I'm only calculating the difference between the two immediate points in question (i) and not on a grand scale of all the data.

Any help would be greatly appreciated.


texts: Interpretation of Eigen Values of covariance matrix

texts:
I am trying to obtain an intuitive understanding of Eigen Values of covariance matrix and have used a few layman terms because I fully do not understand the concept yet.

The following is the code snippet written in Octave.

clear;clc;

#p,q,r,s,t,u,v and w are features.
#Each of them have been measured 10 times
# p,q and r move in one exact direction [ascending]
p = [1,2,3,4,5,6,7,8,9,10];
q = (p * 0.5) + 4;
r = p .* q;

# s moves in descending direction
s = -r;
t = s/2;

# t should show up flat in all scatter plots
u = [1,1,1,1,1,1,1,1,1,1];

# v and w are random
v = rand(1,10);
w = rand(1,10);

# Create a snapshot matrix
# Columns are features and rows their observations
X = [p',t',q',r',w', s',v',u'];

# Compute the covariance matrix
R = cov(X);

# Compute Eigen Vectors and corresponding Eigen Values
[EigVec, EigVal] = eig(R);

octave>>diag(EigVal)
-1.1581e-014
0.0000e+000
2.7459e-031
1.4409e-018
5.3430e-002
8.4624e-002
2.0351e-001
1.9057e+003

My understanding is that the Eigen-Vectors with significant Eigen-Values of covariance matrix represent significant underlying directional forces in the datasets.

In my example, I think there are three directional forces:

p,q,r => Ascending direction

s,t   => Descending direction

u     => Horizontal direction

v,w   => Random and must not show up as a definitive underlying pattern

I am therefore expecting 3 significant Eigen Values in the output, but there seems to be only two [1.9057e+003 and 2.0351e-001 - possibly for ascending and descending directional forces].

My question hence is why is the horizontal directional force not showing up in the Eigen value output?


texts:
I was watching a youtube video for the duality property for continuous time Fourier transforms, which shows that if
Fourier transform of $x(t)$ is $X(\omega)$
then Fourier transform of $X(t)$ is $2\pi x(-\omega)$
Then how will duality look like in the case of the DFT?
Will it look like below?

If DFT of $x[n]$ is $X[k]$ then DFT of $X[n]$ is $2\pi x[-k]$


texts: Audio from multiple microphones mixed to mono and ASR

texts:
I am trying to do speech recognition on an audio file which has 1 channel (mono). My problem is that the channel is comprised of the signal of 3 microphones which have captured the audio at different distances of a person speaking and the signals have been mixed into mono, which I suspect has added reverberation and noise into the audio, making it impossible for the ASR (automatic speech recognition) to recognize speech.

I am unable to obtain the original signals from each microphone so I need to know in which way I can clean the audio or revert the effect of the downmix.

I have already tried applying the Weighted Prediction Error (Nakatani et al, 2012) filter under the hypothesis that 2 of the 3 microphones would account for reverberation in the audio as the signal has its phase shifted (due to reverberation time) but had no improvements.

I do not have the transcriptions of the audios.

What can I do? I have no more ideas on how to continue.

EDIT: This is an example utterance of the audio file (WAV file, it is in spanish and intelligible for a person)

Yoshioka, Takuya, and Tomohiro Nakatani. "Generalization of multi-channel linear prediction methods for blind MIMO impulse response shortening." IEEE Transactions on Audio, Speech, and Language Processing 20.10 (2012): 2707-2720.

Thank you.