The calculations and the code to do them are faily trivial however it is not 100% clear what you are after exactly.
For example: measuring meters per second requires 2 or more samples. The more samples, the less reactive & more "smoothed" the value becomes. With less samples, you get a more responsive value but will see lots of "flicker"
Here is some starter code demo to get you going. Give it a go an see what you can make from it.
Demo Flow (use CTRL+I to import):
[{"id":"db754a27c7f0d048","type":"inject","z":"73b44920080e0db3","name":"depth 1m","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"diver/1/depth","payload":"1","payloadType":"num","x":1640,"y":60,"wires":[["24aca97f750e741e"]]},{"id":"a957732b4f3bd45b","type":"inject","z":"73b44920080e0db3","name":"depth 2m","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"diver/1/depth","payload":"2","payloadType":"num","x":1640,"y":100,"wires":[["24aca97f750e741e"]]},{"id":"a38dec9b04236ab1","type":"inject","z":"73b44920080e0db3","name":"depth 3m","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"diver/1/depth","payload":"3","payloadType":"num","x":1640,"y":140,"wires":[["24aca97f750e741e"]]},{"id":"77f1632662d34689","type":"inject","z":"73b44920080e0db3","name":"depth 4m","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"diver/1/depth","payload":"4","payloadType":"num","x":1640,"y":180,"wires":[["24aca97f750e741e"]]},{"id":"6ecee1e4b4a7173e","type":"inject","z":"73b44920080e0db3","name":"depth 5m","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"diver/1/depth","payload":"5","payloadType":"num","x":1640,"y":220,"wires":[["24aca97f750e741e"]]},{"id":"d4628ec2adf9bb07","type":"inject","z":"73b44920080e0db3","name":"depth 6m","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"diver/1/depth","payload":"6","payloadType":"num","x":1640,"y":260,"wires":[["24aca97f750e741e"]]},{"id":"c55f3fd42cc39e0b","type":"inject","z":"73b44920080e0db3","name":"depth 7m","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"diver/1/depth","payload":"7","payloadType":"num","x":1640,"y":300,"wires":[["24aca97f750e741e"]]},{"id":"24aca97f750e741e","type":"function","z":"73b44920080e0db3","name":"calculateRateOfDescent","func":"const data = context.get('data') || []\nif (data.length > 10) {\n data.pop()\n}\ndata.unshift({\n depth: msg.payload,\n timestamp: Date.now()\n})\ncontext.set('data', data)\n\nfunction calculateRateOfDescent(data) {\n let rateOfDescent = [];\n for (let i = 0; i < data.length - 1; i++) {\n let depthDifference = data[i + 1].depth - data[i].depth;\n let timeDifference = (data[i + 1].timestamp - data[i].timestamp) / 1000; // convert to seconds\n let descentRate = depthDifference / timeDifference;\n rateOfDescent.push(descentRate);\n }\n return rateOfDescent;\n}\n\nmsg.payload = calculateRateOfDescent(data)\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1910,"y":160,"wires":[["9ff1e00ab7db5d29"]]},{"id":"9ff1e00ab7db5d29","type":"debug","z":"73b44920080e0db3","name":"M/sec: +ve value == descending, -ve == ascending","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1990,"y":220,"wires":[]}]