texts: Extra 'fingers' found in graph after applying FFT in MATLAB

texts:
I am currently working on the FFT function in MATLAB. In this function, i require a 1024 number of data Time Domain plot and produce a 400 number of data Frequency domain plot.

After applying the FFT function, i obtain a result of a graph going up to 6000Hz.

However, the Frequency band produced is too big and I only wanna analyze between 0 ~ 500 Hz.
I applied the Chirp-Z transform to obtain the band of 0 ~ 500 Hz, at the same time retaining the output as 400 number of data. This is what I obtain:

The problem arise as I made a comparison to the graph originally in Frequency Domain already.

(Please note that I have already both the original graphs - Time and Frequency domain to make comparison with)

As I compared the graph from MATLAB and the original one, there seems to be extra 'fingers' or so present when its supposed to be a straight line. What could be the problem and its appropriate solution?

EDIT 1

After trying almost all available Window functions, the taylorwin Window function seems the best and this is the result:

However it still does not produce a graph that is almost similar to the original graph


texts: Response time of residual current device and sampling times

texts:
The table below is from this document: Schneider RCD
When the maximum response of the device is 40 mS, does it measure current doing RMS or peak detection? The document does not explicitly say it. However, in general, RCDs should trip quick (below 50 ms) when protecting humans.
My question is: Is a time below 50 ms enough to perform RMS and trip the device? Let's say that we have a digital RCD that uses a microcontroller and ADC. I think the only way to trip that fast is comparing instantaneous values to a threshold. But what if the signal is noisy and deciding based on inst values cause nuisance tripping? In this case RMS would be a better measure at the expense of being slower.
So my second question: In 40 ms I have 2 cycles of 50 Hz and like 2.4 cycles of 60Hz. In this case the RMS measurement for the 60 Hz would not be accurate because sampling time is not an integer number of cycles, right?


texts:
I am trying to write an algorithm that would automatically segment a piece of audio with bird calls recordings. My input data are 1 minute-long wave files and on the output I would like to get separate calls for further analysis. Problem is that signal-to-noise ratio is quite terrible due to environmental conditions and poor quality of a microphone (mono, 8 kHz sampling).

I would be most grateful for any advice on how to proceed further with noise reduction.

Here is an example of my input, one minute audio recording in wave format: http://goo.gl/16fG8P

This is how the signal looks like:

Band-pass filtering, in which I am keeping only anything in between 1500 - 2500 Hz, does improve situation, but still it is far from expectations. In this spectrum still a lot of noise is present.

I have also plotted long-term (over 32-sample intervals) average energy and removed some clicks from it. Here is the result:

With all the remaining noise I have to set a very low threshold to the onset detection algorithm to pick last 10 seconds of bird calls. Problem is if I tweak it in such a way then in next recording I can get load of false positives.

Moving average filter helps a bit with wind noise. Any other ideas? I was thinking of "Spectral Subtraction", but here it seems to me I have sort of chicken and egg problem - to find noise-only area I have to segment the audio and to segment the audio I need to remove the noise. Do you know of any libraries that have this algorithm or some implementations in pseudo-code? Methinks Audacity uses such a method to remove noise. It is very effective, but it is left to the user to mark noise-only area.

I am writing in Python and it is a free, open-source project.

Thanks for reading!


texts:
From this document it's says

1.Filter the Data
2.Flip that
3.Filter again
4.and Flip that again

for zero-phase filter. but when i do this in matlab , i'm compare between filtfilt method and what i did , it isnt equal. what is the problem ?

MATLAB CODE

clc;clear all;
emg_healthy=load('emg_healthy.txt');
x= 10;
fs= 4000;
my_counter = 1000;
myRawData = emg_healthy(:,2);
myRawData = myRawData(1:my_counter);
myDataRecti = abs(myRawData);
[b,a]= butter(6,x/(fs/2),'low');
filter_y=filtfilt(b,a,myDataRecti);
firstFilter = filter(b,a,myDataRecti);
flip_firstFilter = fliplr(firstFilter);
secondFilter = filter(b,a,flip_firstFilter);
flip_secondFilter = fliplr(secondFilter);
xlabel('Sample Number');ylabel('Genliği');plot(flip_secondFilter,'b');
hold on ;
xlabel('Sample Number');ylabel('Rect Genliği');plot(filter_y,'r');

RESULT

-----------------------------------EDIT-----------------------------------

thanks to robert bristow-johnson, i tried zero-padding to myData , end and begin.
This is i try

MATLAB CODE

% % EMG Soleus
clc;clear all;
emg_healthy=load('emg_healthy.txt');
x= 10;
fs= 4000;
my_counter = 1000;
myRawData = emg_healthy(:,2);
myRawData = myRawData(1:my_counter);
myDataRecti = abs(myRawData);
[b,a]= butter(6,x/(fs/2),'low');
for i = 1:1:(my_counter/4)
myZeroDataRecti(i) = 0;
end
for i = (my_counter/4+1):1:(my_counter+my_counter/4)
myZeroDataRecti(i) = myDataRecti(i-my_counter/4);
end
for i=(my_counter+my_counter/4+1):1:(my_counter+my_counter/4+my_counter/4)
    myZeroDataRecti(i) = 0;
end
filter_y=filtfilt(b,a,myZeroDataRecti);
firstFilter = filter(b,a,myZeroDataRecti);
flip_firstFilter = fliplr(firstFilter);
secondFilter = filter(b,a,flip_firstFilter);
flip_secondFilter = fliplr(secondFilter);
xlabel('Sample Number');ylabel('Amplitude');plot(myZeroDataRecti,'g');
hold on ;
xlabel('Sample Number');ylabel('Amplitude');plot(flip_secondFilter,'b');
xlabel('Sample Number');ylabel('Amplitude');plot(filter_y,'r');
%

RESULT

another i try , i again add zero-padding begin and end but i used filtfit method to apply without zero-padding data

MATLAB CODE

% % EMG Soleus
clc;clear all;
emg_healthy=load('emg_healthy.txt');
x= 10;
fs= 4000;
my_counter = 1000;
myRawData = emg_healthy(:,2);
myRawData = myRawData(1:my_counter);
myDataRecti = abs(myRawData);

[b,a]= butter(6,x/(fs/2),'low');
filter_y=filtfilt(b,a,myDataRecti);
for i = 1:1:(my_counter/4)
myZeroDataRecti(i) = 0;
end
for i = (my_counter/4+1):1:(my_counter+my_counter/4)
myZeroDataRecti(i) = myDataRecti(i-my_counter/4);
end
for i=(my_counter+my_counter/4+1):1:(my_counter+my_counter/4+my_counter/4)
    myZeroDataRecti(i) = 0;
end
firstFilter = filter(b,a,myZeroDataRecti);
flip_firstFilter = fliplr(firstFilter);
secondFilter = filter(b,a,flip_firstFilter);
flip_secondFilter = fliplr(secondFilter);
xlabel('Sample Number');ylabel('Amplitude');plot(flip_secondFilter,'b');
hold on ;
xlabel('Sample Number');ylabel('Amplitude');plot(myDataRecti,'g');
xlabel('Sample Number');ylabel('Amplitude');plot(myZeroDataRecti,'c');
xlabel('Sample Number');ylabel('Amplitude');plot(filter_y,'r');
%

RESULT

in my opion, there are two things we have to think about that,

1.First picture in the edit part,my signal (myCode-LEGEND) amortize itself , but matlab function (filtfilt) keep continiues , why is that ?

2.Second picture in the edit part, my signal(myCode-LEGEND) different from filtfilt function signal. And between myCode and 250Zero+originalData+250Zero i think it doesnt any phase shift. If we say that it's true what should i do ? Will i remove 250 zero from begin and end ?


texts: Making a low pass filter for irregular samples

texts:
We are interested in reconstructing the red channel of a scene.

The red channel is slowly varying.

Unfortunately the camera does not have a Bayer sensor, and the red samples are irregularly spaced over the grid:

How do you design a 2D low-pass filter (convolution kernel) that:

only depends on the samples of red that you have
has as close to constant frequency response as possible?

I was thinking of something along the lines of solving an optimization problem relating to the NDFT. Would this idea work? :

  Take the NDFT of the red components we have. Then in continuous space, form the sum of all the sinusoids from the frequency information in the NDFT. Re-sample the function along the whole grid.


texts:
It is known that the PSD of additive white Gaussian noise (AWGN) is constant and equal to its variance. What about coloured Gaussian noise (CGN)?

For example, given the following PSD of CGN

$$S(f) = \frac 1f $$

Is the spectral density of such noise frequency-dependent? If so, how to get the PDF by some "inverse" autocorrelation function?


texts:
I'm trying to calculate the envelope of an arbitrary spectrum but I'm slightly lost as to the best way to do this.

I've looked at cepstral enveloping but its very fiddly and I can't seem to get it to give the right results.  I've also tried LPC but again it eems to miss a lot of the minor peaks while enveloping the major peaks perfectly.

I'm beginning to wonder of the best way would be just to run a sliding window across each frequency bin in an FFT returned magnitude spectrum and select the maximum value within that window.  This way I'd simply pull out all the peaks (at whatever granularity I'm after) and then I can simply plot a curve through the resulting points.

Is there a correct way to calculate the spectral envelope?


texts: Interpolation of magnitude of discrete Fourier transform (DFT)

texts:
For example for peak frequency finding, it seems valid to use band-limited interpolation methods on the complex DFT bins, or separately on their real and imaginary parts and to calculate the magnitudes or squared magnitudes of the results. But how about band-limited interpolation of the magnitudes of the bins (I don't think that's valid), or their squared magnitudes (maybe valid)? By valid I mean that perfectly interpolated values should be equal to those found by calculating them from a larger DFT of a zero-padded version of the time-domain signal.

The first approach guarantees a non-negative result, unlike the others if the interpolation is not perfect, see this question about nonnegative or positive band-limited interpolation.


texts: Is deep learning the only way to detect humans in a picture?

texts:
I'm looking for a way to detect humans in a picture. For instance, regarding the picture below, I'd like to coarsely determine how many people are in the scene. I must be able to detect both standing and sitting people. I do not mind not detecting people located behind a physical object (such as the glass in the bus picture).

AFAIK, such a problem can rather easily be solved by training deep neural networks. However, my coworkers would like me to also implement a detection technique based on general image processing techniques. I've spent several days looking for techniques designed by researchers but I couldn't find anything else than saliency-based techniques (which may be fine, but I'd like to test several techniques based on old-fashioned image processing).

I have strong constraints on the nature of images, for instance luminosity: whether they've been taken during the day or at night, the pictures will have very different characteristics (e.g. image contrast can strongly vary).

Long story short, I'd like to know if there's indeed some existing segmentation technique for which it'd be interesting giving a shot, given the fact that the information carried by the images vary a lot?


texts: When doing a Hilbert-transformation, why not simply multiplying by an exponential?

texts: When doing the Hilbert-transformation, which is supposed to be a phase-shift by $\\-\frac{\pi}{2}$, why not simply use $\\e^{-j\frac{\pi}{2}}$ instead of $\\H(f) = -j \cdot \textrm{sgn}(f)$?


texts: Detecting text lines in image by means of Hough Transform

texts:
In my Android App,I have to detect text lines in images.I want to use Hough Transform to detect lines.You can see an image below:

I got edges in image by canny filter,then I applied Hough Transform on canny image:

Size size = canny.size();
Mat lines = new Mat();
int lineGap = 20;
double sum1 = 0;
Imgproc.HoughLinesP(canny, lines, 1, Math.PI / 180, 100, size.width / 2.f, lineGap);

Result for above image, looks like this:

You can see three text lines are detected.So I added line's thickness by applying dilate on canny image:

Mat dilate = new Mat();
Mat kernel = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(10,10));
Imgproc.dilate(canny, dilate, kernel);
int lineGap = 20;
double sum1 = 0;
Imgproc.HoughLinesP(dilate, lines, 1, Math.PI / 180, 100, size.width / 2.f, lineGap);

I drew detected lines on empty black background.Result is shown below:

You can see number of detected text lines is decreased,although I had added thickness of lines and did not change amount of minLineLength or maxLineGap,also when I apply dilation no white pixel remove from image!

Again I added thickness of lines by doing dilation with kernel of size(30,30):

Mat dilate = new Mat();
Mat kernel = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(30,30));
Imgproc.dilate(canny, dilate, kernel);
int lineGap = 20;
double sum1 = 0;
Imgproc.HoughLinesP(dilate, lines, 1, Math.PI / 180, 100, size.width / 2.f, lineGap);

