mirror of
https://github.com/peter-tanner/peter-tanner.github.io.git
synced 2024-11-30 12:00:18 +08:00
Fix broken SigPower
This commit is contained in:
parent
9537655318
commit
52e20bcc63
|
@ -14,19 +14,20 @@ Using it for the unit ELEC4402 Communication Systems
|
||||||
```mathematica
|
```mathematica
|
||||||
(* Signal power *)
|
(* Signal power *)
|
||||||
SigPower[expr_, t_] :=
|
SigPower[expr_, t_] :=
|
||||||
Limit[1/(2 T) Integrate[expr, {t, -T, T}], T -> Infinity]
|
Limit[1/(2 T) Integrate[expr^2, {t, -T, T}], T -> Infinity]
|
||||||
|
|
||||||
(* Normalized sinc function, default Sinc in Mathematica is not normalized *)
|
(* Normalized sinc function,default Sinc in Mathematica is not \
|
||||||
|
normalized *)
|
||||||
SincNorm[Infinity] := Sinc[Pi Infinity]
|
SincNorm[Infinity] := Sinc[Pi Infinity]
|
||||||
SincNorm[t_?NumericQ] := Sinc[Pi t]
|
SincNorm[t_?NumericQ] := Sinc[Pi t]
|
||||||
|
|
||||||
(* Fourier transform, frequency in Hz *)
|
(* Fourier transform,frequency in Hz *)
|
||||||
FTfreq[varargs__] :=
|
FTfreq[varargs__] :=
|
||||||
FourierTransform[varargs,
|
FourierTransform[varargs,
|
||||||
FourierParameters -> {0, -2*Pi}] /. {Sinc[f_] :>
|
FourierParameters -> {0, -2*Pi}] /. {Sinc[f_] :>
|
||||||
SincNorm[Simplify[f/Pi]]}
|
SincNorm[Simplify[f/Pi]]}
|
||||||
|
|
||||||
(* Inverse Fourier transform, frequency in Hz *)
|
(* Inverse Fourier transform,frequency in Hz *)
|
||||||
IFTfreq[varargs__] :=
|
IFTfreq[varargs__] :=
|
||||||
InverseFourierTransform[varargs,
|
InverseFourierTransform[varargs,
|
||||||
FourierParameters -> {0, -2*Pi}] /. {Sinc[f_] :>
|
FourierParameters -> {0, -2*Pi}] /. {Sinc[f_] :>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user