Please explain the code

// declare a couple of floating point variables (double float). 
// Static variables are not destoyed between calls to loop() and will be remembered for the next time
static double oldValue = 0;
static double oldChange = 0;

// declare an integer variable and initialise it witrh a value read from the sensor (0 to 1023)
int rawValue = analogRead(sensorPin);

// declare a floating point variable and do some sort of conversion from the raw sensor input to a value 
// this calculaton means something to you if you know what sensor you are using
double value = alpha * oldValue + (1-alpha)*rawValue;

// Write a 0 or 1 to the digital output ledPin. The value written is a boolean that works out to false(0) if change and OldChange don't meet the conditions, and true (>0) if they do. This can be confusing until you get used to it.
digitalWrite(ledPin,(change<0.0 && oldChange >0.0));

Serial.println(value);

// save the values in variable that remain (persist) for the next time that loop is called
oldValue= value;
oldChange =change;

// wait a while and then do it all over again
delay(period);

Moderator edit : Code tags added.

I think there is a mistake in this code as change is never set in the code but is assigned to oldChange. After the first time through both change and oldChange will be 0.0.

Hope this helps.