mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 05:13:46 -07:00
data iir, shiftgraphzero - now uses cliparser
This commit is contained in:
parent
1550bada28
commit
9b1f7ca7a3
2 changed files with 31 additions and 8 deletions
|
@ -1106,9 +1106,21 @@ static int CmdUndecimate(const char *Cmd) {
|
|||
|
||||
// shift graph zero up or down based on input + or -
|
||||
static int CmdGraphShiftZero(const char *Cmd) {
|
||||
int shift = 0;
|
||||
//set options from parameters entered with the command
|
||||
sscanf(Cmd, "%i", &shift);
|
||||
|
||||
CLIParserContext *ctx;
|
||||
CLIParserInit(&ctx, "data shiftgraphzero",
|
||||
"Shift 0 for Graphed wave + or - shift value",
|
||||
"data shiftgraphzero -n 10 --> shift 10 points\n"
|
||||
"data shiftgraphzero -n -22 --> shift negative 22 points"
|
||||
);
|
||||
void *argtable[] = {
|
||||
arg_param_begin,
|
||||
arg_int1("n", NULL, "<dec>", "shift + or -"),
|
||||
arg_param_end
|
||||
};
|
||||
CLIExecWithReturn(ctx, Cmd, argtable, false);
|
||||
int shift = arg_get_int_def(ctx, 1, 0);
|
||||
CLIParserFree(ctx);
|
||||
|
||||
for (size_t i = 0; i < GraphTraceLen; i++) {
|
||||
int shiftedVal = GraphBuffer[i] + shift;
|
||||
|
@ -2536,8 +2548,21 @@ static int CmdFSKToNRZ(const char *Cmd) {
|
|||
}
|
||||
|
||||
static int CmdDataIIR(const char *Cmd) {
|
||||
uint8_t k = param_get8(Cmd, 0);
|
||||
//iceIIR_Butterworth(GraphBuffer, GraphTraceLen);
|
||||
|
||||
CLIParserContext *ctx;
|
||||
CLIParserInit(&ctx, "data iir",
|
||||
"Apply IIR buttersworth filter on plot data",
|
||||
"data iir -n 2"
|
||||
);
|
||||
void *argtable[] = {
|
||||
arg_param_begin,
|
||||
arg_u64_1("n", NULL, "<dec>", "factor n"),
|
||||
arg_param_end
|
||||
};
|
||||
CLIExecWithReturn(ctx, Cmd, argtable, false);
|
||||
uint8_t k = arg_get_u32_def(ctx, 1, 0);
|
||||
CLIParserFree(ctx);
|
||||
|
||||
iceSimple_Filter(GraphBuffer, GraphTraceLen, k);
|
||||
|
||||
uint8_t bits[GraphTraceLen];
|
||||
|
|
|
@ -7,9 +7,7 @@ data rawdemod
|
|||
data askedgedetect
|
||||
data autocorr
|
||||
data dirthreshold
|
||||
data iir
|
||||
data setgraphmarkers
|
||||
data shiftgraphzero
|
||||
hf 15 dump
|
||||
hf 15 info
|
||||
hf 15 raw
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue