Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

How to use Savitzky-golay filter on csv file? I have file.csv in this format:

0.1,1.6,2.8,0
0.2,1.2,2.3,1
0.7,1.5,2.4,2
0.6,1.2,2.7,3
0.4,1.4,2.9,4
0.3,1.3,2.5,5

description

number1,number2,number3,id

I need to load CSV, use savitzky-golay filter on numbers1, numbers2 and numbers3 seperatly. And then save it into csv again. Can you help?

EDIT: I've already tried to parse csv, try filter from example and plot it:

table = Take[Import["file.csv"]];
first = table[[All,1]];
c = SavitzkyGolayCoefficients[20, 20, 4];
c = N[c];
filterOutput = SavitzkyGolayFilter[test, c];
ListLinePlot[{filterOutput, first}]

How to save it to CSV again in same format. What does SavitzkyGolayCoefficient menas?

share|improve this question
2  
We can surely help, but not do all of it :) Please include your code showing where you're stuck. –  rm -rf Mar 8 at 20:57
1  
Don't define table to be in MatrixForm. –  Verbeia Mar 8 at 21:14
    
Verbeia, you are right thanks :) –  SpeedEX505 Mar 8 at 21:14
    
check my edit now –  SpeedEX505 Mar 8 at 21:32
    
SavitzkyGolay is not built-in, is this from package? Have you checked Export, "CSV" etc? –  Kuba Mar 9 at 13:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.