@jtarrio/webrtlsdr 2.0.5 → 3.0.1
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/README.md +5 -6
- package/dist/errors.d.ts +1 -2
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +0 -1
- package/dist/errors.js.map +1 -1
- package/dist/radio/radio.d.ts +22 -63
- package/dist/radio/radio.d.ts.map +1 -1
- package/dist/radio/radio.js +41 -255
- package/dist/radio/radio.js.map +1 -1
- package/dist/radio/source.d.ts +25 -0
- package/dist/radio/source.d.ts.map +1 -0
- package/dist/radio/source.js +69 -0
- package/dist/radio/source.js.map +1 -0
- package/dist/radio.d.ts +2 -1
- package/dist/radio.d.ts.map +1 -1
- package/dist/radio.js +1 -1
- package/dist/radio.js.map +1 -1
- package/dist/rtlsdr/rtl2832u.d.ts.map +1 -1
- package/dist/rtlsdr/rtl2832u.js.map +1 -1
- package/dist/rtlsdr/rtlcom.d.ts.map +1 -1
- package/dist/rtlsdr/rtlcom.js.map +1 -1
- package/package.json +4 -4
- package/dist/demod/demod-am.d.ts +0 -54
- package/dist/demod/demod-am.d.ts.map +0 -1
- package/dist/demod/demod-am.js +0 -113
- package/dist/demod/demod-am.js.map +0 -1
- package/dist/demod/demod-cw.d.ts +0 -48
- package/dist/demod/demod-cw.d.ts.map +0 -1
- package/dist/demod/demod-cw.js +0 -101
- package/dist/demod/demod-cw.js.map +0 -1
- package/dist/demod/demod-nbfm.d.ts +0 -54
- package/dist/demod/demod-nbfm.d.ts.map +0 -1
- package/dist/demod/demod-nbfm.js +0 -114
- package/dist/demod/demod-nbfm.js.map +0 -1
- package/dist/demod/demod-ssb.d.ts +0 -55
- package/dist/demod/demod-ssb.d.ts.map +0 -1
- package/dist/demod/demod-ssb.js +0 -112
- package/dist/demod/demod-ssb.js.map +0 -1
- package/dist/demod/demod-wbfm.d.ts +0 -113
- package/dist/demod/demod-wbfm.d.ts.map +0 -1
- package/dist/demod/demod-wbfm.js +0 -212
- package/dist/demod/demod-wbfm.js.map +0 -1
- package/dist/demod/demodulator.d.ts +0 -3
- package/dist/demod/demodulator.d.ts.map +0 -1
- package/dist/demod/demodulator.js +0 -28
- package/dist/demod/demodulator.js.map +0 -1
- package/dist/demod/empty-demodulator.d.ts +0 -82
- package/dist/demod/empty-demodulator.d.ts.map +0 -1
- package/dist/demod/empty-demodulator.js +0 -149
- package/dist/demod/empty-demodulator.js.map +0 -1
- package/dist/demod/modes.d.ts +0 -107
- package/dist/demod/modes.d.ts.map +0 -1
- package/dist/demod/modes.js +0 -101
- package/dist/demod/modes.js.map +0 -1
- package/dist/demod/player.d.ts +0 -19
- package/dist/demod/player.d.ts.map +0 -1
- package/dist/demod/player.js +0 -15
- package/dist/demod/player.js.map +0 -1
- package/dist/demod/sample-counter.d.ts +0 -22
- package/dist/demod/sample-counter.d.ts.map +0 -1
- package/dist/demod/sample-counter.js +0 -57
- package/dist/demod/sample-counter.js.map +0 -1
- package/dist/demod/spectrum.d.ts +0 -23
- package/dist/demod/spectrum.d.ts.map +0 -1
- package/dist/demod/spectrum.js +0 -78
- package/dist/demod/spectrum.js.map +0 -1
- package/dist/dsp/buffers.d.ts +0 -72
- package/dist/dsp/buffers.d.ts.map +0 -1
- package/dist/dsp/buffers.js +0 -122
- package/dist/dsp/buffers.js.map +0 -1
- package/dist/dsp/coefficients.d.ts +0 -22
- package/dist/dsp/coefficients.d.ts.map +0 -1
- package/dist/dsp/coefficients.js +0 -77
- package/dist/dsp/coefficients.js.map +0 -1
- package/dist/dsp/converters.d.ts +0 -15
- package/dist/dsp/converters.d.ts.map +0 -1
- package/dist/dsp/converters.js +0 -43
- package/dist/dsp/converters.js.map +0 -1
- package/dist/dsp/demodulators.d.ts +0 -73
- package/dist/dsp/demodulators.d.ts.map +0 -1
- package/dist/dsp/demodulators.js +0 -244
- package/dist/dsp/demodulators.js.map +0 -1
- package/dist/dsp/fft.d.ts +0 -53
- package/dist/dsp/fft.d.ts.map +0 -1
- package/dist/dsp/fft.js +0 -175
- package/dist/dsp/fft.js.map +0 -1
- package/dist/dsp/filters.d.ts +0 -91
- package/dist/dsp/filters.d.ts.map +0 -1
- package/dist/dsp/filters.js +0 -250
- package/dist/dsp/filters.js.map +0 -1
- package/dist/dsp/power.d.ts +0 -2
- package/dist/dsp/power.d.ts.map +0 -1
- package/dist/dsp/power.js +0 -23
- package/dist/dsp/power.js.map +0 -1
- package/dist/dsp/resamplers.d.ts +0 -33
- package/dist/dsp/resamplers.d.ts.map +0 -1
- package/dist/dsp/resamplers.js +0 -91
- package/dist/dsp/resamplers.js.map +0 -1
- package/dist/players/audioplayer.d.ts +0 -25
- package/dist/players/audioplayer.d.ts.map +0 -1
- package/dist/players/audioplayer.js +0 -68
- package/dist/players/audioplayer.js.map +0 -1
- package/dist/radio/msgqueue.d.ts +0 -23
- package/dist/radio/msgqueue.d.ts.map +0 -1
- package/dist/radio/msgqueue.js +0 -52
- package/dist/radio/msgqueue.js.map +0 -1
- package/dist/radio/sample_receiver.d.ts +0 -19
- package/dist/radio/sample_receiver.d.ts.map +0 -1
- package/dist/radio/sample_receiver.js +0 -54
- package/dist/radio/sample_receiver.js.map +0 -1
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { Configurator, Demod, Demodulated } from "./modes.js";
|
|
2
|
-
/** Mode parameters for NBFM. */
|
|
3
|
-
export type ModeNBFM = {
|
|
4
|
-
scheme: "NBFM";
|
|
5
|
-
maxF: number;
|
|
6
|
-
squelch: number;
|
|
7
|
-
};
|
|
8
|
-
/** Mode options for NBFM. */
|
|
9
|
-
export type OptionsNBFM = {
|
|
10
|
-
/** Number of taps for the downsampler filter. Must be an odd number. 151 by default. */
|
|
11
|
-
downsamplerTaps?: number;
|
|
12
|
-
/** Number of taps for the RF filter. Must be an odd number. 151 by default. */
|
|
13
|
-
rfTaps?: number;
|
|
14
|
-
};
|
|
15
|
-
/** A demodulator for narrowband FM signals. */
|
|
16
|
-
export declare class DemodNBFM implements Demod<ModeNBFM> {
|
|
17
|
-
private outRate;
|
|
18
|
-
private mode;
|
|
19
|
-
/**
|
|
20
|
-
* @param inRate The sample rate of the input samples.
|
|
21
|
-
* @param outRate The sample rate of the output audio.
|
|
22
|
-
* @param mode The mode to use initially.
|
|
23
|
-
* @param options Options for the demodulator.
|
|
24
|
-
*/
|
|
25
|
-
constructor(inRate: number, outRate: number, mode: ModeNBFM, options?: OptionsNBFM);
|
|
26
|
-
private rfTaps;
|
|
27
|
-
private shifter;
|
|
28
|
-
private downsampler;
|
|
29
|
-
private filterI;
|
|
30
|
-
private filterQ;
|
|
31
|
-
private demodulator;
|
|
32
|
-
getMode(): ModeNBFM;
|
|
33
|
-
setMode(mode: ModeNBFM): void;
|
|
34
|
-
/**
|
|
35
|
-
* Demodulates the signal.
|
|
36
|
-
* @param samplesI The I components of the samples.
|
|
37
|
-
* @param samplesQ The Q components of the samples.
|
|
38
|
-
* @param freqOffset The offset of the signal in the samples.
|
|
39
|
-
* @returns The demodulated audio signal.
|
|
40
|
-
*/
|
|
41
|
-
demodulate(samplesI: Float32Array, samplesQ: Float32Array, freqOffset: number): Demodulated;
|
|
42
|
-
}
|
|
43
|
-
/** Configurator for the NBFM mode. */
|
|
44
|
-
export declare class ConfigNBFM extends Configurator<ModeNBFM> {
|
|
45
|
-
constructor(mode: ModeNBFM | string);
|
|
46
|
-
protected create(): ModeNBFM;
|
|
47
|
-
hasBandwidth(): boolean;
|
|
48
|
-
getBandwidth(): number;
|
|
49
|
-
setBandwidth(bandwidth: number): ConfigNBFM;
|
|
50
|
-
hasSquelch(): boolean;
|
|
51
|
-
getSquelch(): number;
|
|
52
|
-
setSquelch(squelch: number): ConfigNBFM;
|
|
53
|
-
}
|
|
54
|
-
//# sourceMappingURL=demod-nbfm.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"demod-nbfm.d.ts","sourceRoot":"","sources":["../../src/demod/demod-nbfm.ts"],"names":[],"mappings":"AAoBA,OAAO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AI,OAAO;IAGrB,UAAU,IAAI,MAAM;IAGpB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU;CAIxC"}
|
package/dist/demod/demod-nbfm.js
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
// Copyright 2026 Jacobo Tarrio Barreiro. All rights reserved.
|
|
2
|
-
// Copyright 2014 Google Inc. All rights reserved.
|
|
3
|
-
//
|
|
4
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
// you may not use this file except in compliance with the License.
|
|
6
|
-
// You may obtain a copy of the License at
|
|
7
|
-
//
|
|
8
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
//
|
|
10
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
// See the License for the specific language governing permissions and
|
|
14
|
-
// limitations under the License.
|
|
15
|
-
import { makeLowPassKernel } from "../dsp/coefficients.js";
|
|
16
|
-
import { FMDemodulator } from "../dsp/demodulators.js";
|
|
17
|
-
import { FIRFilter, FrequencyShifter } from "../dsp/filters.js";
|
|
18
|
-
import { getPower } from "../dsp/power.js";
|
|
19
|
-
import { ComplexDownsampler } from "../dsp/resamplers.js";
|
|
20
|
-
import { Configurator } from "./modes.js";
|
|
21
|
-
/** A demodulator for narrowband FM signals. */
|
|
22
|
-
export class DemodNBFM {
|
|
23
|
-
outRate;
|
|
24
|
-
mode;
|
|
25
|
-
/**
|
|
26
|
-
* @param inRate The sample rate of the input samples.
|
|
27
|
-
* @param outRate The sample rate of the output audio.
|
|
28
|
-
* @param mode The mode to use initially.
|
|
29
|
-
* @param options Options for the demodulator.
|
|
30
|
-
*/
|
|
31
|
-
constructor(inRate, outRate, mode, options) {
|
|
32
|
-
this.outRate = outRate;
|
|
33
|
-
this.mode = mode;
|
|
34
|
-
const downsamplerTaps = options?.downsamplerTaps || 151;
|
|
35
|
-
this.rfTaps = options?.rfTaps || 151;
|
|
36
|
-
this.shifter = new FrequencyShifter(inRate);
|
|
37
|
-
this.downsampler = new ComplexDownsampler(inRate, outRate, downsamplerTaps);
|
|
38
|
-
const kernel = makeLowPassKernel(outRate, mode.maxF, this.rfTaps);
|
|
39
|
-
this.filterI = new FIRFilter(kernel);
|
|
40
|
-
this.filterQ = new FIRFilter(kernel);
|
|
41
|
-
this.demodulator = new FMDemodulator(mode.maxF / outRate);
|
|
42
|
-
}
|
|
43
|
-
rfTaps;
|
|
44
|
-
shifter;
|
|
45
|
-
downsampler;
|
|
46
|
-
filterI;
|
|
47
|
-
filterQ;
|
|
48
|
-
demodulator;
|
|
49
|
-
getMode() {
|
|
50
|
-
return this.mode;
|
|
51
|
-
}
|
|
52
|
-
setMode(mode) {
|
|
53
|
-
this.mode = mode;
|
|
54
|
-
const kernel = makeLowPassKernel(this.outRate, mode.maxF, this.rfTaps);
|
|
55
|
-
this.filterI.setCoefficients(kernel);
|
|
56
|
-
this.filterQ.setCoefficients(kernel);
|
|
57
|
-
this.demodulator.setMaxDeviation(mode.maxF / this.outRate);
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Demodulates the signal.
|
|
61
|
-
* @param samplesI The I components of the samples.
|
|
62
|
-
* @param samplesQ The Q components of the samples.
|
|
63
|
-
* @param freqOffset The offset of the signal in the samples.
|
|
64
|
-
* @returns The demodulated audio signal.
|
|
65
|
-
*/
|
|
66
|
-
demodulate(samplesI, samplesQ, freqOffset) {
|
|
67
|
-
this.shifter.inPlace(samplesI, samplesQ, -freqOffset);
|
|
68
|
-
const [I, Q] = this.downsampler.downsample(samplesI, samplesQ);
|
|
69
|
-
let allPower = getPower(I, Q);
|
|
70
|
-
this.filterI.inPlace(I);
|
|
71
|
-
this.filterQ.inPlace(Q);
|
|
72
|
-
let signalPower = (getPower(I, Q) * this.outRate) / (this.mode.maxF * 2);
|
|
73
|
-
this.demodulator.demodulate(I, Q, I);
|
|
74
|
-
return {
|
|
75
|
-
left: I,
|
|
76
|
-
right: new Float32Array(I),
|
|
77
|
-
stereo: false,
|
|
78
|
-
snr: signalPower / allPower,
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
/** Configurator for the NBFM mode. */
|
|
83
|
-
export class ConfigNBFM extends Configurator {
|
|
84
|
-
constructor(mode) {
|
|
85
|
-
super(mode);
|
|
86
|
-
}
|
|
87
|
-
create() {
|
|
88
|
-
return { scheme: "NBFM", maxF: 5000, squelch: 0 };
|
|
89
|
-
}
|
|
90
|
-
hasBandwidth() {
|
|
91
|
-
return true;
|
|
92
|
-
}
|
|
93
|
-
getBandwidth() {
|
|
94
|
-
return 2 * this.mode.maxF;
|
|
95
|
-
}
|
|
96
|
-
setBandwidth(bandwidth) {
|
|
97
|
-
this.mode = {
|
|
98
|
-
...this.mode,
|
|
99
|
-
maxF: Math.max(125, Math.min(bandwidth / 2, 15000)),
|
|
100
|
-
};
|
|
101
|
-
return this;
|
|
102
|
-
}
|
|
103
|
-
hasSquelch() {
|
|
104
|
-
return true;
|
|
105
|
-
}
|
|
106
|
-
getSquelch() {
|
|
107
|
-
return this.mode.squelch;
|
|
108
|
-
}
|
|
109
|
-
setSquelch(squelch) {
|
|
110
|
-
this.mode = { ...this.mode, squelch: Math.max(0, Math.min(squelch, 6)) };
|
|
111
|
-
return this;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
//# sourceMappingURL=demod-nbfm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"demod-nbfm.js","sourceRoot":"","sources":["../../src/demod/demod-nbfm.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,kDAAkD;AAClD,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE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
3
|
-
export type ModeSSB = {
|
|
4
|
-
scheme: "USB" | "LSB";
|
|
5
|
-
bandwidth: number;
|
|
6
|
-
squelch: number;
|
|
7
|
-
};
|
|
8
|
-
/** Mode options for SSB. */
|
|
9
|
-
export type OptionsSSB = {
|
|
10
|
-
/** Number of taps for the downsampler filter. Must be an odd number. 151 by default. */
|
|
11
|
-
downsamplerTaps?: number;
|
|
12
|
-
/** Number of taps for the RF filter. Must be an odd number. 151 by default. */
|
|
13
|
-
rfTaps?: number;
|
|
14
|
-
/** Number of taps for the Hilbert filter. Must be an odd number. 151 by default. */
|
|
15
|
-
hilbertTaps?: number;
|
|
16
|
-
};
|
|
17
|
-
/** A demodulator for single-sideband modulated signals. */
|
|
18
|
-
export declare class DemodSSB implements Demod<ModeSSB> {
|
|
19
|
-
private outRate;
|
|
20
|
-
private mode;
|
|
21
|
-
/**
|
|
22
|
-
* @param inRate The sample rate of the input samples.
|
|
23
|
-
* @param outRate The sample rate of the output audio.
|
|
24
|
-
* @param mode The mode to use initially.
|
|
25
|
-
*/
|
|
26
|
-
constructor(inRate: number, outRate: number, mode: ModeSSB, options?: OptionsSSB);
|
|
27
|
-
private rfTaps;
|
|
28
|
-
private shifter;
|
|
29
|
-
private downsampler;
|
|
30
|
-
private filter;
|
|
31
|
-
private demodulator;
|
|
32
|
-
private agc;
|
|
33
|
-
getMode(): ModeSSB;
|
|
34
|
-
setMode(mode: ModeSSB): void;
|
|
35
|
-
/**
|
|
36
|
-
* Demodulates the signal.
|
|
37
|
-
* @param samplesI The I components of the samples.
|
|
38
|
-
* @param samplesQ The Q components of the samples.
|
|
39
|
-
* @param freqOffset The offset of the signal in the samples.
|
|
40
|
-
* @returns The demodulated audio signal.
|
|
41
|
-
*/
|
|
42
|
-
demodulate(samplesI: Float32Array, samplesQ: Float32Array, freqOffset: number): Demodulated;
|
|
43
|
-
}
|
|
44
|
-
/** Configurator for the USB and LSB modes. */
|
|
45
|
-
export declare class ConfigSSB extends Configurator<ModeSSB> {
|
|
46
|
-
constructor(mode: ModeSSB | string);
|
|
47
|
-
protected create(scheme: string): ModeSSB;
|
|
48
|
-
hasBandwidth(): boolean;
|
|
49
|
-
getBandwidth(): number;
|
|
50
|
-
setBandwidth(bandwidth: number): ConfigSSB;
|
|
51
|
-
hasSquelch(): boolean;
|
|
52
|
-
getSquelch(): number;
|
|
53
|
-
setSquelch(squelch: number): ConfigSSB;
|
|
54
|
-
}
|
|
55
|
-
//# sourceMappingURL=demod-ssb.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"demod-ssb.d.ts","sourceRoot":"","sources":["../../src/demod/demod-ssb.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9D,+BAA+B;AAC/B,MAAM,MAAM,OAAO,GAAG;IACpB,MAAM,EAAE,KAAK,GAAG,KAAK,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,4BAA4B;AAC5B,MAAM,MAAM,UAAU,GAAG;IACvB,wFAAwF;IACxF,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,+EAA+E;IAC/E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oFAAoF;IACpF,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,2DAA2D;AAC3D,qBAAa,QAAS,YAAW,KAAK,CAAC,OAAO,CAAC;IAQ3C,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,IAAI;IARd;;;;OAIG;gBAED,MAAM,EAAE,MAAM,EACN,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,OAAO,EACrB,OAAO,CAAC,EAAE,UAAU;IAoBtB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,OAAO,CAAmB;IAClC,OAAO,CAAC,WAAW,CAAqB;IACxC,OAAO,CAAC,MAAM,CAAY;IAC1B,OAAO,CAAC,WAAW,CAAiB;IACpC,OAAO,CAAC,GAAG,CAAM;IAEjB,OAAO,IAAI,OAAO;IAIlB,OAAO,CAAC,IAAI,EAAE,OAAO;IAUrB;;;;;;OAMG;IACH,UAAU,CACR,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,YAAY,EACtB,UAAU,EAAE,MAAM,GACjB,WAAW;CAgBf;AAED,8CAA8C;AAC9C,qBAAa,SAAU,SAAQ,YAAY,CAAC,OAAO,CAAC;gBACtC,IAAI,EAAE,OAAO,GAAG,MAAM;IAGlC,SAAS,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAGzC,YAAY,IAAI,OAAO;IAGvB,YAAY,IAAI,MAAM;IAGtB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS;IAO1C,UAAU,IAAI,OAAO;IAGrB,UAAU,IAAI,MAAM;IAGpB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS;CAIvC"}
|
package/dist/demod/demod-ssb.js
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
// Copyright 2026 Jacobo Tarrio Barreiro. All rights reserved.
|
|
2
|
-
// Copyright 2014 Google Inc. All rights reserved.
|
|
3
|
-
//
|
|
4
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
// you may not use this file except in compliance with the License.
|
|
6
|
-
// You may obtain a copy of the License at
|
|
7
|
-
//
|
|
8
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
//
|
|
10
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
// See the License for the specific language governing permissions and
|
|
14
|
-
// limitations under the License.
|
|
15
|
-
import { makeLowPassKernel } from "../dsp/coefficients.js";
|
|
16
|
-
import { Sideband, SSBDemodulator } from "../dsp/demodulators.js";
|
|
17
|
-
import { FrequencyShifter, AGC, FIRFilter } from "../dsp/filters.js";
|
|
18
|
-
import { getPower } from "../dsp/power.js";
|
|
19
|
-
import { ComplexDownsampler } from "../dsp/resamplers.js";
|
|
20
|
-
import { Configurator } from "./modes.js";
|
|
21
|
-
/** A demodulator for single-sideband modulated signals. */
|
|
22
|
-
export class DemodSSB {
|
|
23
|
-
outRate;
|
|
24
|
-
mode;
|
|
25
|
-
/**
|
|
26
|
-
* @param inRate The sample rate of the input samples.
|
|
27
|
-
* @param outRate The sample rate of the output audio.
|
|
28
|
-
* @param mode The mode to use initially.
|
|
29
|
-
*/
|
|
30
|
-
constructor(inRate, outRate, mode, options) {
|
|
31
|
-
this.outRate = outRate;
|
|
32
|
-
this.mode = mode;
|
|
33
|
-
const downsamplerTaps = options?.downsamplerTaps || 151;
|
|
34
|
-
this.rfTaps = options?.rfTaps || 151;
|
|
35
|
-
const hilbertTaps = options?.hilbertTaps || 151;
|
|
36
|
-
this.shifter = new FrequencyShifter(inRate);
|
|
37
|
-
this.downsampler = new ComplexDownsampler(inRate, outRate, downsamplerTaps);
|
|
38
|
-
const kernel = makeLowPassKernel(this.outRate, mode.bandwidth / 2, this.rfTaps);
|
|
39
|
-
this.filter = new FIRFilter(kernel);
|
|
40
|
-
this.demodulator = new SSBDemodulator(mode.scheme == "USB" ? Sideband.Upper : Sideband.Lower, hilbertTaps);
|
|
41
|
-
this.agc = new AGC(outRate, 3);
|
|
42
|
-
}
|
|
43
|
-
rfTaps;
|
|
44
|
-
shifter;
|
|
45
|
-
downsampler;
|
|
46
|
-
filter;
|
|
47
|
-
demodulator;
|
|
48
|
-
agc;
|
|
49
|
-
getMode() {
|
|
50
|
-
return this.mode;
|
|
51
|
-
}
|
|
52
|
-
setMode(mode) {
|
|
53
|
-
this.mode = mode;
|
|
54
|
-
const kernel = makeLowPassKernel(this.outRate, mode.bandwidth / 2, this.rfTaps);
|
|
55
|
-
this.filter.setCoefficients(kernel);
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Demodulates the signal.
|
|
59
|
-
* @param samplesI The I components of the samples.
|
|
60
|
-
* @param samplesQ The Q components of the samples.
|
|
61
|
-
* @param freqOffset The offset of the signal in the samples.
|
|
62
|
-
* @returns The demodulated audio signal.
|
|
63
|
-
*/
|
|
64
|
-
demodulate(samplesI, samplesQ, freqOffset) {
|
|
65
|
-
this.shifter.inPlace(samplesI, samplesQ, -freqOffset);
|
|
66
|
-
const [I, Q] = this.downsampler.downsample(samplesI, samplesQ);
|
|
67
|
-
let allPower = getPower(I, Q);
|
|
68
|
-
this.demodulator.demodulate(I, Q, I);
|
|
69
|
-
this.filter.inPlace(I);
|
|
70
|
-
let signalPower = (getPower(I, I) * this.outRate) / (this.mode.bandwidth * 2);
|
|
71
|
-
this.agc.inPlace(I);
|
|
72
|
-
return {
|
|
73
|
-
left: I,
|
|
74
|
-
right: new Float32Array(I),
|
|
75
|
-
stereo: false,
|
|
76
|
-
snr: signalPower / allPower,
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
/** Configurator for the USB and LSB modes. */
|
|
81
|
-
export class ConfigSSB extends Configurator {
|
|
82
|
-
constructor(mode) {
|
|
83
|
-
super(mode);
|
|
84
|
-
}
|
|
85
|
-
create(scheme) {
|
|
86
|
-
return { scheme: scheme, bandwidth: 2800, squelch: 0 };
|
|
87
|
-
}
|
|
88
|
-
hasBandwidth() {
|
|
89
|
-
return true;
|
|
90
|
-
}
|
|
91
|
-
getBandwidth() {
|
|
92
|
-
return this.mode.bandwidth;
|
|
93
|
-
}
|
|
94
|
-
setBandwidth(bandwidth) {
|
|
95
|
-
this.mode = {
|
|
96
|
-
...this.mode,
|
|
97
|
-
bandwidth: Math.max(10, Math.min(bandwidth, 15000)),
|
|
98
|
-
};
|
|
99
|
-
return this;
|
|
100
|
-
}
|
|
101
|
-
hasSquelch() {
|
|
102
|
-
return true;
|
|
103
|
-
}
|
|
104
|
-
getSquelch() {
|
|
105
|
-
return this.mode.squelch;
|
|
106
|
-
}
|
|
107
|
-
setSquelch(squelch) {
|
|
108
|
-
this.mode = { ...this.mode, squelch: Math.max(0, Math.min(squelch, 6)) };
|
|
109
|
-
return this;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
//# sourceMappingURL=demod-ssb.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"demod-ssb.js","sourceRoot":"","sources":["../../src/demod/demod-ssb.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,kDAAkD;AAClD,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAsB,MAAM,YAAY,CAAC;AAmB9D,2DAA2D;AAC3D,MAAM,OAAO,QAAQ;IAQT;IACA;IARV;;;;OAIG;IACH,YACE,MAAc,EACN,OAAe,EACf,IAAa,EACrB,OAAoB;QAFZ,YAAO,GAAP,OAAO,CAAQ;QACf,SAAI,GAAJ,IAAI,CAAS;QAGrB,MAAM,eAAe,GAAG,OAAO,EAAE,eAAe,IAAI,GAAG,CAAC;QACxD,IAAI,CAAC,MAAM,GAAG,OAAO,EAAE,MAAM,IAAI,GAAG,CAAC;QACrC,MAAM,WAAW,GAAG,OAAO,EAAE,WAAW,IAAI,GAAG,CAAC;QAChD,IA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AAG,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;SACpD,CAAC;QACF,OAAO,IAAI,CAAC;IACd,CAAC;IACD,UAAU;QACR,OAAO,IAAI,CAAC;IACd,CAAC;IACD,UAAU;QACR,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;IAC3B,CAAC;IACD,UAAU,CAAC,OAAe;QACxB,IAAI,CAAC,IAAI,GAAG,EAAE,GAAG,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACzE,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import { Configurator, Demod, Demodulated } from "./modes.js";
|
|
2
|
-
/** Mode parameters for WBFM. */
|
|
3
|
-
export type ModeWBFM = {
|
|
4
|
-
scheme: "WBFM";
|
|
5
|
-
stereo: boolean;
|
|
6
|
-
};
|
|
7
|
-
/** Mode options for WBFM. */
|
|
8
|
-
export type OptionsWBFM = {
|
|
9
|
-
/**
|
|
10
|
-
* The time constant for the deemphasizer, in microseconds. 50 by default.
|
|
11
|
-
*
|
|
12
|
-
* This should be 75 for the US and South Korea, 50 everywhere else.
|
|
13
|
-
*/
|
|
14
|
-
deemphasizerTc?: number;
|
|
15
|
-
/** Number of taps for the downsampler filter. Must be an odd number. 151 by default. */
|
|
16
|
-
downsamplerTaps?: number;
|
|
17
|
-
/** Number of taps for the RF filter. Must be an odd number. 151 by default. */
|
|
18
|
-
rfTaps?: number;
|
|
19
|
-
/** Number of taps for the audio filter. Must be an odd number. 41 by default. */
|
|
20
|
-
audioTaps?: number;
|
|
21
|
-
};
|
|
22
|
-
/** A demodulator for wideband FM signals. */
|
|
23
|
-
export declare class DemodWBFM implements Demod<ModeWBFM> {
|
|
24
|
-
private mode;
|
|
25
|
-
/**
|
|
26
|
-
* @param inRate The sample rate of the input samples.
|
|
27
|
-
* @param outRate The sample rate of the output samples.
|
|
28
|
-
* @param mode The mode to use initially.
|
|
29
|
-
* @param options Options for the demodulator.
|
|
30
|
-
*/
|
|
31
|
-
constructor(inRate: number, outRate: number, mode: ModeWBFM, options?: OptionsWBFM);
|
|
32
|
-
private stage1;
|
|
33
|
-
private stage2;
|
|
34
|
-
getMode(): ModeWBFM;
|
|
35
|
-
setMode(mode: ModeWBFM): void;
|
|
36
|
-
/**
|
|
37
|
-
* Demodulates the signal.
|
|
38
|
-
* @param samplesI The I components of the samples.
|
|
39
|
-
* @param samplesQ The Q components of the samples.
|
|
40
|
-
* @param freqOffset The offset of the signal in the samples.
|
|
41
|
-
* @returns The demodulated audio signal.
|
|
42
|
-
*/
|
|
43
|
-
demodulate(samplesI: Float32Array, samplesQ: Float32Array, freqOffset: number): Demodulated;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* First stage demodulator for wideband FM signals.
|
|
47
|
-
* Returns the raw demodulated FM signal, with stereo pilot, difference signal and RDS, if they exist.
|
|
48
|
-
* The output is duplicated in the left and right channels.
|
|
49
|
-
*/
|
|
50
|
-
export declare class DemodWBFMStage1 implements Demod<ModeWBFM> {
|
|
51
|
-
private outRate;
|
|
52
|
-
private mode;
|
|
53
|
-
/**
|
|
54
|
-
* @param inRate The sample rate of the input samples.
|
|
55
|
-
* @param outRate The sample rate of the output audio.
|
|
56
|
-
* @param mode The mode to use initially.
|
|
57
|
-
* @param options Options for the demodulator.
|
|
58
|
-
*/
|
|
59
|
-
constructor(inRate: number, outRate: number, mode: ModeWBFM, options?: OptionsWBFM);
|
|
60
|
-
private shifter;
|
|
61
|
-
private downsampler?;
|
|
62
|
-
private filterI;
|
|
63
|
-
private filterQ;
|
|
64
|
-
private demodulator;
|
|
65
|
-
getMode(): ModeWBFM;
|
|
66
|
-
setMode(mode: ModeWBFM): void;
|
|
67
|
-
/**
|
|
68
|
-
* Demodulates the signal.
|
|
69
|
-
* @param samplesI The I components of the samples.
|
|
70
|
-
* @param samplesQ The Q components of the samples.
|
|
71
|
-
* @param freqOffset The offset of the signal in the samples.
|
|
72
|
-
* @returns The demodulated audio signal.
|
|
73
|
-
*/
|
|
74
|
-
demodulate(samplesI: Float32Array, samplesQ: Float32Array, freqOffset: number): Demodulated;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Second stage demodulator for wideband FM signals.
|
|
78
|
-
* Takes the output of stage 1 and does stereo extraction.
|
|
79
|
-
* Only the I channel is used; Q channel is ignored.
|
|
80
|
-
* */
|
|
81
|
-
export declare class DemodWBFMStage2 implements Demod<ModeWBFM> {
|
|
82
|
-
private mode;
|
|
83
|
-
/**
|
|
84
|
-
* @param inRate The sample rate of the input samples.
|
|
85
|
-
* @param outRate The sample rate of the output audio.
|
|
86
|
-
* @param mode The mode to use initially.
|
|
87
|
-
* @param options Options for the demodulator.
|
|
88
|
-
*/
|
|
89
|
-
constructor(inRate: number, outRate: number, mode: ModeWBFM, options?: OptionsWBFM);
|
|
90
|
-
private monoSampler;
|
|
91
|
-
private stereoSampler;
|
|
92
|
-
private stereoSeparator;
|
|
93
|
-
private leftDeemph;
|
|
94
|
-
private rightDeemph;
|
|
95
|
-
getMode(): ModeWBFM;
|
|
96
|
-
setMode(mode: ModeWBFM): void;
|
|
97
|
-
/**
|
|
98
|
-
* Demodulates the signal.
|
|
99
|
-
* @param samplesI The I components of the samples.
|
|
100
|
-
* @returns The demodulated audio signal.
|
|
101
|
-
*/
|
|
102
|
-
demodulate(samplesI: Float32Array): Demodulated;
|
|
103
|
-
}
|
|
104
|
-
/** Configurator for the WBFM mode. */
|
|
105
|
-
export declare class ConfigWBFM extends Configurator<ModeWBFM> {
|
|
106
|
-
constructor(mode: ModeWBFM | string);
|
|
107
|
-
protected create(): ModeWBFM;
|
|
108
|
-
hasStereo(): boolean;
|
|
109
|
-
getStereo(): boolean;
|
|
110
|
-
setStereo(stereo: boolean): ConfigWBFM;
|
|
111
|
-
getBandwidth(): number;
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