Engineer - mechanices /ekectronics / signal processing

Average matlab user for 20 years now.

Professional Interests: signal processing, adaptive control, noise and vibration processing

Answered

Adding a sound wave to a wav file

hello if the two have same sampling frequency, you can add them together like z = wav1 + wav2; but make sure that the output...

Adding a sound wave to a wav file

hello if the two have same sampling frequency, you can add them together like z = wav1 + wav2; but make sure that the output...

2 days ago | 0

Answered

to delete specific lines/text from a .txt file

hello see below my code and it's output (txt file attached) clc clearvars Filename = 'data.txt'; result = extract_da...

to delete specific lines/text from a .txt file

hello see below my code and it's output (txt file attached) clc clearvars Filename = 'data.txt'; result = extract_da...

3 days ago | 0

Answered

Create Moving Average filter WITHOUT filter() function

hello try this fs = 200; %sampling frequency Ts = 1/200; %sampling time t = 0:Ts:1; x = sin(2*pi*2*t) + sin(2*pi*10*t) ...

Create Moving Average filter WITHOUT filter() function

hello try this fs = 200; %sampling frequency Ts = 1/200; %sampling time t = 0:Ts:1; x = sin(2*pi*2*t) + sin(2*pi*10*t) ...

3 days ago | 0

| accepted

Answered

How do I pass the signal to the frequency domain?

hello see below a code to do spectral analysis (example) but to me you're confusing fft with histogram. The fft spectrum will...

How do I pass the signal to the frequency domain?

hello see below a code to do spectral analysis (example) but to me you're confusing fft with histogram. The fft spectrum will...

6 days ago | 0

Answered

Trying to plot specific values from a vector

hello this is my suggestion - I put the equations in a sub function to make it easy after to do a for loop for multiple To4 va...

Trying to plot specific values from a vector

hello this is my suggestion - I put the equations in a sub function to make it easy after to do a for loop for multiple To4 va...

6 days ago | 0

| accepted

Answered

Residual vs Iteration Plot

hello code fixed : L = 0.05; T_w = 5; T...

Residual vs Iteration Plot

hello code fixed : L = 0.05; T_w = 5; T...

6 days ago | 0

| accepted

Answered

Select Data Column With Header are not in the first row

hello see below example : opts = detectImportOptions("Document1.txt","NumHeaderLines",12); opts.SelectedVari...

Select Data Column With Header are not in the first row

hello see below example : opts = detectImportOptions("Document1.txt","NumHeaderLines",12); opts.SelectedVari...

6 days ago | 0

Answered

Quick question regarding CSV file reading.

hello my quick suggestion to the quick question fid=fopen('cycle1.csv'); e=textscan(fid,'%s','headerlines',1); e_splitted ...

Quick question regarding CSV file reading.

hello my quick suggestion to the quick question fid=fopen('cycle1.csv'); e=textscan(fid,'%s','headerlines',1); e_splitted ...

6 days ago | 0

| accepted

Answered

How to sum two data sets to get a best match of another data set?

hello see demo below : I added some noise on y3 to see the robustness of fminsearch got the results : a = 3.0379 b =...

How to sum two data sets to get a best match of another data set?

hello see demo below : I added some noise on y3 to see the robustness of fminsearch got the results : a = 3.0379 b =...

6 days ago | 0

| accepted

Answered

Why this code gives error?

hello it works better this way : plot(f,20*log10(FFT_abs/max(FFT_abs)),'b+-','linewidth',3);

Why this code gives error?

hello it works better this way : plot(f,20*log10(FFT_abs/max(FFT_abs)),'b+-','linewidth',3);

6 days ago | 0

Answered

FFT Function not working with multiple columns

hello first , xlsread is a bit outdated , use importdata instead second, here's a generic code for time and frequency analysi...

FFT Function not working with multiple columns

hello first , xlsread is a bit outdated , use importdata instead second, here's a generic code for time and frequency analysi...

8 days ago | 1

| accepted

Answered

How to get a velocity graph from recorded displacements and times?

hello to get velocity , you need the first derivative of the displacement, for acceleration, it's the second derivative exa...

How to get a velocity graph from recorded displacements and times?

hello to get velocity , you need the first derivative of the displacement, for acceleration, it's the second derivative exa...

9 days ago | 0

Answered

I have a time series signal which is needed in the frequency domain

hello maybe this can be starting point further refinement would be to have the frequency axis of the spectrogram in log scal...

I have a time series signal which is needed in the frequency domain

hello maybe this can be starting point further refinement would be to have the frequency axis of the spectrogram in log scal...

9 days ago | 0

Answered

Extract data between specific indicators from txt file

hello this is one solution - hope it helps ! tested with the attached txt file = readlines('data.txt'); data_str = 'R1'...

Extract data between specific indicators from txt file

hello this is one solution - hope it helps ! tested with the attached txt file = readlines('data.txt'); data_str = 'R1'...

9 days ago | 0

Answered

Problem in the data fitting with custom equation