Result is:

Now my question is:
Why in each level when I add number of white pixels (by dilation) and do not change minLineLength or maxLineGap,Hough Transform do not detect some lines that were detected in previous level with less white pixels?


texts: Classic Signal Processing vs Deep Learning / Machine Learning (DNN / ML) Based Signal Processing

texts:
Are classic signal processing/statistics based approaches to optimum detection/estimation still relevant/important compared to ML based approaches using DL?
There was a time when speech processing was done using HMM. While not completely unused most speech processing now rests firmly in the DL area. I'm wondering if every area of classic signal processing will be taken over by these approaches over the classic feature finding historically used.


texts:
I am trying to reproduce this paper concerning the Optical realization of the Radon Transform, especially the simulation (section 3). Shortly, the experiment is just a "Fourier filtering" with a 4F system.

In the paper, they propose to use an optical element defined as $$T(r,\theta)=\frac{e^{2\pi i\theta r \beta }}{r}\text.$$

I tried this and it doesn't give the correct output. I think this is due to the fact that the output should be a circle representing the Radon transform in cartesian coordinates, meaning a polar symmetric element and the optical element obviously isn't, at least in the standard definition of polar coordinates (centered at 0).

Then I tried to change the optical element with respect to the argument mentioned above:

$$T(r,\theta)=\frac{e^{2\pi i r \beta }}{r}\text,$$

getting rid of the $\theta$ in the exponential so my element is now perfectly symmetric (as in Fig. 5 of the paper). The result:

It represents the Radon transform in cartesian coordinates of a Shepp-Logan phantom (240x240 pixels). $\beta$ controls the radius of the circle and is tuned to match the mathematical representation (reference). In image it looks like this:

As you see, the image is reconstructed but there's a problem concerning the amplitude. I do believe the problem can come from 2 parameters.

First, I should maybe use $\theta$ somewhere, but when I generate it using atan2 it doesn't give the correct result.

Second, change the way I define $r=\sqrt{x^2+y^2}$ in order to match the definition of polar representation used for the usual Radon transform (r being the diagonal of the picture taking information twice and centering it).

Has anyone ever encountered a similar problem in image processing, amplitude missing?
Or maybe is someone an expert in Radon transform (computed tomography or such) and knows how to generate the proper polar representation?
Or does someone know what I should try next?


texts: Impact of the sample rate of the emitting signal : communication between HackRF One and USRP NI 2921

texts:
I am transmitting a 1 kHz cosine wave with a HackRF One. I receive it with a NI2921 USRP at a sample rate of 200kHz. All the process is on GNURadio Companion.

I changed the sample rate at emission to see the impact. I started at 200kHz and lowered of 1kHz each time. The sample rate at reception stays the same : 200kHz. Here are the results :

From 200kHz to 96kHz, nothing appeared. Then, at a sample rate of 95kHz at emission, the cosine spectrum showed two peaks at 13kHz and 87kHz, centered on 50kHz (DC component) giving a cosine of frequency 37kHz.
All the frequencies on the table above are the only ones showing something on the FFT of the received signal.

My questions are :

Why does the sample rate at emission impact the frequency seen at the receiver?
Why are there frequencies that do not make the cosine spectrum appear? (Only the frequencies present in the table work). For example, if I have the two same sample rates at emission and reception (200kHz for our example), it does not work.
Why are the frequencies seen on the FFT plot different from 1kHz, the real cosine frequency emitted with the HackRF One?


texts: Computer Vision/Image Processing Riddles

texts:
I know this topic is not clearly relevant to the forum, but I think it's fun and interesting.

I'm looking for computer vision riddles - fun and interesting questions that have a clear and precise solution. For example the following: We have a binary image with paths (contours) that are one pixel wide. Come up with an algorithm to find the ends of the paths. I know of two solutions to this riddle.

Do you know of any other riddles? I'll be happy to hear some!

Thanks,

Gil.


texts: what sampling rate and bit depth should i use?

texts:
I'm doing a simple mini project on FPGA board, electronic lock which open when a short track (the "password") is play next to the lock's mic.

i want to save samples of the chosen song to an array x[n]
and and then take samples from the mic and save them to a FIFO list y[n].
then compare the the conv result z[n]=x[n]*y[n] and when it is big enough the lock is open.

the question is how many samples i need for 3-4 sec of rock song for this purpose?


texts: Time location of the DWT detail coefficients using MATLAB

texts:
When performing the Discrete Wavelet Transform in MATLAB using the command DWT or WAVEDEC, what it the exact time or pseudo-time location of the DWT coefficients?

At each level the time series is decimated by 2, this means that the coefficients should be localized at $2^j \, T_s$, where $T_s$ is the sampling frequency. However, the application of a reconstruction filter of length $M$ makes the coefficient arrays longer. And each level a longer coefficient array is then fed into a new DWT function, which modifies further its length. The arrays are also properly extended at each level, according to a criterion specified by the user using the command DWTMODE.

I see that in some MATLAB examples, just the central part of the array is shown using the command WKEEP. Is this approach sufficiently accurate, meaning that the external coefficients (those that are not central) are really NOT significant?

If I do not discard some coefficients, I clearly see a huge delay if I assign them to $2^j \, T_s$. I believe that the external coefficients are however necessary for the reconstruction.

How many coefficients can be discarded at each level, if they can be?


texts: Calculating transmitter power from spectral density

texts:
I want to find out what is the real transmit power of my USRP 2922, unfortunately the only results I get when looking at the spectrum analyzer is the spectral power density.
These are the results of the my measurements (in LabView - transmitter parameters are: 1Mhz IQ Sampling rate, carrier: 2.4375GHz, 0 Tx gain, QPSK modulation; RX port on USRP receiver and TX port on USRP transmitter are connected with an attenuator):

Now, I'm wondering how to find the transmit power of the transmitter from this. The Gain control is for the RX Antenna gain, so it's not useful since it's not power of the USRP transmitter. Maybe I should integrate this value in the band? Alternatively for a sine of the signal, calculate the value from the amplitude? Any ideas?


texts:
I'm having some problems understanding the FFT. Is the frequency resolution in the spectrum calculated as

$\frac{\textrm{sampling rate}}{\textrm{number of FFT points}}$ or $\frac{\textrm{sampling rate}}{\textrm{0.5 * number of FFT points}}$?

Asking this because the spectrum is symmetric for real-valued inputs. So, say I have $f_s = 1000$ Hz and $N$ = 1024, where $N$ is the number of FFT points. Now, is the frequency resolution $\frac{1000 \textrm{ Hz}}{1024} = 0.9766$ Hz or $\frac{1000 \textrm{ Hz}}{0.5 * 1024} = 1.9531$ Hz?


texts:
I can't think of a better way for asking this question so I will start with an example. Suppose that I have an input signal with a max frequency of 50Hz (sampled at 100Hz). Now the signals of interest lie in the range 0-5Hz, so I can add a low-pass filter with a cut-off of 5Hz, and use the resulting signal for further processing. My understanding is that now I can downsample the filtered signal by a factor of 10 and hence reduce processing load. Am I right?
If yes, why is downsampling not ALWAYS performed after filtering because it seems to me as the obvious way to go?
And if I am wrong in my assumption, where am I mistaken?


texts: Expectation of product of hermitian matrix

texts:
Let $\textbf{h} \in \mathbb{C}^{N\times 1}$, $\textbf{a} \in \mathbb{C}^{N\times 1}$, $\textbf{b} \in \mathbb{C}^{N\times 1}$ and $\textbf{c} \in \mathbb{C}^{N\times 1}$. The variable $h_i$ is defined as $h_i=\left(a_i+b_i\right)c_i$

$\textbf{a}=[1~2~3~4]^T$, $\textbf{b}=[5~6~7~8]^T$, $\textbf{c}=[9~10~11~12]^T$,
Then $h_1$ is calculated as follows $(a_1+b_1)c_1=(1+5)\times 9$,
$h_2 =(a_2+b_2)c_2=(2+6)\times 10$, $h_3 =(a_3+b_3)c_3=(3+7)\times 11$, $h_4 =(a_4+b_4)c_4=(4+8)\times 12$.

Finally $\textbf{h}=[h_1, h_2, h_3, h_4]^T$.

Question:
1. $\textrm{E}\left[\textbf{h}\textbf{h}^H\right]$=? in terms of $\textrm{E}\left[\textbf{c}\textbf{c}^H\right]$

2.Can I write $\textbf{h}$ in terms of $\textbf{a}$ $\textbf{b}$, $\textbf{c}$?


texts:
I asked myself how to compute dBFS (dB full scale) from a value of sample between 1 and -1?

and in general?


texts: Cepstrum: subtracting the mean vs. dividing by the variance

texts:
In cepstral speech analysis, it is relatively easy to understand why subtracting the mean removes any "channel" effects (including that of recording equipment and the vocal tract). There is a good explanation of that here. But why does dividing by the variance (after the mean has been subtracted) also give a similar (additional) improvement?

Subtraction in the quefrency-domain corresponds to de-multiplication in the frequency domain, which corresponds to de-convolution in the time domain. Can a similar analogy or explanation be given for division in the quefrency-domain?


texts: Geometric models to discard image features

texts:
I am working on the implementation of a location recognition pipeline as detailed in the section 5.4 of the paper Leveraging 3D City Models for Rotation Invariant Place-of-Interest Recognition:

Vocabulary tree + Inverted File System + SIFT detector/descriptors (discarding features not lying on a building using geometric models) + RANSAC for estimating an affine model

I understand most of the elements there but they don't detail much on which types of geometric models are they using, nor what to discard, features from the database of images or from the query image, and neither how are they applying them.

I'm thinking on something like RANSAC for estimation of an homography but is only an assumption.

My question is which geometric models would you suggest me to use in this case (urban environment images of common city landmarks)?


texts: Image processing: how do I erode on boundary and dilate inside boundary?

texts:
I have an image that I am trying to process:

I want two seamingly contradictory effects:

