> Eric, great work on getting something working! I’d recommend you put it
> on CPAN (with suitable tests and test data, obviously) as
> PDL::IO::Touchstone (if that last bit is the most meaningful label).
Thanks! That is the plan, PDL::IO::Touchstone is probably right. A single
touchstone file represents some N-port RF component (like a filter or
capacitor would have 2 ports, power splitter is 3, etc). The ports are
represented by an NxN "scattering parameter" matrix at each frequency
where N is the number of ports.
In addition to the matrix data, there are these informational values:
# Hz - unit scale, MHz, GHz, etc. - string
# S - type of matrix (Z, Y, G, H, ...) - string: a single charectar
# DB - complex format representation in the file where
ri=real/imag, ma=mag/angle, db=10log_10(mag)/angle - string
# R 50 - charectaristic impedance at all ports - scalar int
This could be read into simple PDLs and scalars as follows:
($freqs, $hz_scale, $matrix, $format, $z0) =
PDL::IO::Touchstone::read('foo.s2p');
where N is the number of ports:
- $freqs is a 1xN matrix
- $matrix is a NxNxM matrix (M is the number of freqs)
- and the rest are scalar
Assuming PDL::IO::Touchstone::read() turns each record into a
complex-valued matrix, the "$format" value of how the file was original is
no longer useful, just noteworthy. Perhaps the user would want to write
out to the same format or something.
Questions:
1. In my existing code I've been scaling $freqs to Hz from whatever it
came so the user can do what they like. If I scale it to Hz _and_
leave the $hz_scale term available then it could be confusing to the
user, perhaps thinking they need to scale what I've already scaled.
Should PDL::IO::Touchstone be lower-level than that and just return the
frequency values verbatim and to let the user scale it based on
$hz_scale if they wish, or should I scale it to Hz and drop the
$hz_scale term?
2. Are there other PDL::IO best-practices to consider?
> From: Luis Mochán
> >Questions:
> >
> >Does PDL parallelize vector arithmetic somehow or do I need to do
> >something further to enable threading?
> >
> >If so, how does it parallelize the work?
> >
> >Is there anything to consider when building PDL code so it scales for
> >parallelization?
> >
>
> I understand that in your case, the range of your row index, the 'broadcast'
> dimension, would be split into
> subranges and each fed to a different core.
> Look at the documentation of PDL::ParallelCPU
Thanks, I'll check out PDL::ParallelCPU and wrap my head around it,
particularly the difference between broadcasting and pthreading.
-Eric
>
> Regards,
> Luis
> --
> Enviado desde mi celular; disculpe la horrografía
>
>
> _______________________________________________
> pdl-general mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/pdl-general
>
>
>
>
> _______________________________________________
pdl-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pdl-general