- Create a function handle for the polynomial part, f(t) using the @(t) notation.
- Create the Gaussian filter using the “normpdf” function and determine the mean (mu) and variance (sigma^2) values that best fit your data as these values control the shape and position of the Gaussian filter.
- Multiply the polynomial function f(t) with the Gaussian filter
1d filter implementation
43 views (last 30 days)
Show older comments
I wanna implement this function, f=t^2*exp(-t^2), the exponential part is a gaussian filter and I should finetune mean and variance based on my data, now my question is when gaussian filter is multiplying by a polynomial function how should I convert it to filter?my confusion here is the sigma and varinance of the f function, and how to sode it.
0 Comments
Accepted Answer
Sai Pavan
on 19 Oct 2023
Edited: Sai Pavan
on 19 Oct 2023
Hi,
I understand that you are trying to implement a 1D gaussian filter multiplied by an exponential function.
Please follow the below workflow to implement the custom 1D filter:
Please refer to the below code snippet that illustrates the implementation of custom 1D gaussian filter:
f = @(t) t.^2 .* exp(-t.^2); % Define the function f(t) = t^2 * exp(-t^2)
mu = 0; % Mean of the Gaussian filter
sigma = 1; % Variance of the Gaussian filter
gaussianFilter = @(t) normpdf(t, mu, sigma); % Define the Gaussian filter
filteredFunction = @(t) f(t) .* gaussianFilter(t); % Combine the polynomial and Gaussian filter
Please refer to the below documentation to learn more about the “normpdf” function:
Hope it helps.
Regards,
Sai Pavan
0 Comments
More Answers (0)
See Also
Categories
Find more on Digital Filter Design in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!