I want to remove "holes" inside "the blob". That is I want all pixels inside the blob to be solid red.
I want to move the boundary of the blob inwards.

From what I gather the morphological operation dilatation would do 1. and erosion would do 2?

But dilatation and erosion counteract each other?

How would you suggest I go about to achieve the desired result?


texts: Filter length (N) has no effect on the reconstructed signal & Toeplitz Matrix

texts:
Hello Signal Processing community,
I implemented a filtering algorithm called Minimal Mean Squared Error in Frequency domain with N-coefficient and Signal Detection (FMSENSD) in MATLAB, I got some good results butit seems that the filter length N does not effect on the quality of reconstructed signal and also the amplitude has degraded. Please see attached pictures for more details on the algorithm and results I got: .
I think there is someting wrong in my MATLAB code, More precisely in toeplitz matrix line.
Code snapshot:
[N_r, N_c]= size(afx)       ;                            %% number of bands
afy = zeros(N_r,N_c) ;

for i = 1:N_c
   AFR = toeplitz(afr(:,i),N) ;
   hh = inv(transpose(AFR)*AFR)*transpose(AFR)*afx(:,i) ;
   afy(:,i) = conv(afr(:,i),hh ); %
end

Any guidance guys to solve this issue !
Thank you


texts: Various size arrays interpolation - resampling

texts:
sorry if it's stupid question but it’s third day that I try to figure it out how to do that. And just can’t find the solution.

Let’s say I have array $A$ size 4, and $B$ size 8. And I need to put/spread evenly all 8 values from $B$ to 4 places in $A$.

In that case it’s quite easy to imagine the solution, but let’s say I have $A$ size 44100, and $B$ size 48000. How to express 48000 values of $B$ by 44100 values of $A$.

I know there are a lot of free and ready to use resampling algorithms, by I don’t need to use them. I need to understand mathematical basis of those algorithms. And not only for audio. But for other purposes also. I need it for my study. Could anyone help me?
Best regards.


texts: What does it mean to combine signals coherently?

texts: What does the expression 'combine signals coherently' imply?


texts:
I already posted this question on StackOverflow. I got a suggestion to go for a better answer here.

To make the question more concise I'm interested in an introduction to digital filters, any resource is good.

But first I will be satisfied if someone could point me to some resources explaining this filter (used in Android):

http://gitorious.org/rowboat/frameworks-base/blobs/671a6ff4be11b3e2d8eb017e0c7a78e6133fb2b8/services/sensorservice/SecondOrderLowPassFilter.cpp

What I'm interested is the way the filter's parameters are chosen. While I can copy it without thinking, I guess I should understand the basic concept/idea behind before using it.

Thanks,

Iulian


texts: How to do addition of sound pressure RMS in a DFT

