Answered
Digital filter with lowpass, then filtfilt: different output
Occasionally, filter transients can appear, such as those you are seeing. The way I deal with those (to my satisfaction at leas...

6 years ago | 0

| accepted

Answered
How can I design lowpass FIR and IIR filters?
For the IIR filter, select a design (Butterworth, elliptic, Chebyshev, etc.), then use whatever functions you want to create it....

6 years ago | 0

| accepted

Answered
butterworth band pass filter
Try this: Fs = 1000; % Sampling Frequency (Hz) Fn = Fs/2; ...

6 years ago | 1

Answered
Fit Function for Data with Second Derivative Sometimes Flat
It’s difficult for me to follow your code. Rather than using polyfit to smooth your data, I would use the smoothdata function...

6 years ago | 0

Answered
Designing a higher order lowpass filter to avoid Gibbs phenomenon
I could not get that code to work. Try this: Fs = 2000; % Sampling Frequen...

6 years ago | 0

| accepted

Answered
intersection of lines and curves
Try this: D = load('intersect1.mat'); x_curve = D.x_curve; y_curve = D.y_curve; x_line = D.x_line; y_line = D.y_line; ...

6 years ago | 1

| accepted

Answered
Trying to make a regression model; question about fitlm and intercept!
‘... intercept of 10 which means that b0 is approx. 1’ That does not appear to be correct. The intercept, ‘b0’ in your equa...

6 years ago | 0

| accepted

Answered
Graph drawing in kHz domain
I have no idea what you are actually asking. See if the fft function will do what you want. Another option is the spectrog...

6 years ago | 0

Answered
merge two figs to one fig
Since each point is plotted as a separate Line object (5342 in ‘1.fig’ and 3608 in ‘2.fig’), this code is slow, since it has to ...

6 years ago | 1

| accepted

Answered
how to convert an array to corresponding weekdays
I am not certain what you want. Try this: z = [ 1 2 3 4 5 6 7]; p = { 'monday' 'tuesday' 'wednesday' 'thursday' 'friday' ...

6 years ago | 0

| accepted

Answered
Multiply values by the number of days in each month
Use the eomday function to find the number of days in each month: yearv = 1989:2018; for k = 1:numel(yearv) daysInMonth(...

6 years ago | 1

| accepted

Answered
Converting logical to cell array
I do not understand if ‘PokeTimeStamps’ changes its size (only that it appeasrs to be a column vector), or for that matter, what...

6 years ago | 0

| accepted

Answered
Identifying QRS point in ECG signal
That is an interesting EKG. It displays frequent unifocal PVCs with obvious retrograde conduction, blocking the subsequent P-wa...

6 years ago | 2

| accepted

Answered
How do I determine the natural frequency of the beam using Fast Fourier Transform?
Use the fft function. If you have the Signal Processing Toolbox, the findpeaks function will also be helpful.

6 years ago | 0

Answered
parameter fitting without getting local minima
The local minimum is likely the best you can hope for, considering that the parameters are constrained. Are you certain that th...

6 years ago | 0

| accepted

Answered
How to set extremum value of parameter?
To me, that the minimum is greater than the maximum does not make sense. That aside, try this: a = max(0, min(a,5)) Test...

6 years ago | 0

| accepted

Answered
how to save a function or vector defined by a given plot
Use the savefig (or saveas) functions to save it as a .fig file. Everything about it, including the data used to create it, wil...

6 years ago | 0

Answered
cutoff frequency for lowpass filter
‘Is this correct?’ That depends on the signal, and on what you want to do. The powerbw funciton returns the -3 dB frequencie...

6 years ago | 0

| accepted

Answered
The output of function resample shows a signal with peaks unexpected
‘...the resample function is supposed to give you a rough signal with new data added.’ I am not certain of the specific synta...

6 years ago | 0

| accepted

Answered
Contatenate multiple sound files
Since they are the same size and the same sampling frequency, concatenate them and then add them together. Example — t = li...

6 years ago | 0

Answered
Separating superimposed sound file
They appear to be four separate signals, so they are likely in a matrix, not a typical MATLAB one- or two-channel sound file. I...

6 years ago | 0

Answered
filtered output signal gives high values at the ends when using lowpass function
Filter transients such as those can occasionally occur with any filtering algorithm (and both hardware and digital filters), esp...

6 years ago | 1

| accepted

Answered
How can I determine b and a values for a data signal when using filter() function
Use any of the filter design functions that produce transfer function output. However the transfer function coefficients can ...

6 years ago | 0

| accepted

Answered
Delay when using lowpass(), medfilt1() and filter()
The filter function introduces phase delay and phase dsitortion in the filtered signal. The filtfilt function does not, so it i...

6 years ago | 1

| accepted

Answered
Solving 3rd order ODE
There appears to be a factor of ‘y(1)’ missing in the last 3 terms of the ‘dy(3)’ equation. (I gave your differential equation ...

6 years ago | 1

| accepted

Answered
how to set a aspect ratio in the plot
Use the axis function.

6 years ago | 0

Answered
What is the difference between int and integral.
The int function integrates symbolic expressions (or does its best, consdidering that not all expressions have analytic integral...

6 years ago | 6

| accepted

Answered
I am trying to simulate population logistic growth
If you have R2012a or later, use symbolic functions. Try this slightly modified version of your code (run in R2020a): syms ...

6 years ago | 0

Answered
Need help with using stairs function
Try this: kTm = cell2mat(kT); ym = cell2mat(y.').'; figure stairs(kTm(1,:), ym(1,:).') grid The cell arrays appear to ...

6 years ago | 1

| accepted

Answered
Simple MATLAB code to plot a BiQuad Filter from the coefficients?
I don’t have the DSP Toolbox, so I can’t experiment with dsp.BiquadFilter objects. According to the documentation use this sy...

6 years ago | 0

Load more