Azzera filtri
Azzera filtri

Reduce noise and highlight peaks in DWS data

8 visualizzazioni (ultimi 30 giorni)
Marco RONDELLI
Marco RONDELLI il 6 Mag 2024
Risposto: Brahmadev il 14 Mag 2024
Introduction
Hi my name's Mark and I'm an Italian CS undegraduate working on a internship regarding data analysis about Diffusing Wave Spectroscopy data coming from the ISS, from the FSL Soft Matter Dynamics facility. I decided to ask the help of you most experts in the field as I've never worked with MATLAB this extensively in all my career and I struggle to come up with simple solutions without implementing them myself (e.g. creating a function when it exists already). I do have the professors to ask help to if things get grim.
The topic
The raw data that we start with is composed of multiple grayscale colored .tif images. A single .tif is a single measurement. Please see the [myTif.png] attachment. After reading the image with tiffreadVolume and after some local normalization and Gaussian filtering, I am left with a graph. See [norm_of_changes.png] attachment. This graph has lots of noise. I suppose the noise is testament of the method used to get the graph in the first place (computing the norm of changes between blocks).
The following code is the one used to compute the data to be plotted.
% blocks = 1;
% [s, ~] = size(V_norm_smooth);
% V_norm_smooth 10000x200 tif after imgaussfilt
for i = 1 : s - blocks
change = V_norm_smooth(i + blocks, :) - V_norm_smooth(i, :);
avg_change(i) = norm(change);
end
window_size = 21;
med_res = medfilt2(avg_change, [1, window_size]);
The objective
My goal is to highlight peaks present in the final plot.
Peaks are not always guaranteed to be as evident as they appear in the attached example. There might be only one peak, two, three or more. Several parameters already help with the reduction of "false positives", as we've experimented with them a lot and figured that an universal solution does not exist.
I'm quite of the idea there is no simple answer to the "problem". What I'd like is some pointers and directions on what a good approach would be for our case. The actual objective would be to higlight that region in [myTif.png] that looks like a barrier of unordered pixels with lots of different intensities. We are of the idea that this method might not be the best one, but as a research topic, it is interesting and worthwhile.
  1 Commento
Marco RONDELLI
Marco RONDELLI il 6 Mag 2024
Please do tell me if you need more info or the question is not clear enough.

Accedi per commentare.

Risposte (1)

Brahmadev
Brahmadev il 14 Mag 2024
As per my understanding, you are looking for a automated solution for finding the peaks for multiple plots similar to the image you have shared before. One function that you can look into is "findpeaks". You can define the number of peaks you need or the threshold to define the minimum height difference between a peak and its neighbors. Also, smoothening the data using "smoothdata" can be helpful in finding the local maximas. Also, refer to the following documentation links:
  1. https://www.mathworks.com/help/signal/ref/findpeaks.html
  2. https://www.mathworks.com/help/matlab/ref/smoothdata.html
Hope this helps!

Prodotti


Release

R2024a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by