texts: Based on this answer. Once you have your DFT in the unit sound pressure RMS, what is the correct method for getting the sound pressure RMS sum over multiple bins (if for example you're trying to get the total RMS over a frequency band)?


texts: Effect of filtering on Energy of a Digital Signal

texts:
I am trying to detect (not remove) noise from the digital signal to get meaningful information out of it.

The signal I need is in the frequency range of 0.1 Hz to 10 Hz. Anything beyond this is just noise (and useless) for me. So I want to find parts of a signal that do not contain my necessary data and is pure noise.

Once again, to make it clear - I want to detect parts of a signal that is PURE Noise. If it has noise mixed with my required signal, I can pick out the meaningful information from it. But I want to completely remove parts that are PURE noise.

What have I tried till now? The below steps summarize what I have tried till now:

Scale the data using robust scaler (because the signal can be at different gains or amplifications, so I am scaling it over a fixed window size. And in that window size the gain or amplification is same)
Pass the data through a band pass filter of 0.1-10 Hz
Find autocorrelation of the signal with itself over different lags

And some more steps after this which have turned out to be of no help.

The autocorrelation of the desired data after filtering and noise after filtering is helping me differentiate between the 2, but is failing to do so over a considerable number of files.

I want to make an algorithm, that works for all varieties of data - over different amplifications, different frequencies, whether the data has pure meaningful information or pure noise or both mixed, my algorithm should be able to detect if that particular window of the signal is pure noise or has some meaningful information.

So I thought, that when I am filtering a signal having some desired information, to 0.1Hz to 10Hz, what will the effect on its energy?
Because then I can find the ratio of energy of the filtered signal to the energy of the raw signal & set a threshold for it. If this ratio is greater than the threshold, the signal has meaningful information & if it is lesser, then it is pure noise.

Thus, to summarize -

I want to detect parts of my signal with pure noise. Is there a better way to build a universal algorithm to do it?
What is the effect of filtering a signal on its energy when compared to the raw signal?
How to find the energy in a signal - in Python?

I know my question might not be clear, but if you can answer the last three questions, it would be great.

Thanks in advance.


texts: Signal Reconstruction after fourier transform

texts:
I'm working from an example posted here.  I understand the steps to acquire the fourier transform and can clearly see the spikes at normalized frequencies at 15 and 40 Hz from the 0-centered periodogram.  Knowing this, I believe that I can reconstruct a smoother version of the signal as:

$x_{\text{reconstructed}}(t)=\alpha_1 sin(30\pi t)+\alpha_2 sin(80\pi t)$.

I have two questions related to this reconstruction:

How do I obtain the coefficients $\alpha_1$ and $\alpha_2$ without an inverse fourier transform of the entire frequency domain data set?  Is there a more efficient way?
How could I have obtained the 15 & 40 Hz frequencies from the transformed data?  I know I can sort the transformed data to determine that these two frequencies had the highest two powers.  But if the data set were very large, this might be unfeasible.  Is there another way to determine the important frequencies?


texts: System Identification with a Limited Bandwidth Input Signal and Region of Interest

texts:
Given a FIR filter $h[n]$. Its action can described as:

$$
\mathbf{y} = \mathbf{H} \mathbf{x} \\
\mathbf{y} = \mathbf{X} \mathbf{h}
$$

where $\mathbf{H}$ and $\mathbf{X}$ is a Toeplitz matrix.
If $h$ is unknown, Least Squares with a white Gaussian input signal $x[n]$ can be used to find the unknown coefficients:

$$
\hat{\mathbf{h}} = (\mathbf{X}^{T}\mathbf{X})^{-1} \mathbf{X}^T \mathbf{y}
$$

Caveat: $x[n]$ must be white; otherwise the regression matrix $\mathbf{X}^T \mathbf{X}$ is badly conditioned.

The frequency domain information is encoded in the coefficients $h$. However, as can be seen above, the LS algorithm estimates the coefficients with zero prior knowledge; the estimation ONLY depends on the input signal $x$. It does not matter if the system to be identified is an allpass filter or has a notch of 200dB attenuation at $\pi/2$.

Now my question: What do I do if I only care about a small frequency range in $h$ and hence my input signal $x[n]$ does not need to be white?

Example: My Nyquist rate is 10kHz. My unknown system is a lowpass with -3dB at 300 Hz. It has some "weird" frequency behavior around 300 Hz which I want to estimate. I do NOT care about anything beyond, say, 500 Hz.
Additionally, my measurement setup prevents me from using a white input signal. I have a bandwidth limitation of 500 Hz. I cannot change the Nyquist rate.

With Least Squares I cannot identify the system because $x$ is not white (persistently exciting). Regularization/SVD does not help me: It provides a biased solution and still gives me $h$ values that try to estimate the entire frequency range. But I really want to say "Give me the $h$ that describes the unknown system best up to 500 Hz with a 500 Hz input signal"


texts: How to choose FFT depth for ADC performance analysis (SINAD, ENOB)

texts:
I am trying to simulate a model of an ADC and determine its performance.

One of the interesting properties is the ENOB (Effective Number Of Bits), which can be calculated from SINAD (SIgnal-to-Noise And Distortion ratio).

On that SINAD Wikipedia page, there is a PDF document which suggests that the second definition on the SINAD Wikipedia page is the one to use and which I interpreted to be

$$
SINAD = 10 \log_{10} \left( \frac{p_f} {\sum_i{(p_i)} - p_0 - p_f} \right)dB
$$

Where $p_x$ is the power the FFT bin at frequency $x$, $p_f$ is the power of the frequency bin containing the signal frequency $f$ and $p_0$ is the DC component. I calculate the power of each bin by squaring the normalized amplitude. Also note that the sum in that equation runs over all frequencies from $0$ to the Nyquist bandwidth $f_s/2$ with $f_s$ being the sampling frequency of the ADC.

That same document also defines
$$
ENOB = \frac{SINAD-1.76dB}{6.02}
$$

Using my SINAD and this ENOB definition, I compared the output of an ideal $N$ bit ADC model, which matched for my FFT depth.

In another (related) PDF document, it states that the FFT depth must be large enough in order to distinguish between the FFT noise floor and the ADC noise. To my surprise, it also says that the FFT noise floor is
$$
10 \log_{10} \left( \frac{M}{2} \right)dB
$$
below the theoretical signal-to-quantization-noise $SNR=6.02N+1.76dB$, which makes me wonder how $M$ can thus ever be "too low"?

While playing with different ADC models, I have seen that the ENOB does vary significantly when I set $M$ too low, so I am wondering if there is any guide on how to choose $M$ for a desired ADC bitwidth of $N$?


texts: Separate Simple Signal into Exponential Components

texts:
Everyone here should be familiar with the trignonometric identity

$$2 \cos(x)=e^{jx}+e^{-jx}$$

Let's say I have a real world analog signal given by the following function

$$x(t)=2\cos (\omega_1 t)$$

and I only want a single exponential component, specifically

$$y(t) = e^{j\omega_1 t}$$

where $\omega_1$ is a real constant. How to do this? Is it possible?


texts:
I try to create matched filter for receive BPSK signal. Sampling rate of the signal is 228000 Hz, data rate 1187.5 symbols/sec, signal was shaped using root raised cosine filter with rolloff factor = 1.

I cant get what should be sps — Samples per symbol in function rcosdesign . First i thought it's 228000/1187.5 , but tried it and probably I'm wrong...


texts: Steady state value of a complex convolution

texts:
I am trying few problems on the introductory part of DSP. One of the problem asks to calculate the steady state response of a system with impulse response $h[n] = (\frac{j}{2})^{n} u[n] $ to an input signal $x[n]=\cos(\pi n) u[n]$. However, I have no idea how to handle this complex $j$ in the convolution. I want someone to confirm if my solution is correct or not. If it is incorrect please tell me where I am getting wrong.

I start with calculating the Z transform of $h[n]$.
$$\begin{align}
H(z) &= \sum_{n=0}^{\infty}h[n] \, z^{-n} \\
 &= \sum_{n=0}^{\infty}\left(\frac{j}{2}\right)^{n} \, z^{-n} \\
 &= \frac{1}{1-\frac{j}{2}z^{-1}} \\
\end{align}$$
such that $|z| > \frac{1}{2}$.

Now the z transform of $x[n]$ is ,
$$\begin{align}
X(z) &= \sum_{n=0}^{\infty}\cos(\pi n)z^{-n} \\
 &= \sum_{n=0}^{\infty}\Big[\frac{e^{j\pi n}+e^{-j\pi n}}{2}\Big]z^{-n} \\
 &= \frac{1}{2} \left(\frac{1}{1-e^{j\pi}z^{-1}}+\frac{1}{1-e^{-j\pi}z^{-1}}\right) \\
 &=\frac{1}{1+z^{-1}} \\
\end{align}$$

The convolution output in the z domain is $Y(z)$.
$$Y(z) = H(z)X(z) = \frac{2}{(2-jz^{-1})(1+z^{-1})}$$
Applying the final value theorem, I get, steady state output $y_{ss}$ as
$$y_{ss} = \lim_{z \to 0} \, zY(z) = 0$$.

I definitely think that I am doing something wrong over here. Please help. I don't know how to handle this $j$ in the convolution operation like this, please help me in that too.


texts: Is $x[n]=(-1)^{n^2}$ periodic? The answer said no, but when I draw it on a graph, it seems to be periodic, with fundamental period equal to $2$.


texts: How to generate random data with a specific bandwidth

texts:
I generate some random data (bits, actually, using MATLAB's randi) and then I convert such bits to BPSK (1 and -1). After that, I use a RRC pulse (roll-off factor of 0.35, 8 symbols and 4 samples per symbol) to create the waveform.

The bandwidth of the pulse-shaped BPSK then would be ($\beta$ is the roll-off factor):

$$
BW = R_S(1+\beta)
$$

My problem here is how to determine $R_s$ (data rate). I mean, I'm using randi, not an actual data source so initially I tried to make that value up. I suppose $R_s=1MHz$, after pulse shape the sampling frequency is $f_s = sps*R_S = 4MHz$ ($sps=4$ because of the 4 samples per symbol stated above), then the bandwidth should be something like $BW=(1+0.35)1MHz=1.35MHz$ and tried to plot the DFT of the pulse-shaped sequence for a final sampling rate of $4 MHz$:

As you can see, the bandwidth is nowhere near $1.35 MHz$.

So these are my questions:

How can I manipulate/control $R_S$
What's wrong with my calculations?

Thanks!


texts:
Many spectroscopic detectors used to study light absorbance as a function of time. These detectors cab sample data at 160 to 250 Hz. There is an option of choosing lower sampling rates such 80, 40, 20, 10 Hz to decrease noise. The manual uses an interesting term called "data bunching" when lower sampling rates are chosen. I asked the engineers and he clarified that it is akin to block averaging. The data is still being sampled at 160 Hz, however digitally it is being downsampled to 80, 40 Hz etc.

Just for the sake of simulating data bunching I would like to downsample data simulated at 200 Hz to 50 Hz by averaging blocks of 4 and plot it versus time. For example, if y=[1,2,3,4,5,6,7,8,9,10,11,......], I would like to do averages of (1,2,3,4), then (5,6,7,8), and so and plot it versus t=[0:1/50:60], so that the downsampled data appears to be sampled at 50 Hz."

Is there a simple syntax for Matlab for that?

Thank you.


texts: minimum oversampling factor for D/A converter

texts:
Consider a D/A converter for audio signals consisiting of a zero-order-hold interpolator followed by a continuous-time lowpass filter with positive passband between 0 and 20KHz and stopband starting at fa= 40KHz.
Assume we want to convert a digital signal originally sampled at 16KHz. What is the minimum oversampling factor that we need to use?
for getting 16 khz i used 2 as my oversampling factor which seems not right. can you elaborate on top of it ?? i used 2 because (40khz/20khz)


texts:
This might be a naïve question, are these correct statements?

Both amplitude and frequency modulated radio signals nowadays use quadrature modulation and demodulation as a mean to transfer and receive radio signals.
Whenever quadrature modulation is used the sampling rate should be equal to bandwidth.


texts:
I'm very new to this stuff, so please excuse the dumb sounding terminology.

I'm trying to capture the data from my elster smart hydro meter. How can I find its frequency (I know its between 902 and 928 MHz and I think there is frequency hopping)?  I have an rtlsdr dongle (2 MHz sample rate) and gnuradio and a raspberrypi.

One idea I had was to listen for an hour on bands:

Listen on 902 for an hour
Listen on 904 for an hour
...
Listen on 928 for an hour

Then, I would have to record only when a "blip" in frequency or amplitude happens.  This way, I would have a few blips and I could then try to analyze them.

Does this sound sensible?

Perhaps there is a device that helps with this?


texts: Norm MPEG-1 Layer III (Mp3) Filter banks distortion

texts:
So, I'm working with the filter banks used in Mp3, in Matlab. I am obtaining quite a huge distortion in the output and I don't really know whether I'm making something wrong.

I've reviewed the literature and I'd say I'm making it properly, so I don't really understand what I'm making wrong.

So I'm basing the work on a filter with 512 coefficients that can be found on page 9-13, here: https://www.mp3-tech.org/programmer/docs/jacaba_main.pdf (I think it comes from a standard so no big deal there, I guess).

I want to make a filter bank with 32 branches. I want to, based on that Low Pass filter prototype, calculate the 32 branches that will cover the entire bandwidth, so I make:

(note "h" is the variable with the filter coefficients)

branches=32;
hh=zeros(branches-1,length(h));
n=0:511;
for k=0:1:branches-1
   hh(k+1,:)=h.*cos(((2*k+1)*pi*(n-16))/(2*32));
end

That one for the generation of the analysis filters coefficients and the following one for the synthesis filters:

branches=32;
hh=zeros(branches-1,length(h));
n=0:511;
for k=0:1:branches-1
   hh(k+1,:)=h.*cos(((2*k+1)*pi*(n+16))/(2*32));
end

As per the way of applying the filters to the input signal and to reconstruct the output signal:

yy=zeros(branches,floor(length(wav_in)/32)+1)
for k=1:1:branches
  yy(k,:)=decimate(filter(hh(k,:),1,wav_in),branches);
end

This will provide a matrix with all the outputs of the shifted analysis filters (yy).

Now, in order to reconstruct the signal, with the synthesis filters:
(Note it's a different function so we will not have problems with the variables names)

yy = zeros(1,length(xd(1,:))*32)
for k=1:1:branches
  yy=yy+(filter(hh(k,:),1,upsample(xd(k,:),branches)));
end

The filter responses look good (it seems like that to me, at least):

If I use as an input a 1 kHz tone, I have:

The output is "After". As you can see the signal is very distorted. In general, I am following the approach in "How sound is processed in MP3 player?" by T. Dutoit and N. Moreau.

I think it is not working and honestly, I don't have a single clue on what I'm doing wrong. (Maybe how I'm applying the filter banks?).


texts: Which parameters should I take care of while converting .au to .wav for Genre Classification

texts:
I am learning to develop Music Genre Classification models. I have a dataset in which files are in ".au"  format, which I need to convert into ".wav". I used SoX (Sound eXchange) to convert it. With a simple:

  sox input.au input.wav

the files are converted smoothly. Which parameters can be lost doing this, which can affect the accuracy of my model?


texts:
I have a simulink model of zigbee over a Rayleigh fading channel.

The modulation in the transmitter part is O-QPSK modulated baseband.

Most of the examples didn't add the RF frequency after the baseband modulator and I can't understand why.

And what is the effect of cancelling this part in simulink?

However, when I try to simulate the RF band after baseband modulator using up converter, the output of it was real and the Rayleigh multipath fading block didn't accept it.


texts: How to analyze audio input/spectrum correctly

texts:
I am quite new to Java and Signal Processing, but I was assigned a project dealing in audio processing. My topic given to me is a game that has a component of analyzing a song (any given song) and outputs data depending on the frequency currently being played (real time). ie: as the song plays, it outputs the current frequency (every second it outputs the current frequency).

I have been told on stackoverflow to use FFT. they say "just do a FFT" but that means nothing to me? HOW do you do an FFT? I have read tutorials, and basically understand what it is, but have no clue on how to implement it as in:

what is the data type of the audio file most suitable for such processing?
what exactly is the input of the FFT
how do I interpret the results

Can anybody suggest a simple to follow walk through/tutorial on how to process an audio signal? Additionally, if anybody knows a good implementation of FFT for Java, I would appreciate the suggestions.


texts: Circular Convolution Matrix of $ {H}^{H} {H} $

texts:
We all know that Discrete Fourier Transform (DFT) corresponds to circular (not linear) convolution. That is to say, if $x(n),h(n)$ and $y(n)$ is the original signal, the filter and output signal in domain and $X(\omega),H(\omega),Y(\omega)$ are their counterpart in Fourier domain, then if we want $Y(\omega) = H(\omega)X(\omega)$ we must have $y(n) = h(n) \circledast x(n)$, where $\circledast$ is circular convolution (modulo the length of x).

If $h$ is the linear operator that stands for circular convolution with $h(n)$, then I think $h^T$, the transpose of $h$, is a circular convolution plus a circular shift. My question is, is $h^Th$ also a circular convolution of some kernel?

The motivation for thinking about this is to look for a fast method to compute $(I+h^Th)^{-1}$ through FFT. I know it seems common to introduce FFT to compute this, but how exactly when h is a convolution kernel?

Thanks in advance,
Bob


texts:
A receiver receive multiple signals from multiple sensors, the received signals is shown in the figure below :

I'm using MATLAB and I don't know how to separate the mixed signals. Are there any techniques or methods used to separate mixed signals ?


texts:
Normalized correlation is used to measure how similar are two signals. I can understand similarity visually but I haven't seen a mathematical definition for the similarity of 2 signals anywhere. So I have 2 big questions that are bothering me:

Is there a mathematical definition for how similar two signals are?(similar in same fashion of visually similar)
With that definition, is there a proof that shows correlation is maximum between similar signals and not any other signal?

EDIT:

Okay so I thought about 1 and I have a mathematical definition for similar signals. Basically s1 is similar to s2 if they are proportional, that is s2 = a.s1. So we can focus on question 2 now :). A proof that says out of all functions out there, the correlation of s1 and s2 is maximum only if s1=k.s2


texts: Evaluate DFT-downsampler-upsampler-IDFT block diagram

texts:
I am trying to solve the above question. I am not sure how to proceed. I know the formula for 64 point DFT of $x[n]$.

$X[k]=\sum_{n=0}^{63} x[n] e^{-j2\pi nk/64}$

But how can I find $R[k]$ and $Y[k]$? Can anyone please tell the relation?


texts: What techniques are available for correcting constellation rotation due to phase ambiguity?

texts:
In order for a receiver to recover a baseband signal, it needs a carrier signal equivalent to that used by the transmitter for upconverting the original baseband signal. Unless pilot tones are used, a receiver doesn't have the original carrier available and has to extract it from the signal itself, with a technique such as a phase locked loop.

However, the phase of the carrier signal to be recovered is often ambiguous to the receiver: Unless there is some asymmetry in the transmission (rotationally asymmetric constellation, non-uniform distribution of symbols), the recovered carrier may end up at one of several phase offsets.

A typical 4-way symmetric constellation like QPSK causes a phase offset of nπ/2 radians where n may be 0, 1, 2 or 3. This phase offset then rotates the received symbols around the origin in one of four different ways:

What techniques are available for decoding the symbols regardless of this rotation? I can think of seven, but all have drawbacks:

Transmit a pilot tone (the original carrier, or a signal derived from it), eliminating the phase ambiguity. Wastes bandwidth and power.
Use an asymmetric constellation which aids the carrier recovery algorithm, eliminating the phase ambiguity. More complex to decode, less bandwidth/power efficient.
Use a symbol mapping where the symbols reside on a rotationally symmetric path around the origin, and encode the data as the distance along that path between successive symbols. Otherwise seems like an elegant solution, but any single incorrectly received symbol causes two errors.

Every once in a while, transmit some unique sequence ("mid-amble") which allows the receiver to easily de-rotate the constellation. Slower aquisition, decreases bitrate.
If the bit error rate is high, rotate the constellation after X symbols. Slower aquisition.
Decode the same constellation in all possible ways at the same time, and pick the output with the lowest bit error rate. Wasteful of processing resources.
Use a symbol alphabet designed in such a way that it works with every possible phase offset. Large overhead, which reduces the bitrate.

While some of these approaches are less practical than others, none are completely satisfactory. How is this issue typically handled? Can the channel coding be designed to be rotation-agnostic without sacrificing bitrate?


texts:
I would like to create complex normal Gaussian noise with dimensions $(M,N)$. The noise should be zero mean and the variance should be equal to one.

How can I do so?


texts: How to understand the sum of all "fourier frequencies"?

texts:
I got the data of an acceleration sensor to analyze. It consists of special terms of 30 Hz, 60 Hz and 120 Hz. In the following you can see in the first plot the 60 Hz data and in the second one the spectrum:

The plotted values are the results of a FFT. My question now is: How to understand the spectrum?
The 60 Hz plot is clear. A FFT was operated and all the values were extracted which correspond to the 60 Hz signal. This is (or should be) the upper plot.
The spectrum is allegedly the value across the whole frequency range - this I do not quite understand. How can I make use of this or how can it physically be interpreted? Is it finally kind of a total amplitude? Is it the origin signal (I don't think so..)? Is it even possible without an inverse transformation?
Or is it just what it is: The sum of all (fourier) frequencies without any higher meaning? I'm not sure how to name the signals/peaks in the frequency domain.


texts: How to plot magnitude response using $\tt freqz$ in MATLAB if I have a transfer function without a denominator

texts:
So I have the transfer function:

$$H[z] = 1 + \sqrt{2}z^{-1} + z^{-2} $$

And I have to evaluate $H(e^{j\omega})$ for $\omega= 0, \pi/4, \pi/4 \ldots$

I have done the calculations manually using Euler's formula, but now the assignment is asking me to compare these plots with the plots using freqz in MATLAB. I can't seem to find instructions on how I can do that with this type of transfer function.


texts:
So, When we take the FFT of any Composite or Single Sine Wave we get exact frequency on x-axis of the plot.
The point where we get the original frequency in FFT is depend upon the Sampling Rate and the Length of the actual signal, i.e

If there is Sine wave of 100KHz and the Sampling Frequency equals to 1MHz, and If we are plotting the 10 Oscillations i.e t = 10/f then the length of the Signal would be 100.
and If we plot the FFT of that signal than the First point in FFT represent 10KHz i.e 1MHz/100 = 10KHz. So the actual signal frequency will be plotted on the 10th point of FFT graph, ( 10KHz*10 = 100KHz ).

This is how we can see the Frequency of our actual signal in Frequency domain.

but what about an Image ?

Consider a binary 8x8 image ,

image = [zeros(8,4) ones(8,4)]

image =

     0     0     0     0     1     1     1     1
     0     0     0     0     1     1     1     1
     0     0     0     0     1     1     1     1
     0     0     0     0     1     1     1     1
     0     0     0     0     1     1     1     1
     0     0     0     0     1     1     1     1
     0     0     0     0     1     1     1     1
     0     0     0     0     1     1     1     1

The FFT will be calculated for each row and for each column which mean the number of samples to calculate each FFT will be 8.

I know that the FFT values have no frequencies, it has only complex amplitudes, then how does the FFT is plotted for image, How can identify the actual frequency like i did in case of Sine wave by dividing the Fs with length of Signal ?

Here is 1D FFT of the Signal,

x = [0 0 0 0 1 1 1 1]; %what are the frequencies here

    % Samples = 8

    f = fft(x)
    plot (abs(f))

Can somebody explain me please what are the frequencies in the FFT plot ! ???
I just need one good example that explain the graph of FFt of this signal like i did for a sine wave.


texts: How to remove 50 Hz frequency noise from a PCM file?

texts:
Are you kind to tell me the odds or the means by which should I grab a clean signal with the $~50 \mathrm{Hz}$ hum removed using just programming?

I managed to make a program in Visual-C that composes a sinusoid and overlaps it over a signal in a file. The file is recorded using a microphone. At recording time using a PC I get the frequency hum of the AC, with the phase with which it overlaps the signal. I see that the noise's frequency is not influenced and remains constant over time.


texts: What is the estimator used in this paper for system identification?

texts:
The paper System Identification using Symbolic Chaotic
Sequence proposes EM-UKS estimator for system identification of a linear FIR channel when excited by non linear input.

In Fig 3 of the paper there is a comparative plot of system identification of FIR model

$$ y[n] = H^T x[n] + w[n] $$

Where $x[n]$ is a chaotic input and $w[n]$ is AWGN with unknown variance.

Performance is compared using CRLB vs MSE when the FIR system is driven by (a) chaotic deterministic numerical input, (b) chaotic quantized input (called as symbolic input), (c) filtered Gaussian input, and (d) PRBS input.

Q1: What is the estimation technique when the input is white Gaussian and PRBS ? Is it Ordinary Least Square as they mention that they are comparing with the CRLB of non-blind. So, OLS is a non-blind technique.

This is how I implemented when the input is white noise:

 h = [1    0.65   -0.2];  % MA channel coefficients
    x = randn(1000,2);  % white noise input
    u = filter(h,1,x);
    y = awgn(u,10,'measured'); % adding noise w of SNR =10dB
    X = [y,ones(n,1)];
    [b,C]=lscov(X,y)

Q2: I am not sure how to implement using PRBS. Can somebody please provide the code?

Q3: Is the system identification using EM-UKS when the input is chaotic and symbolic proposed by the Authors blind or semi-blind and why?


texts: Use wavelet transform to extract a waveform of certain frequency

texts: how to apply wavelet transform method to extract alpha waveform( higher and lower band frequency known) from a given known signal ?


texts: How does google automatically create 3D cityscapes?

texts:
In the last years, Google models not only are major cities, but also suburban and rural areas (google video)

I read that there are some tridimensional model building algorithm here.

How could such algoithm work? Stereovision? Multiple photos?


texts: Reconstruction of an oversampled signal with sub-nyquist analog filters

texts: I have a baseband, bandlimited signal of 100 Hz.  I sampled it at 2000 Hz.  Now for reconstruction if I pass them (the samples) through an analog filter of say 200 Hz, would the reconstructed signal be same as the original analog signal.  In books they pass it through a LPF with cutoff frequency of 1000 Hz.  I am questioning like what happens if I pass through various LPFs of cutoff frequencies above 200 Hz i.e. 300 Hz, 500 Hz, 1000 Hz.  Would there be differences or not?


texts: Is initializing a digital filter's output with no "momentum" a non-trivial task?

texts:
I'm working on implementing a filter with a very slow step response. This filter is implemented as a cascaded second-order-section filter (transposed direct form 2). I'm using the output of this filter as the input to a controller. Thus I'm trying to slow down how quickly the controller set point is able to change.

I'm running into an issue where I would like to initialize the set point of this controller. In order to do this, I need to provide initial conditions to the filter.

Let's assume I have a 7th order filter implemented in SOS stages as described above. Is it is a trivial task to find initial conditions such that I can specify the output but also have it such that the there is no "momentum" in the filter for it to drive from its initial output?

If this were an analog filter, I am essentially trying to specify that y(0) = constant, while y'(0), y"(0), ... etc. all equal zero.

I've never attempted to do something similar with a digital filter. Is this trivial? Is this non-trivial? Are there any references on the subject?

Thanks for the help!

Edit: So I've changed up my system design such my filter output isn't the setpoint, but rather a deviation from a setpoint. This allows me to simply zero the filter to achieve what I was originally trying to do. However, my question still stands for a matter of interest.


texts: What is the best way to detect rectangular pulse for AFSK demodulation?

texts:
I've got a WAV file with a rectangular pulses coding zeros and ones. By specification, a 1 bit is a 320 microseconds wide rectangle, and a 0 bit is a 640 microseconds.

So basically the idea is to detect "zero points" where the signal comes over the time axis. When I get it, further processing is trivial.

The naive approach is to iterate samples in the signal and find points where sample * sampleNext < 0.

For low-noise files with this approach produces rectangles quite close to the specified ones, but for high-noise ones I get all sorts of rectangles from 20 to 1400 microseconds in width.

Is there a better way to detect zero points in a noisy rectangular pulse?


texts: Adaptive Delta Modulation For Speech Signals

texts:
I need to implement an adaptive delta modulation encoder and decoder using matlab for my term project. How can I code a good adaptive delta modulation? How can I change delta(or sigma) to follow speech signals better? After that How can I decode it to recover original signal? I am using an algorithm which has that main idea: if three successive samples are equal, I increased delta with a constant k. It is useful but not enough.

Here is used codes for adaptive delta modulation:

    function [ cn ] = adm_enc( signal )
delta_min = 0.6250/5; % minimum step size
k=1.5;
m = 0.85
% scaling constant
L = length(signal);    % length of input signal
Mq = zeros(1,L);   %aproximated or quintized signal
dq = zeros(1,L);   %quantized error or difference between original signal and aproximated signal
cn = zeros(1,L);   %encoded output as a binary signal
delta=ones(1,L);
for n=2:L

    d = signal(n) - Mq(n-1); % error or difference between input (original) signal and approximation
    if d>0  % if error is greater than 0
        dq(n)=delta_min; % equate output to delta_min
    else
        dq(n)=-1.*delta_min; % equate output to -delta_min
    end

    if dq(n)==dq(n-1) && dq(n-1) == dq(n-2) % if two previous outputs are equal
        delta(n)=k.*delta(n-1); % scale step size
    else
        delta(n)=delta_min; % otherwise equate output to min step size
    end
     Mq(n) = Mq(n-1) + delta(n).*dq(n); % calculate approximation signal
end
for i=1:length(cn) % encode the output as a binary signal
    if dq(i)==delta_min
        cn(i)=1;
    else
        cn(i)=0;
    end
end

end

Codes used for adaptive delta demodulation (decoding process):

function [ signal ] = adm_dec( cn )
delta_min = 0.6250/5;   % minimum step size
L = length(cn);     % length of input signal
k=1.5;        % scaling constant

signal = zeros(1,L);  % initializations
delta=ones(1,L);
for i=1:length(cn) % decode binary input as output of adm
    if cn(i)==1
        Mq(i)=delta_min;
    else
        Mq(i)=-1.*delta_min;
    end
end
for n=2:L

    if Mq(n)==Mq(n-1) % if two sequential input values are equal
        delta(n)=k.*delta(n-1); % scale step size
    else
        delta(n)=delta_min; % otherwise equate step size to min step size
    end
 signal(n) = signal(n-1) + delta(n).*Mq(n); % calculate output of adm
end
end

After decoding process I am using a lowpass filter to remove unwanted high frequency harmonics.


texts: How to deal with different audio formats for audio classification?

texts:
I am working on an audio classification problem statement to classify between two audio classes. I have collected samples from jotform, they are providing audio widget to collect .wav audio but it turned out that widget is storing data in .mp3 format :
In my problem statement, Classification classes are from different formats :
class A : all the 100 samples are in .mp3 format ( jot form collection )
class B : all the samples are in .wav format

I am adding both types of classes' sample here :
Class A sample audio  : it's in .wav format

Details :

General
Complete name                            : count_class_1.wav
Format                                   : Wave
File size                                : 1.41 MiB
Duration                                 : 15 s 445 ms
Overall bit rate mode                    : Constant
Overall bit rate                         : 768 kb/s

Audio
Format                                   : PCM
Format settings                          : Little / Signed
Codec ID                                 : 1
Duration                                 : 15 s 445 ms
Bit rate mode                            : Constant
Bit rate                                 : 768 kb/s
Channel(s)                               : 1 channel
Sampling rate                            : 48.0 kHz
Bit depth                                : 16 bits
Stream size                              : 1.41 MiB (100%)

Class B sample audio Jotform says it's .wav format but only extension is .wav, file is .mp3 format.
Details :
General
Complete name                            : count.wav
Format                                   : MPEG Audio
File size                                : 183 KiB
Duration                                 : 9 s 360 ms
Overall bit rate mode                    : Constant
Overall bit rate                         : 160 kb/s
Writing library                          : LAME3.99.5
FileExtension_Invalid                    : m1a mpa mpa1 mp1 m2a mpa2 mp2 mp3

Audio
Format                                   : MPEG Audio
Format version                           : Version 1
Format profile                           : Layer 3
Format settings                          : Joint stereo / MS Stereo
Duration                                 : 9 s 360 ms
Bit rate mode                            : Constant
Bit rate                                 : 160 kb/s
Channel(s)                               : 2 channels
Sampling rate                            : 48.0 kHz
Frame rate                               : 41.667 FPS (1152 SPF)
Compression mode                         : Lossy
Stream size                              : 183 KiB (100%)
Writing library                          : LAME3.99.5

What i am doing before feeding it to neural network :

Downsampled to 16kHz,  the level of the signal was normalized
Segmented in audio segments, by removing the silences in the signal
High filtered (pre-emphasis filter). Audio segments were then
divided    in non-overlapping Hamming-windowed frames of 25ms.

Now after this extracting various features from each frames including MFCCs, Zero-crossing rate (ZCR), Formants (the first 4) etc and at last feeding all these features to simple dense layer neural network or CNN (spectrogram format).
But the problem is both classes' audio files are in a different format class A audio samples are in .wav and class B audio samples in .mp3 and there are high chances that network can be biased towards format or audio encoding.
Solutions I have thought :

Downgrade all files to 16kHz frequency ( But format issue is still there)
or convert all files into one universal format, for example I am converting all .mp3 files to .wav files then all files will be having same format, I could convert one into another, but I am afraid I will lose quality on the converted files.

My doubt is if I downsampled both classes audio samples (.wav and mp3 both) to 16kHz will my neural network still be format biased?
What would be a good strategy for me for Audio classification when audio files are in different formats?


texts:
Can the inverse system of a stable system be unstable?

For the class of LTI systems, the criteria for stability of a system with impulse response $h(t)$ and systems function $H(s)$ are:

$h(t)$ be absolutely integrable.

or in s-domain:

$H(s)$ have the $j\omega$ axis (or $s=0$) in its convergence region, and do not have any derivatives of impulse in it (which means for rational system functions like $P(s)/Q(s)$ the order of the nominator be less than or equal to the denominator).

So I thought that if we consider the following system
$$H(s)=\frac{s-2}{s^2-1}$$
with $ROC:s>1$, it is stable, but its inverse $H_i(s)=1/H(s)=\frac{s^2-1}{s-2}$ with $ROC:s>2$ has the first derivative of delta in it and thus is not stable.

Is my reasoning correct? and is there any way to answer the question for all of the systems (not only LTI)?


texts: Can use of Fourier transform be minimized completely with the help of Laplace and Z transform?

texts:
Fourier transform has different types like continuous Fourier transform (CFT), Discrete time Fourier transform (DTFT) and Discrete Fourier transform ( DFT).

CFT can be used in case of continuous aperiodic signals  while DFT for discrete aperiodic signals .

On the other hand, Laplace transform can be used in case of continuous signals and Z transform for discrete signals.

So I want to ask that can use of Fourier transform be minimized completely with the help of Laplace and Z transform?


texts:
I have a signal from a PWM inverter that was sampled at 3,84 kHz. The PWM has a switching frequency of 5 kHz. The pwm signal is feeding an induction motor. If I low-pass filter the PWM signal it should result in a pure sinusoid: A*cos(2*pi*60*t+phi) of 60 Hz, which is the reference signal to the pwm.

But the sampling frequency fs=3.84KHz does not respect the Nyquist theorem that says that the sampling frequency should be twice the highest frequency of the signal, that is, it should be 2*5KHz = 10KHz. So the pwm signal is under-sampled.

By just filtering the sampled signal I believe that aliasing will happen. Right? Then I would not be able to obtain the purely sinusoidal reference.

If I linearly interpolate the PWM sampled signal so that it would go from fs=3.84KHz to fs=10KHz then, I would make the sampling rate equal to the Nyquist frequency. Now, if I filter it, aliasing would not happen anymore. Is this right?

If not, I was wondering if there is any way to filter the pwm signal and obtain the purely sinusoidal reference without aliasing. Interpolation? Resampling? I know a priori that the filtered pwm signal should result in a sinusoid, maybe that could help to reconstruct the sinusoid signal?

Thank you,
L.


texts: When you are transforming a signal in to a frequency domain using both DFT and DCT, say for a function sin(x), how the spectrum will be? will both frequency values (of DCT and DFT) same? Can anyone explain the values of the frequencies for the function sin(x) (obviously the frequency should be 1/2π)


texts: Diagonal vs non diagonal processing for audio denoising

texts:
I am going through a technique for audio denoising by block thresholding. Here is the paper:

http://www.di.ens.fr/~mallat/papiers/AudioBlock.pdf

According to the definition in the paper for diagonal estimators,
Simple time-frequency denoising algorithms compute each attenuation factor only from the corresponding noisy coefficient and are thus called diagonal estimators.

and for non diagonal estimators:
To reduce musical noise as well as the estimation risk, several authors have proposed to estimate the a priori SNR with a time-frequency regularization of the a posteriori SNR . The resulting attenuation factors thus depend upon the data values for in a whole neighborhood of (l,k).

I am not quite able to comprehend these definitions, and the difference.
The paper also claims that non-diagonal processing is better than diagonal processing techniques.  Could someone explain the difference in a layman's terms?


texts: Hilbert transform of sinusoid -- apparent contradiction

texts:
The arrow "$\xrightarrow{\mathcal H}$" denotes a Hilbert transform:

  $$\cos(\omega t)\xrightarrow{\mathcal H} \sin(\omega t)$$

happiness.

But

  $$\cos(\omega t) = \cos(-\omega t) \xrightarrow{\mathcal H} \sin(-\omega t) = -\sin(\omega t)$$

sadness.

This is a contradiction. What have I done wrong?


texts:
Given a variable in time $u_{k}$, and an other variable f which represents the frequencies in a range [a,b]:
$$|\mathcal F \left \lbrace u_{k}\right \rbrace |^{2}=f^{-5/3}\tag{1}$$
where $\mathcal F$ stands for fast Fourier transform.
Now, I want to find $x$ knowing that:
$$|\mathcal F \left \lbrace u_{k}^{2}\right \rbrace|= f^{x}\tag{2}$$
I can isolate $x$ as:
$$x=\frac{\ln(|\mathcal F \left \lbrace u_{k}^{2}\right \rbrace |)}{\ln(f)}\tag{3}$$
I can find $u$ using (1):
$$u=\mathcal F^{-1}(\sqrt{(f^{-5/3})}) \tag{4}$$
On the consequence $x$ is:
$$x=\frac{\ln(|\mathcal F \left \lbrace ( \mathcal F^{-1} \left \lbrace \sqrt{(f^{-5/3})} \right \rbrace )^{2} \right \rbrace|)}{\ln(f)} \tag{5}$$
Is there any way in which I can simplify $x$?? I am stuck with this problem for a lot of weeks...


texts: Segmentation of overlapping noisy parallelograms in a binary image

texts:
Edited.

Previously this question was named "Segmentation of overlapping pulses in a binary spectrogram" and it was stated in slightly different way. I'm apologise to those users, who were affected by reformulation of the question.

Problem.

There are a set of binary images, that contain arbitrary set of noisy parallelograms. The height and width of objects can vary in a wide range. Some parallelograms can overlap. Set of typical images is listed bellow.

I need an algorithm to segment objects on those images in order to prepare them to extraction of connected components. There is one restriction on the segmentation algorithm - shape of the objects should be preserved during segmentation.

Attempted solutions.

Morphological erosion.
Morphological erosion don't work well in this case. In order to separate three overlapping rectangles in the last image from typical set, I needed structuring element so big, that it erases some small objects from other images.

Boundary extraction and Hit-or-miss transform with corner-like structuring elements.
I have tried detect corners of parallelograms, in order to find regions of intersection. But pattern matching of boundary with corner-like structuring elements turned out to be a bad idea (boundary doesn't have the shape of a corner in regions of intersection).

Some other morphological transformations.
I have tried playing with combinations of original and shifted images.
$A - [A - [(A)_{(-x, 0)}\cap(A)_{(+x, 0)}]]$, where $A$ is an original image and $x$ is a shift along $x$-axis. This transformation can be applied for separation of objects on the last image.
But it messes up second image.

Question.

Is there good general approach to such problem?
Any ideas, hints, links, articles will be much appreciated.
Thank you.


texts: 3D reconstruction of an image based on depth of intensity levels?

texts:
Is there anyway of segmenting objects based on how far they are from the viewer?

Can color values assess this sort of a thing for us?
How will intensity levels help in determining how far the object is from the viewer?

Another image:


texts:
ARMA Model

$$y_t = \sum_{k=1}^p a_{k}y_{t-k} + \sum_{k=0}^q b_{k}\epsilon_{t-k}$$

where $b_0$ is usually 1 and $y_t$ is observable.

General Linear Filter

$$x_t = \sum_{k=1}^p a_{k}x_{t-k} + \sum_{k=0}^q b_{k}y_{t-k}$$

$y_t$ is observable (input), $x_t$ is filter output, and there is a feedback loop via $x_{t-k}$.

ARMA is a model, but from filtering perspective it looks like a filter for $\epsilon_t$, by simply moving $y_t$ to the right side of the equation and $\epsilon_t$ to the left side of the equation, then normalizing by $b_0$ (usually 1 so no effect).

Is a model always a filter at the same time?
Given a linear filter can we directly infer the underlying process model by simply rearranging the terms?

For example given an FIR filter to recover $x_t$ from $y_t = x_t + \epsilon_t$

$$\hat{x_t} = \sum_{k=0}^3 b_{k}y_{t-k}$$

Can we say that the whole process is $AR(3)$ with Gaussian errors given the filter is optimal in MSE sense?

$$y_t = \frac{b_{1}}{-b_0}y_{t-1}+\frac{b_2}{-b_0}y_{t-2}+\frac{b_3}{-b_0}y_{t-3}+\epsilon_t$$

This doesn't look correct.

I think the following information is relevant, but didn't really clarify it for me.

https://www.mathworks.com/help/signal/examples/linear-prediction-and-autoregressive-modeling.html

  Linear prediction and autoregressive modeling are two different problems that can yield the same numerical results. In both cases, the ultimate goal is to determine the parameters of a linear filter. However, the filter used in each problem is different...In the case of linear prediction, the intention is to determine an FIR filter that can optimally predict future samples of an autoregressive process based on a linear combination of past samples. The difference between the actual autoregressive signal and the predicted signal is called the prediction error. Ideally, this error is white noise. For the case of autoregressive modeling, the intention is to determine an all-pole IIR filter, that when excited with white noise produces a signal with the same statistics as the autoregressive process that we are trying to model.

So according to this text, the corresponding model should actually be $AR(4)$

$$y_{t+1} = \sum_{k=0}^3 b_{k}y_{t-k} + \epsilon_t$$

  two different problems that can yield the same numerical results

Are there situations where they wouldn't?


texts: Direct Digital Synthesis - Super Sampling - Unknown Harmonics

texts:
I'm using a Xilinx FPGA (Virtex) with 4 DDS cores (each supplied a 250MHz clock) used in parallel to provide a samples to a DAC38J82IAAV from TI, 16 bit DAC running at 1 Gsps. The four cores super sample (interleave their samples) to provide samples at 1 Gsps (250MHz clk * 4 cores = 1 Gsps) for the DAC. I'm trying to output frequencies between 20MHz and 500MHz with the DAC.

The DDS cores are configured in rasterized mode with modulus of 10000. I set the Phase Increment (PINC) to be (desired_freq * 10000)/250 and the Phase offset for each core to be 0, PINC/4, PINC/2, 3*PINC/4.

This works great for generating frequencies above 250MHz, but for frequencies below 250MHz, I see harmonics at Fout, 2*Fout, 3*Fout and so on. I would expect to see harmonics at Fout, Fsample-Fout, Fsample+Fout and so on, which I do see for frequencies above 250MHz.

Why am I seeing multiple harmonics at Fout interval for frequencies below 250MHz?


texts: How is the sound converted to matrix in Matlab?

texts: I am using the audioread(filename,y,Fs) function of Matlab and it converts an audio file to a matrix. I want to know how is each value of that matrix generated. Is it possible to produce a specific sound like the sound of a guitar by giving your own values to the matrix and then sounding it using the sound() function?


texts: Is it actually possible to filter out the negative frequencies for the baseband signal is we take into consideration that the filter's impulse response is symmetric around the zero frequency?


texts: The difference between convolution and cross-correlation from a signal-analysis point of view

texts:
I am trying to understand the difference between convolution to cross-correlation. I have read an understood This answer. I also understand the picture below.

But, in terms of signal processing, (a field which I know little about..), Given two signals (or maybe a signal and a filter?), When will we use convolution and when will we prefer to use cross correlation, I mean, When in real life analysing will we prefer convolution, and when, cross-correlation.

It seems like these two terms has a lot of use, so, what is that use?

*The cross-correlation here should read g*f instead of f*g


texts: Rectangular or trapezoidal signal filtering. Beginner

texts:
I have the following signal:

I know, that there are 2 states ('High' and 'Low') in my real signal. I need to convert my signal to the sequence of these states (Low from 2 to 5 second, High from 5.5 to 7 and so on).
Could you give me a piece of advice about classic and well established method to extract such signal from mine?
Median filter was as an example. Is it the most classic way to do it? Or you may provide some information for a better approach?
I don't like the median filter approach, because I should rather voluntary define kernel and 2 thresholds. I am searching for a method, with more natural parameters.
UPDATE:
Some knowledge about signal:
Amplitude and mean duration of the state may vary from approx. 1 to 3 fold. But I have some knowledge about CV and skewness/CV. CV~0.5-0.9, skewness/CV~2. Distribution of States duration is gamma-like.


texts: Producing masks from mostly-static-background subtraction when given the background

texts:
My data set contains a number of high resolution greyscale images containing a person's face. A single image containing the background without the face is provided. The background is mostly static in the image, except for some minor changes in lightning from frame to frame. The background pixel intensities can be similar to those of the face. I need an algorithm that would produce a pixel-perfect mask of the face, given that we know what the background looks beforehand.

(the face outline will not necessarily be as prominent as in this example - edge detection does not find it correctly all the time)

A naive approach I've tried is: run a median filter for noise removal, do a diff of image-background, threshold on low values to produce a binary mask, find biggest contour and fill it in.

However, this fails in cases where:

The background is skin-coloured as image subtraction gives near-0 difference in the face region
The background contains a skin-coloured object right beside the side of the face
The image has a very low contrast. The lower the contrast, the more sensitive it becomes to threshold values, requiring fine tuning for every image.

How would you approach this problem?


texts:
I'm new in digital signal processing and having hard time understanding this. By Fourier Transform I mean Discrete Fourier Transform as it's the only one I'm learning.

As far as I know Fourier Transform transforms a signal into an equivalent set of signals in sinusoid form, which when summed gives the original signal back.

If I got it right, a signal could also be represented by other things instead of sinusoids but because sinusoids are easy to process this is preferred and FT is used.

I also understand that with DFT I get amplitude and phase of the sinusoid at given frequency. But why should I care about these properties(amplitude, phase and frequency) of equivalent sinusoids? What's so special about it and does it really have a "natural" meaning?


texts:
I am working on noise reduction and I need to learn how to analyze spectrograms

I mixed a pure speech file with violet noise in audacity and got the following spectrograms:

Matlab version

Sonogram version: (enter link description here)

Spectrogram view in Audacity:

What do all the colours mean and why do they look different? Shouldn't everything have the same colours as in the Matlab version? Or are the exact colours not that important, since the darker pattern at the bottom of each figure still look similar in all of them?

--- EDIT :: Further additions: ---

Here is a screenshot of the spectrogram of noisy speech as well as output of my noise reduced sound file.

The one on the left is noisy signal while one on the right is the one passed through the noise reduction algorithm. Both figures are plotted through the spectrogram function of matlab, called as follows:

spectrogram(data, hanning(128), 64, 128, 16000)

The number 16000 is the Fs value (sampling frequency) returned by the wavread function used to read in the original noisy speech file into matlab. The sound file is a male adult speaking, mixed with violet noise in audacity

--- EDIT 2: ---

Also, here is the same thing in gray-scale, if it helps


texts: Time recovery algorithm and a symbol with samples

texts:
I am working on my graduation thesis. The topic is a receiver implementation in FPGA. I am doing an implementation of symbol timing recovery. For this part I have decided to choose the Gardner algorithm. I have found here discussions about Gardner, Mueller&Muller and other algorithms. All the posts were useful, but I still have the following questions.

I have noticed that my implementation of Gardner algorithm doesn’t work as intended in case of a big initial phase offset. Could you please give a suggestion, what I can do in such case?

I've already started a simulation in MATLAB with generating a signal with N symbols. Each symbol has to have 8 samples (as given by my supervisor).
I did the first part:
Input_signal = randi([0 15],2000,1); % mod order = 16, 2000 symbols

How can I implement the next part of this task, which is to create 8 samples for each symbol?

EDIT 1
I have used CORDIC algorithm and defined amplitude of each samples and phase.
Using them I can define a sample with max amplitude in each symbol.
How can I use this information in implementation the time recovery algorithm?


texts:
I'm coding with python and I just started to use the Hilbert transform from scipy.signal. Consequently, to check the result I got I tried to verify a property of the Hilbert transform:

$H(H(\vec{x})) = -\vec{x}$

So I implemented the following code:

import numpy as np
from scipy.signal import hilbert

# my input vector, an 1D numpy array of real numbers
x = ...

# I consider the imaginary part here as scipy.hilbert
# returns the analytical signal computed with the
# Hilbert transform (imaginary part).
x_ = hilbert(hilbert(x).imag).imag

However I can't retrieve x_ == -x.

Do you know what this could be due to?

Here are plots of x and x_ (first figure) and the difference (second figure):


texts: Choosing a Sampling Rate and a Cutoff frequency

texts:
I have an assignment:

  You wish to generate a pure 1000 Hz tone digitally using a computer. How would you choose a sample rate that assures that you could generate the tone and use the same sample rate to generate a 20 kHz tone? Specify the corner frequency and slope of the filter would you need to assure that the tone is as close to perfectly pure as possible?

My current thought is to sample at 10 kHz because that is well above the Nyquist rate for the 1000 Hz tone and then the first harmonic would be at 20 kHz. I assume I would then need a steeply sloping Chebyshev filter that cuts off just above 20 kHz? Am I on the right track?


texts: Is up-sampling prior to cross-correlation useless?

texts:
Consider a simple case where two signals from two different sensors are cross-correlated, and the time-delay-of-arrival computed from the absissa of the peak of their cross-correlation function.

Now let us further assume that due to the dimensionality constraints of both antennas and the constraints on maximum possible sampling rate, the maximum attainable delay possible is $D$, corresponding to 10 samples.

The problem:

Because of those constraints, your computed delay may vary from any integer value between 0 and 10 samples, that is: $0 \le D \le 10$. This is problematic because what I really want is fractional-delay discrimination of the delay between the two signals impinging on my antennas, and changing the dimensions or the sampling rate are not an option.

Some thoughts:

Naturally, the first thing I think of for this case is upsampling the signals before performing a cross-correlation. However I think this is 'cheating' somehow, because I am not really adding any new information into the system.
I do not understand how upsampling is not 'cheating' in a sense. Yes, we are reconstructing our signal based on its currently observed frequency information, but how does this give one knowledge of where a signal truly started between, say, $D=7$ and $D=8$? Where was this information contained in the original signal that determined that the true fractional-delay start of the signal was actually at $D=7.751$?

The question(s):

Is this truly 'cheating'?

If not, then where is this new 'information' coming from?
If yes, then what other options are available for estimating fractional-delay times?

I am aware of upsampling the result of the cross-correlation, in an attempt to garner sub-sample answers to the delay, but is this too not also a form of 'cheating'? Why is it different from upsampling prior to the cross-correlation?

If indeed it is the case that the upsampling is not 'cheating', then why would we ever need to increase our sampling rate? (Isnt having a higher sampling rate always better in a sense than interpolating a low sampled signal?)

It would seem then that we could just sample at a very low rate and interpolate as much as we want. Would this then not make increasing the sample rate 'useless' in light of simply interpolating a signal to our heart's desire? I realize that interpolation takes computational time and simply starting with a higher sample rate would not, but is that then the only reason?

Thanks.


texts:
I am working on OFDM, and recently I have read a new type of OFDM called  TDS-OFDM, where they guard interval is not neither zeros nor CP. It's a pseudo-noise inserted between symbols. The structure of the TDS-OFDM frame becomes as below :

at the receiver, the equalization should be similar to ZP-OFDM since the convolution is not circular.  That's ok, but the issue I couldn't understand it as follows:
Assume the signal $x$ of length $N$x$1$ to be transmitted, where $X = iFFT(x)$, after adding the PN as guard interval, $X_T = X + PN$ will be of length $N_T$x$1$, where $N_T$ equals to $N$ plus the length of guard interval.
After convolution with channel $h$, the resulted signal $y= h*X_T + n$, where $*$ is convolution operation and $n$ is AWGN.
At the receiver side, there are two methods:

The  guard interval is discarded first and then estimated $X_{2}$ equivalent to transmitted signal $X$ should be $X_{2} = H_{MMSEeq}y_d$, where $H_{MMSEeq}$ MMSE equalizer built based on Toeplitz matrix $H$ of size $N$x$N$, and $y_d$ is the signal resulted from $y$ after deleting the guard interval.
The second scenario is to not discard the guard interval, and build the Toeplitz matrix $H_{2}$ of size $N$x$N_T$ instead of $H$ of size $N$x$N$, and estimated $X_{2} = H_{2MMSEeq}y$ .. the resulted signal is also of size $N$ x $1$ similar to $(1)$

In both scenarios, we get a signal with same size, using only the difference in size of teoplitz matices. the issue that I couldn't understand is the results of scenario $(2)$ is better than that of scenario $(1)$. Is that normal? why that peformance is better however in both scenario we delete the guard interval but with different ways?
NP: Here is a paper talking about the TDS-OFDM


texts:
Looking at DVB-T2 technical specifications I see that sub-carriers spacing has, in the worst case, a value of few hundred hertz, (something like 279 Hz). 32K sub-carriers are used to reach such a low value. I suppose that complex PAPR reduction algorithms plus strong constraints for carrier frequency stability are needed to deal with this number of sub-carriers and frequency spacing. On the other hand, I don't expect that the channel's frequency response would change significantly over few hundreds hertz.

What are the reasons why such a high value of sub-carriers is used?


texts: Difficulty absorbing Idea of interpolation?

texts:
I am trying to develop my understand of interpolation and signal reconstruction and uptill now i have understood that there are 3 commonly studied types of interpolation
1)Zero order hold interpolation
2)First order hold interpolation
3)Ideal interpolation
As far as i am able to understand,interpolation is processing of filling the empty sample space of sampled signal and zero order and first order tell us how samples are connected to each other.
But still i have two main confusions:
1)What is meant by "order" here in interpolation?Is it referring to derivative??
2)Many figures literature sources that i come across don't explicity contain block of interpolation,although some include block of low pass filter or reconstruction filter as shown in block diagram in attached snap of science direct page. In such scenario,how we can differentiate between low pass filter,reconstruction filter and interpolation filter(zero order hold or first order hold etc)


