Engineer - mechanices /ekectronics / signal processing

Average matlab user for 20 years now.

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

Answered

Reading data from multiple files in ascending order.

hello this is my suggestion , based on natsortfiles (from FEX : Natural-Order Filename Sort - File Exchange - MATLAB Central ...

Reading data from multiple files in ascending order.

hello this is my suggestion , based on natsortfiles (from FEX : Natural-Order Filename Sort - File Exchange - MATLAB Central ...

1 day ago | 0

Answered

How to specify order of a Moving Average Filter?

hello a moving average filter has only a window length (and window type) as parameters, the order is not meaningfull here may...

How to specify order of a Moving Average Filter?

hello a moving average filter has only a window length (and window type) as parameters, the order is not meaningfull here may...

1 day ago | 1

Answered

Hysteresis curve and envelope

hello Emily this is how I solved it (blue curve) hope it helps %Column 2 Force vs Displacement clc;clear;close all; %Tra...

Hysteresis curve and envelope

hello Emily this is how I solved it (blue curve) hope it helps %Column 2 Force vs Displacement clc;clear;close all; %Tra...

2 days ago | 0

Answered

How can specify interval of variables in fsurf?

hi see 'MeshDensity' — Number of evaluation points per direction Control Resolution of Surface Plot Control the resolution o...

How can specify interval of variables in fsurf?

hi see 'MeshDensity' — Number of evaluation points per direction Control Resolution of Surface Plot Control the resolution o...

4 days ago | 0

| accepted

Answered

Reduce the error formed due to unexpected condition in time series data. Time series correction

hello see some suggestions for data correction and smoothing in my code below hope it helps all the best clc close a...

Reduce the error formed due to unexpected condition in time series data. Time series correction

hello see some suggestions for data correction and smoothing in my code below hope it helps all the best clc close a...

4 days ago | 0

Answered

How to plot these traces after a fixed interval?

hello this is it : C = randn(2000,30); data = filter(ones(1,100),1,C); ind = [5, 15, 25]; % your angles figure(1), w...

How to plot these traces after a fixed interval?

hello this is it : C = randn(2000,30); data = filter(ones(1,100),1,C); ind = [5, 15, 25]; % your angles figure(1), w...

4 days ago | 0

Answered

FFT and time domain

hello see my example below I used nfft = 48 and 95% overlap to have best display of spectrograms clc clearvars %%%%%%%%...

FFT and time domain

hello see my example below I used nfft = 48 and 95% overlap to have best display of spectrograms clc clearvars %%%%%%%%...

4 days ago | 0

Answered

How to plot the “Response” and the “damping exponential function of the transient solution” on the same figure?

hello If you have the Signal Processing Tbx, envelope was made for you clear all;close all; clc; xss=0.01; wf=40; wn=2...

How to plot the “Response” and the “damping exponential function of the transient solution” on the same figure?

hello If you have the Signal Processing Tbx, envelope was made for you clear all;close all; clc; xss=0.01; wf=40; wn=2...

4 days ago | 0

Answered

I have multiple signal plots in one graph and i want to add their amplitudes to get one graph only

hello here you are : n1=1.45; n2=2.65; c=299792458; a=259*10^-9; b=142*10^-9; G=a+b; Lambda0=1.5*10^-6; Omega0=2*pi...

I have multiple signal plots in one graph and i want to add their amplitudes to get one graph only

hello here you are : n1=1.45; n2=2.65; c=299792458; a=259*10^-9; b=142*10^-9; G=a+b; Lambda0=1.5*10^-6; Omega0=2*pi...

4 days ago | 0

| accepted

Answered

Finding the time in which a specific value is reached in time-series data when peaks are found

hello I would suggest you use first a lowpass filter with long enought time constant (equivalent to moving average with buffe...

Finding the time in which a specific value is reached in time-series data when peaks are found

hello I would suggest you use first a lowpass filter with long enought time constant (equivalent to moving average with buffe...

4 days ago | 0

Answered

How do I solve two different differential equations at the same time?

hello to do simple integration, you could start with cumtrapz to get the velocity data (from the force inputs) the time vecto...

How do I solve two different differential equations at the same time?

hello to do simple integration, you could start with cumtrapz to get the velocity data (from the force inputs) the time vecto...

5 days ago | 1

Answered

How to use output numbers as a vector.

hello see bleow : clear variable clc a=input('Please input a vector of integers : '); c=length(a); for d = unique(a(:)) ...

How to use output numbers as a vector.

hello see bleow : clear variable clc a=input('Please input a vector of integers : '); c=length(a); for d = unique(a(:)) ...

5 days ago | 0

Answered

How do I fix my x-axis ?

hello here you are : x = 0:1e-3:2; y1=8*cos(2*pi*x); y2=8*cos(19*pi*x).*exp(-x); figure(1),plot(x,y1,x,y2)

How do I fix my x-axis ?

hello here you are : x = 0:1e-3:2; y1=8*cos(2*pi*x); y2=8*cos(19*pi*x).*exp(-x); figure(1),plot(x,y1,x,y2)

8 days ago | 1

| accepted

Answered

Write legend on for loop plot

hello try this : X = [1.182, 1.6, 1.7, 1.8, 1.9, 2] NumberOfScenarios = [1, 2, 3] Scenarios = string(NumberOfScenarios); ...

Write legend on for loop plot

hello try this : X = [1.182, 1.6, 1.7, 1.8, 1.9, 2] NumberOfScenarios = [1, 2, 3] Scenarios = string(NumberOfScenarios); ...

11 days ago | 1

| accepted

Answered

Find the value at exact location in a text file

hello hope this helps I used the attached function to load the data (FYI) % demo clc clearvars; % load data [outdat...

Find the value at exact location in a text file

hello hope this helps I used the attached function to load the data (FYI) % demo clc clearvars; % load data [outdat...

11 days ago | 0

Answered

ECG signal filtering problem

hello a little tool to do the fft anamysis (and notch filter demo included) clc clearvars %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...

ECG signal filtering problem

hello a little tool to do the fft anamysis (and notch filter demo included) clc clearvars %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%...

12 days ago | 0

Answered

How analyze PMU data in the form of sinusoidal waveform?

hello I am not sure what your data represents, but FYI, this is a code to do spectral analysis (averaged fft and spectrogram) ...

How analyze PMU data in the form of sinusoidal waveform?

hello I am not sure what your data represents, but FYI, this is a code to do spectral analysis (averaged fft and spectrogram) ...

12 days ago | 1

| accepted

Answered

How to smooth a curve

hello your post is a bit rude, please take 10 seconds to say hello and introduce your topic; that would be a little more respe...

How to smooth a curve

hello your post is a bit rude, please take 10 seconds to say hello and introduce your topic; that would be a little more respe...

12 days ago | 0

Answered

How to resample frequency domain signal?

hello first code below : this is a script showing true averaging (even on complex Y data) over N samples your ac...

How to resample frequency domain signal?

hello first code below : this is a script showing true averaging (even on complex Y data) over N samples your ac...

12 days ago | 0

| accepted

Answered

Echo generation of FIR sytem

hello my code as example : infile='DirectGuitar.wav'; outfile='out_echo.wav'; % read the sample waveform [x,Fs] = audiore...

Echo generation of FIR sytem

hello my code as example : infile='DirectGuitar.wav'; outfile='out_echo.wav'; % read the sample waveform [x,Fs] = audiore...

12 days ago | 0

| accepted

Answered

Including Distortion with Audio Signal

hello this is an example how to use your function within a main code but I guess the implementation for the distortion is not...

Including Distortion with Audio Signal

hello this is an example how to use your function within a main code but I guess the implementation for the distortion is not...

12 days ago | 0

Answered

How can I offset time and displacement at the end of a defined time?

hello you can simply add 60 (or any value ) to your time vector (assuming you have defined one) : plot(time+60,data)

How can I offset time and displacement at the end of a defined time?

hello you can simply add 60 (or any value ) to your time vector (assuming you have defined one) : plot(time+60,data)

12 days ago | 0

Answered

Best filter for velocity noisy data

Suggestion of the day there are certainly other ways to implement a filter that action is function of signal amplitude (or dev...

Best filter for velocity noisy data

Suggestion of the day there are certainly other ways to implement a filter that action is function of signal amplitude (or dev...

15 days ago | 0

| accepted

Answered

implements a digital notch filter to remove the frequency component at 1 Hz.

hello see example code below clc clearvars %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % load signal %%%%%%%%%%%%%%%%%%%%%%%%%%%...

implements a digital notch filter to remove the frequency component at 1 Hz.

hello see example code below clc clearvars %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % load signal %%%%%%%%%%%%%%%%%%%%%%%%%%%...

15 days ago | 0

Answered

how to shift a pcolor figure ?

yes for sure % non centered plot N = 21; X = (1:N); Y = (1:N); C = rand(N,N); figure(1),pcolor(X,Y,C) colormap(gray(2...

how to shift a pcolor figure ?

yes for sure % non centered plot N = 21; X = (1:N); Y = (1:N); C = rand(N,N); figure(1),pcolor(X,Y,C) colormap(gray(2...

16 days ago | 0

Answered

Specgram zooms when sampling rate resampled to lower

Complete code for audio signal analysis clc clear all %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % load signal %%%%%%%%%%%%%%%%%%%...

Specgram zooms when sampling rate resampled to lower

Complete code for audio signal analysis clc clear all %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % load signal %%%%%%%%%%%%%%%%%%%...

16 days ago | 1

| accepted

Answered

Why does my FFT return all zeros for certain sound files?

Luke - see above again : I found where the issue is on the OP code - N = 2^12; j = 0:N-1; f = (Fs/N).*j; X = ff...

Why does my FFT return all zeros for certain sound files?

Luke - see above again : I found where the issue is on the OP code - N = 2^12; j = 0:N-1; f = (Fs/N).*j; X = ff...

17 days ago | 1

| accepted

Answered

Smoothing data by x axis values rather than cells

hello to resample all data to 200 m resolution (whatever your resolution is ), simply use interp1 : new_d = min(d1):200:max...

Smoothing data by x axis values rather than cells

hello to resample all data to 200 m resolution (whatever your resolution is ), simply use interp1 : new_d = min(d1):200:max...

17 days ago | 0

| accepted

Answered

Moving sum of 4 subsequent observatins

hello see example below (run it with 4 and not 5 samples averaging) : % dummy data data = rand(320,15); buffer = 5; % ...

Moving sum of 4 subsequent observatins

hello see example below (run it with 4 and not 5 samples averaging) : % dummy data data = rand(320,15); buffer = 5; % ...

17 days ago | 0

Answered

I want to call multiple files and plot them using a loop

hello attached a few examples - they are for excel / csv files but you can easily change the code for mat files (like : ... = ...

I want to call multiple files and plot them using a loop

hello attached a few examples - they are for excel / csv files but you can easily change the code for mat files (like : ... = ...

17 days ago | 0