hello here you are : t = [1.00E-07 2.00E-07 5.00E-07 1.00E-06 2.00E-06 5.00E-06 1.00E-05 ...

Problem in the data fitting with custom equation

hello here you are : t = [1.00E-07 2.00E-07 5.00E-07 1.00E-06 2.00E-06 5.00E-06 1.00E-05 ...

10 days ago | 0

| accepted

Answered

how to find the smallest point before rising limb and then calculate the gradient between that point and peak ??

hello once you have found the x location of the B point , let's say is xB , then you can find xA knowing the this point should...

how to find the smallest point before rising limb and then calculate the gradient between that point and peak ??

hello once you have found the x location of the B point , let's say is xB , then you can find xA knowing the this point should...

10 days ago | 0

Answered

Manual implementation of spectogram function

hello I share with you my own version , hope it helps ! notice i always use hanning window and the correction factor for ampl...

Manual implementation of spectogram function

hello I share with you my own version , hope it helps ! notice i always use hanning window and the correction factor for ampl...

10 days ago | 0

Answered

How to align the power plot correctly?

hello for me it would make sense to add simply half the buffer lenght to your time vector in the second graph, so that the pow...

How to align the power plot correctly?

hello for me it would make sense to add simply half the buffer lenght to your time vector in the second graph, so that the pow...

10 days ago | 1

| accepted

Answered

Butterworth filter for ecg signal in healthy people

hello dear all, an alternative using a 5th order IIR filter to remove the usual 50 Hz and harmonics mains hum LD = load('ECG_...

Butterworth filter for ecg signal in healthy people

hello dear all, an alternative using a 5th order IIR filter to remove the usual 50 Hz and harmonics mains hum LD = load('ECG_...

10 days ago | 0

Answered

saving data in a text file

hi again you were one micro inch from the solution : simply add the transpose operation on the data matrix to get it oriented...

saving data in a text file

hi again you were one micro inch from the solution : simply add the transpose operation on the data matrix to get it oriented...

11 days ago | 0

Answered

How do I calculate power for each signal?

hello if you want to compute a running rms value , you can use the movstd function - see help movstd and use K = fs=8192 to a...

How do I calculate power for each signal?

hello if you want to compute a running rms value , you can use the movstd function - see help movstd and use K = fs=8192 to a...

11 days ago | 1

Answered

How to set threshold point to the first peak arrival?

hello I wonder why doing the complex fft / ifft to remove low frequency signal this can be done easily still in time domain ...

How to set threshold point to the first peak arrival?

hello I wonder why doing the complex fft / ifft to remove low frequency signal this can be done easily still in time domain ...

12 days ago | 0

Answered

interp1 not working as expected and returning the same negative index for multiple query points (sample code and sample data included)

hello why do not use this crossing function to get the positive slope and negative slope crossing point to a given value ? l...

interp1 not working as expected and returning the same negative index for multiple query points (sample code and sample data included)

hello why do not use this crossing function to get the positive slope and negative slope crossing point to a given value ? l...

12 days ago | 1

Answered

Find the second signal points (x, y location) exactly the same place of the first signal peak (x, y) matlab

hello hope this helps you see function attached load('Value.txt'); x = Value(:,1); y = Value(:,2); t = 1:length(x); th...

Find the second signal points (x, y location) exactly the same place of the first signal peak (x, y) matlab

hello hope this helps you see function attached load('Value.txt'); x = Value(:,1); y = Value(:,2); t = 1:length(x); th...

12 days ago | 1

| accepted

Answered

Why the amplitude of theFFT trasform is not equal as the amplitude of the input signal?

hi again I was not happy to see that your code needed a very high sampling rate to display correctly the 5 frequencies this ...

Why the amplitude of theFFT trasform is not equal as the amplitude of the input signal?

hi again I was not happy to see that your code needed a very high sampling rate to display correctly the 5 frequencies this ...

12 days ago | 0

| accepted

Answered

Why the amplitude of theFFT trasform is not equal as the amplitude of the input signal?

hello FYI see code below it iplement a peak hold fft averaging technique; also the spectrogram principle is coded (so you can...

Why the amplitude of theFFT trasform is not equal as the amplitude of the input signal?

hello FYI see code below it iplement a peak hold fft averaging technique; also the spectrogram principle is coded (so you can...

13 days ago | 0

Answered

filtfilt vs self coded filtfilt giving different results.

hello IMHO the most obvious error is that your second simulation runs on a completely different filter see the second time y...

filtfilt vs self coded filtfilt giving different results.

hello IMHO the most obvious error is that your second simulation runs on a completely different filter see the second time y...

13 days ago | 0

Answered

How can I avoid offset at start and end of signal when using xcorr-function?

hello Simon I tweaked a bit your code ; see my comments and mods no more manual cuts needed it's all automatic; also there i...

How can I avoid offset at start and end of signal when using xcorr-function?

hello Simon I tweaked a bit your code ; see my comments and mods no more manual cuts needed it's all automatic; also there i...

16 days ago | 1

| accepted

Answered

Problème avec une boucle if

Bonjour Léana est ce que tu peux partager l'ensemble du code + données d'entrée ?

Problème avec une boucle if

Bonjour Léana est ce que tu peux partager l'ensemble du code + données d'entrée ?

16 days ago | 0

| accepted

Answered

How to get a best-fit parabola using elementwise multiplication

hello Robert simply apply what the exercise description says : you are supposed to fit a parabola of the form y=C+Dx+Ex^2 th...

How to get a best-fit parabola using elementwise multiplication

hello Robert simply apply what the exercise description says : you are supposed to fit a parabola of the form y=C+Dx+Ex^2 th...

16 days ago | 0