texts: Dynamic loop bandwidth for a Costas loop

texts:
I'm using a Costas loop for carrier recovery. The BER vs SNR (from GNU Radio Simulation) curve for different loop bandwidths (0.03,0.05 and 0.07) is shown in the graph below. It can be seen that the PLL "lock threshold SNR" is about (3dB, 5dB, and 6.5dB) respectively. The implication is lower loop bandwidth values have a lower locking threshold. On the other hand, the lower loop bandwidth values have a longer acquisition period. There is a tradeoff between noise performance and acquisition time. I was thinking of solving this problem by using a Costas loop where the loop bandwidth can be adjusted on-the-fly. I'm more interested in algorithms that can adjust the loop bandwidth without the estimation of SNR. Any suggestions?

Regards,
M.


texts: Do I need an I-Q (in-phase/quadrature) mapper in Simulink with the QAM modulator?

texts:
Would it be correct if I use the Random Integer Generator block with a certain $M$-ary number (say $M=16$) followed directly by the General QAM Modulator Baseband block?
I saw an example where they use an IQ mapper between the two blocks. Is it necessary?

I assumed the QAM block already does the mapping (inherently) because when I read the document it was specified that the input of the QAM modulator block should be an integer between $0$ and $M-1$, with no mention of the IQ  mapping.


