-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
87 lines (78 loc) · 2.45 KB
/
types.ts
File metadata and controls
87 lines (78 loc) · 2.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// Tipos originales existentes
export enum SystemState {
IDLE = 'idle',
INITIALIZING = 'initializing',
STABLE = 'stable',
QUANTUM_EVENT = 'quantum_event',
DECIMATING = 'decimating' // Nuevo estado para diezmado
}
export interface ReferenceState {
mean: number[];
covariance: number[] | null;
initialized: boolean;
}
export interface Experience {
id: number;
timestamp: number;
features: number[];
distance: number;
state: SystemState;
}
export interface CapturedEvent {
id: number;
timestamp: number;
stateVector: number[]; // The ML features vector
distance: number;
waveform: Uint8Array; // The raw time-domain data snippet
}
export interface Bird {
id: string;
name: string;
featureVector: number[];
}
export interface Identification {
id: number;
timestamp: number;
birdName: string;
confidence: number;
}
// Nuevos tipos para diezmado de frecuencias
export interface DecimationEvent {
id: number;
timestamp: number;
type: 'amplitude_peak' | 'frequency_spike' | 'harmonic_resonance' | 'spectral_anomaly';
frequency: number; // Frecuencia principal en Hz
amplitude: number; // Amplitud normalizada (0-1)
decimationFactor: number; // Factor de diezmado aplicado (2x, 4x, 8x, etc.)
signalToNoise: number; // Relación señal-ruido en dB
spectralBandwidth?: number; // Ancho de banda espectral en Hz
harmonics?: number[]; // Frecuencias armónicas detectadas
originalSampleRate: number; // Frecuencia de muestreo original
decimatedSampleRate: number; // Frecuencia de muestreo después del diezmado
energyConcentration: number; // Concentración de energía (0-1)
phaseInfo?: {
phase: number; // Fase en radianes
coherence: number; // Coherencia de fase (0-1)
};
}
export interface FrequencyBin {
frequency: number;
magnitude: number;
phase: number;
}
export interface DecimationAnalysis {
originalSignal: Float32Array;
decimatedSignal: Float32Array;
aliasing: number; // Nivel de aliasing detectado (0-1)
informationLoss: number; // Pérdida de información estimada (0-1)
reconstructionError: number; // Error de reconstrucción
optimalFactor: number; // Factor de diezmado óptimo sugerido
}
export interface SpectralFeatures {
centroid: number; // Centro de masa espectral
rolloff: number; // Punto de rolloff (85% de energía)
flux: number; // Flujo espectral
flatness: number; // Planitud espectral
crest: number; // Factor de cresta
entropy: number; // Entropía espectral
}