rf-touchstone 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/coverage/coverage-badge.svg +20 -0
- package/development.md +181 -0
- package/dist/Touchstone.cjs.js +19 -0
- package/dist/Touchstone.es.js +9161 -0
- package/dist/Touchstone.umd.js +19 -0
- package/dist/touchstone.d.ts +697 -0
- package/package.json +73 -0
- package/readme.md +73 -0
package/package.json
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "rf-touchstone",
|
|
3
|
+
"private": false,
|
|
4
|
+
"type": "module",
|
|
5
|
+
"version": "0.0.0",
|
|
6
|
+
"description": "A Javascript/TypeScript library for reading, manipulating, and writing Touchstone files (.snp files) used in radio frequency (RF) and microwave engineering.",
|
|
7
|
+
"main": "dist/Touchstone.cjs.js",
|
|
8
|
+
"module": "dist/Touchstone.es.js",
|
|
9
|
+
"types": "dist/touchstone.d.ts",
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"readme.md",
|
|
13
|
+
"development.md",
|
|
14
|
+
"LICENSE",
|
|
15
|
+
"coverage/coverage-badge.svg"
|
|
16
|
+
],
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"author": "https://github.com/panz2018",
|
|
19
|
+
"repository": "https://github.com/panz2018/RF-Touchstone",
|
|
20
|
+
"keywords": [
|
|
21
|
+
"rf",
|
|
22
|
+
"touchstone",
|
|
23
|
+
"snp",
|
|
24
|
+
"s1p",
|
|
25
|
+
"s2p",
|
|
26
|
+
"s3p",
|
|
27
|
+
"s4p",
|
|
28
|
+
"s5p",
|
|
29
|
+
"s6p",
|
|
30
|
+
"frequency",
|
|
31
|
+
"scattering",
|
|
32
|
+
"matrix"
|
|
33
|
+
],
|
|
34
|
+
"scripts": {
|
|
35
|
+
"test": "run-p --print-label lint format test:unit test:coverage build docs:md && run-s docs:build",
|
|
36
|
+
"lint": "eslint . --fix",
|
|
37
|
+
"format": "prettier --write src/",
|
|
38
|
+
"test:unit": "vitest run",
|
|
39
|
+
"test:coverage": "vitest run --coverage && coverage-badges --source coverage/coverage-summary.json --output coverage/coverage-badge.svg",
|
|
40
|
+
"build": "tsc && vite build && yarn pack",
|
|
41
|
+
"docs:md": "typedoc --tsconfig tsconfig.json",
|
|
42
|
+
"docs:dev": "node docs/.vitepress/copy-docs.mjs && vitepress dev docs",
|
|
43
|
+
"docs:build": "node docs/.vitepress/copy-docs.mjs && vitepress build docs",
|
|
44
|
+
"docs:preview": "vitepress preview docs"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"mathjs": "^14.5.0"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@eslint/js": "^9.27.0",
|
|
51
|
+
"@types/eslint-config-prettier": "^6.11.3",
|
|
52
|
+
"@types/node": "^22.15.21",
|
|
53
|
+
"@vitest/coverage-v8": "^3.1.4",
|
|
54
|
+
"coverage-badges-cli": "^2.1.0",
|
|
55
|
+
"eslint": "^9.27.0",
|
|
56
|
+
"eslint-config-prettier": "^10.1.5",
|
|
57
|
+
"eslint-plugin-prettier": "^5.4.0",
|
|
58
|
+
"globals": "^16.2.0",
|
|
59
|
+
"happy-dom": "^17.4.7",
|
|
60
|
+
"markdown-it-mathjax3": "^4.3.2",
|
|
61
|
+
"npm-run-all": "^4.1.5",
|
|
62
|
+
"prettier": "^3.5.3",
|
|
63
|
+
"rollup-plugin-visualizer": "^5.14.0",
|
|
64
|
+
"typedoc": "^0.28.4",
|
|
65
|
+
"typedoc-plugin-markdown": "^4.6.3",
|
|
66
|
+
"typescript": "^5.8.3",
|
|
67
|
+
"typescript-eslint": "^8.32.1",
|
|
68
|
+
"vite": "^6.3.5",
|
|
69
|
+
"vite-plugin-dts": "^4.5.4",
|
|
70
|
+
"vitepress": "^1.6.3",
|
|
71
|
+
"vitest": "^3.1.4"
|
|
72
|
+
}
|
|
73
|
+
}
|
package/readme.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# RF-Touchstone
|
|
2
|
+
|
|
3
|
+
A Javascript/TypeScript library for reading, manipulating, and writing Touchstone files (.snp files) used in radio frequency (RF) and microwave engineering.
|
|
4
|
+
|
|
5
|
+
[](https://github.com/panz2018/RF-Touchstone/actions/workflows/Tests.yml)
|
|
6
|
+
[](coverage/coverage-badge.svg)
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
RF-Touchstone provides a complete solution for working with S-parameters and other network parameters in JavaScript/TypeScript environments. This library allows you to:
|
|
11
|
+
|
|
12
|
+
- Read and parse Touchstone files (.s1p, .s2p, .s3p, etc.)
|
|
13
|
+
- Manipulate network parameter data
|
|
14
|
+
- Write data back to Touchstone format
|
|
15
|
+
- Convert between different parameter representations (RI, MA, DB)
|
|
16
|
+
|
|
17
|
+
## What is a Touchstone File?
|
|
18
|
+
|
|
19
|
+
Touchstone files are an industry-standard ASCII text format for representing network parameters of electrical circuits. Each file contains:
|
|
20
|
+
|
|
21
|
+
- Comments (lines starting with !)
|
|
22
|
+
- Option line (starts with #) specifying frequency units, parameter type, and data format
|
|
23
|
+
- Network parameter data organized by frequency points
|
|
24
|
+
|
|
25
|
+
RF-Touchstone currently supports versions 1.0 and 1.1 of the Touchstone specification.
|
|
26
|
+
|
|
27
|
+
## Key Features
|
|
28
|
+
|
|
29
|
+
- Full support for Touchstone file format (v1.0 and v1.1)
|
|
30
|
+
- Parameter type support: S, Y, Z, G, H
|
|
31
|
+
- Format conversions: RI (Real/Imaginary), MA (Magnitude/Angle), DB (Decibel/Angle)
|
|
32
|
+
- TypeScript implementation with strong typing
|
|
33
|
+
- Comprehensive test suite
|
|
34
|
+
|
|
35
|
+
## Installation
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npm install rf-touchstone
|
|
39
|
+
# or
|
|
40
|
+
yarn add rf-touchstone
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Quick Start
|
|
44
|
+
|
|
45
|
+
```typescript
|
|
46
|
+
import { Touchstone } from 'rf-touchstone'
|
|
47
|
+
|
|
48
|
+
// Read a Touchstone file
|
|
49
|
+
const touchstone = new Touchstone()
|
|
50
|
+
touchstone.readContent(fileContent, 2) // 2-port network
|
|
51
|
+
|
|
52
|
+
// Access data
|
|
53
|
+
const frequencies = touchstone.getFrequencies()
|
|
54
|
+
const sParameters = touchstone.getParameterMatrix()
|
|
55
|
+
|
|
56
|
+
// Write back to Touchstone format
|
|
57
|
+
const newContent = touchstone.writeContent()
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Documentation
|
|
61
|
+
|
|
62
|
+
For detailed documentation, please visit:
|
|
63
|
+
|
|
64
|
+
- [Project Website](https://panz2018.github.io/RF-Touchstone/)
|
|
65
|
+
- [DeepWiki Documentation](https://deepwiki.com/panz2018/RF-Touchstone) - Interactive AI documentation that allows you to converse and ask questions about this repository
|
|
66
|
+
|
|
67
|
+
## Development
|
|
68
|
+
|
|
69
|
+
For information on setting up a development environment and contributing to the project, see [development.md](development.md).
|
|
70
|
+
|
|
71
|
+
## License
|
|
72
|
+
|
|
73
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|