texts:
I want to know if there is a generalized way to select a signal from a set of signals. Let me clarify it: I have a number of signals $S = \{S1, S2, S3,...\} $.

Some of the signals are not important to me like, all having all zeros for data, or all same values, or only one datum comes in at the first occurrence then remains zero until the end, or the signal which is always a exactly/mostly straight line parallel to the time axis.

I made some heuristics but I am actually looking for a general scientific and technical methodology to do that. So, in fact I want to have a function $f(S) \rightarrow S1$, which takes a set $S$ and outputs $S1$ (a subset of $S$) after excluding S-S1 signals.
Is there any thing in signal processing or does anyone know some paper/methodology to do this?


texts: FIR filter compensator when using a CIC decimation filter

texts: When decimating a narrow-band signal with a cascaded integrator-comb (CIC) filter, which  FIR  filter is more suitable to compensate the CIC frecuency response?


texts: Algorithm to identify periodic signal spikes

texts:
I'm working with a special chip that allows me to record current draw on phones. This chip logs data with its internal timestamps.

I now need to generate a unique signal that will allow me to map the chip's timestamps with the phone's. Given how phone components are usually complex with low-power states, I've decided to use the flashlight to generate this signal.

Assuming I can rapidly turn on and turn off the flashlight over a period of n seconds, this will generate corresponding spikes in current draw.

