From 255a4e8257f9d4de9ce6e72924eeebcc02695f86 Mon Sep 17 00:00:00 2001 From: Peter Tanner Date: Thu, 1 Aug 2024 01:42:56 +0800 Subject: [PATCH] New posts: _posts/2024-08-01-Useful-Mathematica-functions-for-signal-processing-units.md --- ...a-functions-for-signal-processing-units.md | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 _posts/2024-08-01-Useful-Mathematica-functions-for-signal-processing-units.md diff --git a/_posts/2024-08-01-Useful-Mathematica-functions-for-signal-processing-units.md b/_posts/2024-08-01-Useful-Mathematica-functions-for-signal-processing-units.md new file mode 100644 index 0000000..9bda1cb --- /dev/null +++ b/_posts/2024-08-01-Useful-Mathematica-functions-for-signal-processing-units.md @@ -0,0 +1,34 @@ +--- +title: Useful Mathematica functions for signal processing units +author: peter +date: 2024-08-01 01:40:23 +0800 +categories: [Uni] # Blogging | Electronics | Programming | Mechanical | SelfHosting +tags: [ELEC4402] # systems | embedded | rf | microwave | electronics | solidworks | automation | tip +# image: assets/img/2024-08-01-Useful-Mathematica-f/preview.png +--- + +I will update this as I add more functions. + +Using it for the unit ELEC4402 Communication Systems + +```mathematica +(* Signal power *) +SigPower[expr_, t_] := + Limit[1/(2 T) Integrate[expr, {t, -T, T}], T -> Infinity] + +(* Normalized sinc function, default Sinc in Mathematica is not normalized *) +SincNorm[Infinity] := Sinc[Pi Infinity] +SincNorm[t_?NumericQ] := Sinc[Pi t] + +(* Fourier transform, frequency in Hz *) +FTfreq[varargs__] := + FourierTransform[varargs, + FourierParameters -> {0, -2*Pi}] /. {Sinc[f_] :> + SincNorm[Simplify[f/Pi]]} + +(* Inverse Fourier transform, frequency in Hz *) +IFTfreq[varargs__] := + InverseFourierTransform[varargs, + FourierParameters -> {0, -2*Pi}] /. {Sinc[f_] :> + SincNorm[Simplify[f/Pi]]} +```