What signal processing algorithms can I use to later identify the start/end of this flashlight (current-draw) pattern?


texts: How to compute the Laplace transform of a discrete signal?

texts:
Assume I have a discrete random signal, $f(t)$ for which I want to calculate the laplace transform.

How can I do it in matlab without using sym variables, for example consider I have this discrete signal f(t):

>> t=linspace(0,1000, 10000);
>> f=t.*cos(t);

Is there a way to calculate the Laplace numerically?

After thinking more about the problem I came up with this approach:

t=linspace(0,1000, 10000);
f=t.*cos(t);
syms s;
F_s = symfun(sum(f.*exp(-s*t)), s);
ilaplace(F_s)

Though I am not sure it's plausible.


texts:
Is there any speech enhancement algorithm library?

I need to process a sound to voice recognition, and I want to remove noise from audio source.


texts:
I have a spectra of power spectral density (PSD) (vector (1:1e6)) from experimental data (blue color).

However I want to plot only average value of PSD (red curve).

How can I do it by using MATLAB?

Thank you so much !


texts: How can I connect multiple microphones to my computer (more than 4) and process the outputs independently?

texts:
I am trying to create something like a heat map for sounds originating in a classroom to study the discussions inside the classroom. For this I am instaling directional microphones in various parts of the classroom and inputing the amplitude of sounds captured by them. I need to take the inputs from the microphones and process all of them separately. What hardware/software should I use for this?

PS: I have a mixer board but it'll give me a single channel input. I want separate inputs from all the microphones


texts: Estimating plant parameters from noisy frequecy response data

texts:
I have to estimate the parameters of a 1st order transfer function, namely, the coefficients, through experiment. I ran a few experiments and I have a bunch of input-output data vectors. The experiment was a standard frequency response test, i.e., the inputs were a bunch of different frequency sine waves, around the frequency of our guess of where the pole should be.

The problem is, there is some nasty noise involved. And I mean real nasty. Sometimes the noise clearly has  amplitude as big as the signal itself, sometimes you just can't see any signal at all. Our first approach consisted on bandpass filtering the output and using lsqcurvefit to estimate the parameters of the transfer function. However, it's not working all that great, mainly because of the terrible SNR (simulations with more reasonable SNR worked just fine).

Is there a better way to go about this? I've read about the kalman filter, which supposedly is the optimal filter, which should be good, but it seems to be a state estimator and this is not what I'm looking for, I have a measured state, I need a parameter estimator. Maybe there's a way to use the kalman filter for this? Can you explain/point me in the right direction to learn about this?

If kalman is not the way to go, what other way could we try, rather than butter + lsqcurvefit? Any general advice on dealing with noisy data other than bandpass filtering?

Thanks in advance!


texts: How to compare two speech recognition softwares?

texts:
I am working on building speech recognition software for my company.

In the meantime however, we will purchase some off-the-shelf commercial speech recognizers until the in-house one is ready. My question:
1. How are speech recognizers evaluated?
2. Are there any standardized tests available that can be used to test speech recognizers and determine the better one of the two?


texts: Normalization of a signal with respect to another signal

texts: Imagine that I gave one signal (call it master signal) with respect to which I would like to normalize all the others. How should I treat it mathematically? Any ideas?


texts: Perform non-power-of-two FFT using ARM CMSIS library

texts:
I have 1280 points which I would like to perform an FFT using a M7 cortex with hard floating point engine.

As the title suggest I would like to use the ARM CMSIS library to perform a non-power-of-two FFT.

As I am not familiar with the library functions or FFTs, I would like to know if this is possible based on the available CMSIS FFT functions.

Can i combine or use the available radix-2, 4 and 8 functions to 'build' what I want? What particular FFT algorithms should i be looking at?

Other options I gather would be to zero pad the signal from 1280 to 2048.

The application is for 3-phase Power System Voltage and Current monitoring (50/60 Hz) at 6.4 kHz sampling rate.

I would like to average the Harmonics over time (only the integer multiple of fundamental comp) and compare their magnitudes against industry regulated threshold.
Perform a THD on the harmonics.
I would like to extract the fundamental component for further processing (symmetrical components
calc and unbalance ratios).


texts: Adjust signal to account for increase in gain

texts:
I have 2 signals recorded at 2 different locations along a beam. I excite one end of the beam, and measure the signals at 2 different points.

Within the system I have pre-amp and post-amp gain on both sensors. However, the 2 sensors have different levels of fixed gain - i.e. if sensor 2 does not hear the impulse then I turn up the gain at sensor 2 using the pre- or post-amplifier (sometimes both). Therefore, I have 2 sensors with 2 different levels of gains.

I want to compare the 2 sensors, e.g. measure amplitude change along the beam by comparing the 2 signals. Due to the difference in gain, sometimes sensor 2 has a high amplitude than sensor 1. Therefor calculating difference in gain is not possible.

Is there any way of 'reducing' sensor 2 so that is has the same gain as sensor 1? So I can compare like for like.

I am doing the processing in MATLAB.


texts: Instability Problem in Normalized Least Mean Squares (NLMS) Adaptive Algorithm

texts:
I have been used NLMS algorithm to equalize 4x4 MIMO signals, but the bit-error-rate (BER) after equalization is unstable with iterations. I don't know if it is the normal behavior of the adaptive algorithm or some parameters in the algorithm needed to be adjusted.

the updated equation used for this algorithm is:

$$
\mathbf{w}[n+1] = \mathbf{w}[n] + \mu \mathbf{x}[n]\frac{ e^*[n]}{\mathbf{x}^H[n] \mathbf{x}[n] + \gamma}
$$

where $\mathbf{w}$ is the weights, $\mu$ is the step size, $\mathbf{x}$ is the input signal, $e$ is the error and $\gamma$ is a small positive number.

in my simulation, I used these values:

number of weights=100, mu=0.001 and gamma=0.001

the constellation of the desired signal and output signal from channel

(the length of the channel filter is 400) and the BER figures are shown:

is the instability normal for this algorithm?. Although I have tried different values for filter length and the step size, the BER is still unstable