Identification cards - Test methods - Part 6: Proximity cards - Amendment 5: Bit rates of 3fc/4, fc, 3fc/2 and 2fc from PCD to PICC

Cartes d'identification — Méthodes d'essai — Partie 6: Cartes de proximité — Amendement 5: Débits binaires de 3fc/4, fc, 3fc/2 et 2fc de PCD à PICC

General Information

Status
Withdrawn
Current Stage
5098 - Project deleted
Start Date
10-Mar-2014
Completion Date
30-Oct-2025
Ref Project

Relations

Draft
ISO/IEC 10373-6:2011/FDAmd 5 - Bit rates of 3fc/4, fc, 3fc/2 and 2fc from PCD to PICC
English language
64 pages
sale 15% off
sale 15% off

Frequently Asked Questions

ISO/IEC 10373-6:2011/FDAmd 5 is a draft published by the International Organization for Standardization (ISO). Its full title is "Identification cards - Test methods - Part 6: Proximity cards - Amendment 5: Bit rates of 3fc/4, fc, 3fc/2 and 2fc from PCD to PICC". This standard covers: Identification cards - Test methods - Part 6: Proximity cards - Amendment 5: Bit rates of 3fc/4, fc, 3fc/2 and 2fc from PCD to PICC

Identification cards - Test methods - Part 6: Proximity cards - Amendment 5: Bit rates of 3fc/4, fc, 3fc/2 and 2fc from PCD to PICC

ISO/IEC 10373-6:2011/FDAmd 5 is classified under the following ICS (International Classification for Standards) categories: 35.240.15 - Identification cards. Chip cards. Biometrics. The ICS classification helps identify the subject area and facilitates finding related standards.

ISO/IEC 10373-6:2011/FDAmd 5 has the following relationships with other standards: It is inter standard links to ISO/IEC 10373-6:2016, ISO/IEC 10373-6:2011. Understanding these relationships helps ensure you are using the most current and applicable version of the standard.

You can purchase ISO/IEC 10373-6:2011/FDAmd 5 directly from iTeh Standards. The document is available in PDF format and is delivered instantly after payment. Add the standard to your cart and complete the secure checkout process. iTeh Standards is an authorized distributor of ISO standards.

Standards Content (Sample)


FINAL ISO/IEC
AMENDMENT
DRAFT 10373-6:2011
FDAM 5
ISO/IEC JTC 1
Identification cards — Test methods —
Secretariat: ANSI
Part 6:
Voting begins on:
2013-10-02
Proximity cards
Voting terminates on:
AMENDMENT 5: Bit rates of 3fc/4, fc, 3fc/2
2013-12-02
and 2fc from PCD to PICC
Cartes d'identification — Méthodes d'essai —
Partie 6: Cartes de proximité
AMENDEMENT 5: Débits binaires de 3fc/4, fc, 3fc/2 et 2fc de PCD à
PICC
RECIPIENTS OF THIS DRAFT ARE INVITED TO
SUBMIT, WITH THEIR COMMENTS, NOTIFICATION
OF ANY RELEVANT PATENT RIGHTS OF WHICH
THEY ARE AWARE AND TO PROVIDE SUPPORT-
ING DOCUMENTATION.
IN ADDITION TO THEIR EVALUATION AS
Reference number
BEING ACCEPTABLE FOR INDUSTRIAL, TECHNO-
ISO/IEC 10373-6:2011/FDAM 5:2013(E)
LOGICAL, COMMERCIAL AND USER PURPOSES,
DRAFT INTERNATIONAL STANDARDS MAY ON
OCCASION HAVE TO BE CONSIDERED IN THE
LIGHT OF THEIR POTENTIAL TO BECOME STAN-
DARDS TO WHICH REFERENCE MAY BE MADE IN
©
ISO/IEC 2013
NATIONAL REGULATIONS.
ISO/IEC 10373-6:2011/FDAM 5:2013(E)

©  ISO/IEC 2013
All rights reserved. Unless otherwise specified, no part of this publication may be reproduced or utilized otherwise in any form or by any
means, electronic or mechanical, including photocopying, or posting on the internet or an intranet, without prior written permission.
Permission can be requested from either ISO at the address below or ISO’s member body in the country of the requester.
ISO copyright office
Case postale 56  CH-1211 Geneva 20
Tel. + 41 22 749 01 11
Fax + 41 22 749 09 47
E-mail copyright@iso.org
Web www.iso.org
Published in Switzerland
ii © ISO/IEC 2013 – All rights reserved

ISO/IEC 10373-6:2011/FDAM 5:2013(E)
Foreword
ISO (the International Organization for Standardization) and IEC (the International Electrotechnical
Commission) form the specialized system for worldwide standardization. National bodies that are members of
ISO or IEC participate in the development of International Standards through technical committees
established by the respective organization to deal with particular fields of technical activity. ISO and IEC
technical committees collaborate in fields of mutual interest. Other international organizations, governmental
and non-governmental, in liaison with ISO and IEC, also take part in the work. In the field of information
technology, ISO and IEC have established a joint technical committee, ISO/IEC JTC 1.
International Standards are drafted in accordance with the rules given in the ISO/IEC Directives, Part 2.
The main task of the joint technical committee is to prepare International Standards. Draft International
Standards adopted by the joint technical committee are circulated to national bodies for voting. Publication as
an International Standard requires approval by at least 75 % of the national bodies casting a vote.
Attention is drawn to the possibility that some of the elements of this document may be the subject of patent
rights. ISO and IEC shall not be held responsible for identifying any or all such patent rights.
Amendment 5 to ISO/IEC 10373-6:2011 was prepared by Joint Technical Committee ISO/IEC JTC 1,
Information technology, Subcommittee SC 17, Cards and personal identification.

© ISO/IEC 2013 – All rights reserved iii

FINAL DRAFT AMENDMENT ISO/IEC 10373-6:2011/FDAM 5:2013(E)

Identification cards — Test methods — Part 6: Proximity cards
Amendment 5: Bit rates of 3fc/4, fc, 3fc/2 and 2fc from PCD to
PICC
Page 22
Add new subclause
"
7.3 Test methods for bit rates of 3fc/4, fc, 3fc/2 and 2fc from PCD to PICC
See Annex J.
"
After Annex I
Add following new annex:
© ISO/IEC 2013 – All rights reserved 1

ISO/IEC 10373-6:2011/FDAM 5:2013(E)
Annex J
(normative)
Test methods for bit rates of 3fc/4, fc, 3fc/2 and 2fc from PCD to PICC
J.1 Overview
This annex specifies the test methods for bit rates of 3fc/4, fc, 3fc/2 and 2fc from PCD to PICC.
NOTE Future revisions of ISO/IEC 14443 and ISO/IEC 10373-6 may specify new NPV tolerance and phase noise
values with corresponding test methods.
J.2 Test of ISO/IEC 14443-2 parameters
J.2.1 PCD Tests
All the tests described below will be done in the operating volume as defined by the PCD manufacturer.
J.2.1.1 PCD phase range and waveform characteristics
J.2.1.1.1 Purpose
This test is used to determine the PR as well as the normalized differential phase noise and inter-symbol
interference parameters, ISI and ISI , as defined in ISO/IEC 14443-2:2010/Amd 5.
m d
J.2.1.1.2 Test procedure
Apply the procedure defined in 7.1.4.2 with the following adaptations:
 After the activation of a bit rate of 3fc/4, fc, 3fc/2 or 2fc, the PCD shall transmit an
I(0) (TEST_COMMAND1(1)).
 In steps a) and f) of 7.1.4.2, the waveform characteristics shall be determined using the analysis tool
defined in J.3.
J.2.1.1.3 Test report
The test report shall give the measured PR, ISI , ISI and the normalized differential phase noise values of the
m d
PCD field, within the defined operating volume in unloaded and loaded conditions.
NOTE J.3.13 gives some example test reports.
J.2.2 PICC Tests
J.2.2.1 PICC reception
J.2.2.2 Purpose
The purpose of this test is to verify the ability of the PICC to receive PCD commands for bit rates of 3fc/4, fc,
3fc/2 and 2fc.
2 © ISO/IEC 2013 – All rights reserved

ISO/IEC 10373-6:2011/FDAM 5:2013(E)
J.2.2.3 Test conditions
Four test conditions are defined at the border of the PICC signal parameters as defined in
ISO/IEC 14443-2:2010/Amd 5. A low pass filtered pseudo-random white noise as defined in J.4.3 is added to
the transmitted APVs such that the normalized differential phase noise (rms) is the maximum value as defined
in ISO/IEC 14443-2:2010/Amd 5. The test conditions are created using the test PCD assembly in combination
with digital pre-conditioning of the transmitted APVs as shown in J.4:
 Condition 1: the test PCD signal is digitally pre-conditioned to have the maximum ISI value for the ISI
m d
value of 45° as defined in ISO/IEC 14443-2:2010/Amd 5;
 Condition 2: the test PCD signal is digitally pre-conditioned to have the maximum ISI value for the ISI
m d
value of -45° as defined in ISO/IEC 14443-2:2010/Amd 5;
 Condition 3: the test PCD signal is digitally pre-conditioned to have the maximum ISI value for the ISI
m d
value of 120° as defined in ISO/IEC 14443-2:2010/Amd 5;
 Condition 4: the test PCD signal is digitally pre-conditioned to have the maximum ISI value for the ISI
m d
value of 0° as defined in ISO/IEC 14443-2:2010/Amd 5.
NOTE 1 These conditions are applied after switching to the bit rate under test.
NOTE 2 J.4 informatively describes how to create the above 4 conditions in the base-band domain (on the complex
envelope of the signal).
These 4 test conditions shall be tested at least using H and H .
min max
J.2.2.4 Test procedure
For each supported bit rate of 3fc/4, fc, 3fc/2 and 2fc, the PICC shall operate under the defined conditions
after the selection of a bit rate. This PICC shall respond correctly to an I(0) (TEST_COMMAND1(1))
transmitted at the specified bit rate.
The activation of the bit rates uses S(PARAMETERS) mechanism as defined in ISO/IEC 14443-4:2008/Amd 3.
NOTE For a frame size higher than 256 bytes a frame with error correction as defined in
ISO/IEC 14443-4:2008/Amd 4 should be used.
J.2.2.5 Test report
The test report shall confirm the intended operation at the bit rates under test. Used test conditions shall be
mentioned in the test report.
J.3 PCD waveform characteristics analysis tool for bit rates of 3fc/4, fc, 3fc/2 and 2fc
J.3.1 Overview
The working principle of the analysis tool for bit rates of 3fc/4, fc, 3fc/2 and 2fc is illustrated in Figure J.1.
© ISO/IEC 2013 – All rights reserved 3

ISO/IEC 10373-6:2011/FDAM 5:2013(E)
Sampling
Capture and
Filter
Anti-aliasing filtering
Homodyne demodulation
Subsampling
Processing and
De-rotation
Conditioning
Notch-filtering
etu grid alignment
Phase range measurement
Intersymbol interference
Parameter
measurement
Determination
Normalized differential phase
noise measurement
Figure J.1 — Block diagram of the analysis tool for bit rates of 3fc/4, fc, 3fc/2 and 2fc
Each block is separately described in the subsequent clauses.
J.3.2 Sampling
The oscilloscope used for signal capturing shall fulfill the requirements defined in 5.1.1. The time and voltage
data of at least 1000 non-modulated carrier periods followed by one data frame, followed by at least 10 non-
modulated carrier periods (see illustration in Figure J.2) shall be transferred to a suitable computer.
Non-
Non-modulated carrier Frame modulated
carrier
Figure J.2 — Non-modulated carrier followed by one frame, followed by non-modulated carrier
J.3.3 Anti-aliasing filtering
A 4th order, Butterworth type low pass filter with 3-dB cut off frequency at 120 MHz shall be used for filtering
higher frequency components The filter characteristic is illustrated in Figure J.3.
4 © ISO/IEC 2013 – All rights reserved

ISO/IEC 10373-6:2011/FDAM 5:2013(E)
Magnitude Response (dB)
-3
-10
-20
-40
-60
-80
-100
-120
-140
50 100 120 150 200 250 300 350 400 450 500
Freqeuncy (MHz)
Phase Response
-50
-100
-150
-200
-250
-300
-350
-400
0 50 100 120 150 200 250 300 350 400 450 500
Freqeuncy (MHz)
Figure J.3 — Anti-aliasing filter characteristics
J.3.4 Homodyne demodulation
The signal shall be demodulated using a homodyne demodulator (IQ demodulator) and the argument of this
complex transform represents the phase signal over time (see Figure J.4).
x 10
-0.2
-0.4
-0.6
-0.8
-1
-1.2
-1.4
-1.6
-1.8
-2
0 0.02 0.04 0.06 0.08 0.1
Time (ms)
Figure J.4 — Example phase signal over time after homodyne demodulation

J.3.5 Subsampling
The phase signal shall be sub-sampled to an integer number multiple of fc using linear interpolation. The
integer number shall be at least 32.
© ISO/IEC 2013 – All rights reserved 5

Phase (degrees)
Phase (degree) Magnitude (dB)
ISO/IEC 10373-6:2011/FDAM 5:2013(E)
J.3.6 De-rotation
This phase signal over time is continuously changing due to the difference between the modulated RF carrier
frequency and the demodulator frequency. This frequency mismatch is computed from the constant phase
slope of the phase signal during the time of the non-modulated carrier. The complete phase signal is
multiplied by a carrier signal whose frequency is the computed frequency difference (see Figure J.5).
-50
-100
-150
0 0.02 0.04 0.06 0.08 0.1
Time (ms)
Figure J.5 — Example phase signal after de-rotation

J.3.7 Notch-filtering
The phase signal contains the second harmonic due to demodulation. The phase signal shall be smoothed
with a moving average filter having a filter period of 2/fc (see Figure J.6).
-10
-20
-30
-40
0 0.02 0.04 0.06 0.08 0.1
Time (ms)
Figure J.6 — Example phase signal after filtering
J.3.8 etu grid alignment
The phase signal shall be aligned to the etu grid of the reference phase signal. The reference phase signal is
computed from the SOC using the method defined in ISO/IEC 14443-2:2010/Amd 5. The etu grid alignment is
carried out by maximizing the computed correlation, using the phase signal and the reference phase signal.
6 © ISO/IEC 2013 – All rights reserved

Phase (degrees)
Phase (degrees)
ISO/IEC 10373-6:2011/FDAM 5:2013(E)
J.3.9 Phase range measurement
The PR parameter shall be determined as defined in ISO/IEC 14443-2:2010/Amd 5.
J.3.10 Intersymbol interference measurement
The ISI and ISI parameters shall be determined from the system identification coefficients. The system
m d
identification coefficients shall be determined by solving the system identification problem given by the phase
signal and the reference phase signal using the Linear Least Squares method. ISI and ISI values shall be
m d
computed for every sampling time within the last carrier period of an etu. The maximum ISI value shall be
m
selected with the related ISI .
d
J.3.11 Normalized differential phase noise measurement
The normalized differential phase noise shall be determined during a section of a non-modulated carrier of at
least 500 carrier periods according to the definition in ISO/IEC 14443-2:2010/Amd 5.
J.3.12 Program of the PCD waveform characteristics analysis tool for bit rates of 3fc/4, fc,
3fc/2 and 2fc (informative)
The following program written in ANSIC language gives an example for the implementation of the analysis tool
for bit rates of 3fc/4, fc, 3fc/2 and 2fc.

This ANSIC implementation consists of 7 files which should be placed in the same folder.

/*****************************************************************************/
/*** psk_defines.h                             ***/
/*** DESCRIPTION:                             ***/
/***  Constants and LUTs for VHBR PSK wave shape tool          ***/
/*****************************************************************************/

#ifndef PSK_DEFINES_H
#define PSK_DEFINES_H
#include "psk_types.h"
#define MAX_SAMPLES 50000
#define PSK_ERR_OK            0 /**< Successful termination */
#define PSK_ERR_READ_FILE        -1 /**< File not found or no read permission */
#define PSK_ERR_PARAMETER        -2 /**< Parameter of function is invalid or unexpected */
#define PSK_ERR_OUT_OF_MEM       -3 /**< Memory allocation failed */
#define PSK_ERR_INVALID_SAMPLE_RATE   -4 /**< Sample rate of signal is not supported */
#define PSK_ERR_INVALID_SAMPLE_VEC   -5 /**< Sample vector could not be downsampled */
#define PSK_ERR_SIGNAL_TOO_SHORT    -6 /**< Insufficient amount of input data for calculation */
#define PSK_SYMBOL_GRID_ALIGNMENT_FAIL -7 /**< Grid alignment not found during analysis */
#define PSK_ERR_SIGNAL_LEN_MISMATCH   -8 /**< Unsupported signal length */

#ifndef M_PI
#define M_PI 3.1415926535897932384626433832795
#endif
#ifndef NULL
#define NULL 0
#endif
// carrier frequency [Hz]
#define FC 13560000
// internal sample frequency of 32 times FC [Hz]
#define FS_INT 433920000
// index of last unmodulated input sample is 480 * FS_INT / FC
#define IDX_UNMOD 15360
#define MIN_NUM_SAMPLES 30000
#define MAX_NUM_SAMPLES 900000

static const psk_uint32 PSK8[] = {1, 1, 7, 7, 1, 1, 7, 7, 1, 1, 7, 7, 1, 1,
7, 7, 1, 1, 7, 7, 1, 1, 7, 7, 1, 1, 7, 7,
© ISO/IEC 2013 – All rights reserved 7

ISO/IEC 10373-6:2011/FDAM 5:2013(E)
1, 1, 7, 7, 1, 1, 7, 7, 1, 1, 7, 7, 1, 1,
7, 7, 1, 7, 1, 7, 0, 0, 7, 3, 6, 1, 5, 3,
6, 2, 2, 2, 7, 1, 0, 3, 5, 2, 3, 5, 2, 3,
6, 0, 7, 2, 3, 3, 7, 6, 4, 5, 6, 1, 6, 5,
2, 6, 1, 3, 4, 0, 2, 0, 6, 6, 7, 0, 5, 7,
3, 7, 3, 0, 3, 6, 6, 1, 1, 0, 6, 4, 0, 6,
3, 5, 6, 1, 1, 1, 2, 6, 7, 0, 7, 0, 7, 3,
1, 2, 4, 2, 1, 5, 7, 4, 0, 3, 3, 2, 3, 4};

static const psk_uint32 PSK16[] = {1, 1, 15, 15, 1, 1, 15, 15, 1, 1,
15, 15, 1, 1, 15, 15, 1, 1, 15, 15,
1, 1, 15, 15, 1, 1, 15, 15, 1, 1,
15, 15, 1, 1, 15, 15, 1, 1, 15, 15,
1, 1, 15, 15, 1, 15, 1, 15, 0, 0,
15, 6, 11, 0, 8, 4, 10, 1, 0, 15,
9, 13, 11, 1, 4, 13, 14, 2, 11, 13,
3, 7, 4, 10, 12, 12, 4, 1, 13, 15,
0, 6, 15, 12, 5, 12, 1, 4, 6, 13,
0, 11, 7, 7, 9, 11, 4, 7, 15, 6,
13, 7, 12, 1, 0, 6, 5, 3, 14, 9,
0, 12, 6, 10, 11, 0, 15, 14, 15, 6,
15, 0, 15, 0, 15, 7, 2, 4, 8, 3,
0, 7, 11, 5, 13, 2, 1, 14, 15, 0};

static const psk_int32 SOC_PSK8_deg[] = { 0, 24, 24, -24, -24, 24, 24,
-24, -24, 24, 24, -24, -24, 24,
24, -24, -24, 24, 24, -24, -24,
24, 24, -24, -24, 24, 24, -24,
-24, 24, 24, -24, -24, 24, 24,
-24, -24, 24, 24, -24, -24, 24,
24, -24, -24, 24, -24, 24, -24,
32, 32, -24,  8, -16, 24, -8,
8, -16, 16, 16, 16, -24, 24,
32,  8, -8, 16,  8, -8, 16,
8, -16, 32, -24, 16,  8,  8,
-24, -16,  0, -8, -16, 24, -16,
-8, 16, -16, 24,  8,  0, 32,
16, 32, -16, -16, -24, 32, -8,
-24,  8, -24,  8, 32,  8, -16,
-16, 24, 24, 32, -16,  0, 32,
-16,  8, -8, -16, 24, 24, 24,
16, -16, -24, 32, -24, 32, -24,
8, 24, 16,  0, 16, 24, -8,
-24,  0, 32,  8,  8, 16,  8, 0};

static const psk_int32 SOC_PSK16_deg[] = { 0, 28, 28, -28, -28, 28, 28,
-28, -28, 28, 28, -28, -28, 28,
28, -28, -28, 28, 28, -28, -28,
28, 28, -28, -28, 28, 28, -28,
-28, 28, 28, -28, -28, 28, 28,
-28, -28, 28, 28, -28, -28, 28,
28, -28, -28, 28, -28, 28, -28,
32, 32, -28,  8, -12, 32,  0,
16, -8, 28, 32, -28, -4, -20,
-12, 28, 16, -20, -24, 24, -12,
-20, 20,  4, 16, -8, -16, -16,
16, 28, -20, -28, 32,  8, -28,
-16, 12, -16, 28, 16,  8, -20,
32, -12,  4,  4, -4, -12, 16,
4, -28,  8, -20,  4, -16, 28,
32,  8, 12, 20, -24, -4, 32,
-16,  8, -8, -12, 32, -28, -24,
-28,  8, -28, 32, -28, 32, -28,
4, 24, 16,  0, 20, 32,  4,
-12, 12, -20, 24, 28, -24, -28, 32};

static const psk_uint32 PSK_len = 141;

// output data types
enum TYPE
{
COMPLEX,
DOUBLE,
INTEGER,
BUTTERCFS
};
8 © ISO/IEC 2013 – All rights reserved

ISO/IEC 10373-6:2011/FDAM 5:2013(E)

/*****************************************************************************/
/**
* The order of the input psk signal is either 16 or 8
*/
extern psk_uint32 ORDER;
/*****************************************************************************/
/**
* The bit rate of the input signal is a user defined parameter and can be
* 3/4 * fc
*   fc
* 3/2 * fc
* 2  * fc
* where fc is the carrier frequency as defined in #FC.
*/
extern psk_double BIT_RATE;
/*****************************************************************************/
/**
* The phase range is the difference between the highest an lowest phase value
* and can be either 56 deg or 60 deg
*/
extern psk_uint32 PR;
/*****************************************************************************/
/**
* The elementary phase interval. 8 deg or 4 deg depending on #ORDER
*/
extern psk_uint32 EPI;
/*****************************************************************************/
/**
* The elementary time unit is always a multiple of #FC.
* 2/FC for bit rates 1.5*FC and 2.0*FC and 4/FC else
*/
extern psk_double ETU;
#endif // PSK_DEFINES_H
/*****************************************************************************/
/*** psk_types.h                             ***/
/*** DESCIRPTION:                             ***/
/***  Definition of used types in psk analysis tool           ***/
/***                                    ***/
/*****************************************************************************/

#ifndef PSK_TYPES_H
#define PSK_TYPES_H
#define RE(z) ( (z).re )
#define IM(z) ( (z).im )
#define ABS(a) ( (a > 0) ? (a) : (-a) )
#define MAX(a, b) ( ( (a) > (b) ) ? (a) : (b) )

#define BUTTER_SIZE_A 5
#define BUTTER_SIZE_B 5
typedef double psk_double;
typedef int psk_int32;
typedef unsigned int psk_uint32;

typedef struct
{
psk_double re;
psk_double im;
} psk_complex;
typedef struct
{
psk_double a[BUTTER_SIZE_A];
psk_double b[BUTTER_SIZE_B];
} psk_butter_coefs;
© ISO/IEC 2013 – All rights reserved 9

ISO/IEC 10373-6:2011/FDAM 5:2013(E)

#endif // PSK_TYPES_H
/*****************************************************************************/
/*** psk_math.h                              ***/
/*** DESCIRPTION: header of psk_math.c                  ***/
/*** It contains the function declaration of used mathematical functions ***/
/*** for the PSK waveform characteristics analysis tool          ***/
/*****************************************************************************/

#ifndef PSK_MATH_H
#define PSK_MATH_H
#include "psk_types.h"
/*****************************************************************************/
/**
* psk_mean
* calculate the arithmetic mean of a given vector
* @param vec Calculate the mean of the values in this vector
* @param len The vector's number of elements
* @return The aritmethic mean or zero, if len < 2
*/
psk_double psk_mean( psk_double* vec /*[in]*/, psk_uint32 len /*[in]*/);

/*****************************************************************************/
/**
* psk_cmpl_mean
* calculate the arithmetic mean of a given vector for both, real and
* imaginary parts. The result is also a complex number
* @param vec Calculate the mean of the values in this vector
* @param len The vector's number of elements
* @return The aritmethic mean or zero, if len < 2
*/
psk_complex psk_cmpl_mean( psk_complex* vec/*[in]*/, psk_uint32 len /*[in]*/);

/*****************************************************************************/
/**
* psk_diff
* The resulting vector's elements are the differences of two consecutive
* elements of a given vector. The resulting vector has a length of len-1
* @param vec Calculate the consecutive differences of this vector's values
* @param len The vector's number of elements
* @return The aritmethic mean or zero, if len < 2
*/
psk_double* psk_diff( psk_double* vec /*[in]*/, psk_uint32 len /*[in]*/);

/*****************************************************************************/
/**
* psk_max
* Find the maximal value in a vector and it's index
* @param vec An array of values
* @param vec_len The vector's number of elements
* @param max_val Pointer where to store the maximum's value
* @param max_idx Pointer where to store the maximum's index
*/
void psk_max( psk_double* vec,    /*[in]*/
psk_uint32 vec_len,  /*[in]*/
psk_double* max_val,  /*[out]*/
psk_uint32* max_idx ); /*[out]*/

/*****************************************************************************/
/**
* psk_min
* Find the minimal value in a vector and it's index
* @param vec An array of values
* @param vec_len The vector's number of elements
* @param min_val Pointer where to store the minimum's value
* @param min_idx Pointer where to store the minimum's index
*/
10 © ISO/IEC 2013 – All rights reserved

ISO/IEC 10373-6:2011/FDAM 5:2013(E)
void psk_min( psk_double* vec,    /*[in]*/
psk_uint32 vec_len,  /*[in]*/
psk_double* min_val,  /*[out]*/
psk_uint32* min_idx ); /*[out]*/

/*****************************************************************************/
/**
* psk_add
* Calculate the sum of two complex numbers
* @param a First summand
* @param b Second summand
* @return The complex result
*/
psk_complex psk_add( psk_complex a /*[in]*/, psk_complex b /*[in]*/ );

/*****************************************************************************/
/**
* psk_sub
* Calculate the difference of two complex numbers
* @param a Minuend
* @param b Subtrahend
* @return The complex result
*/
psk_complex psk_sub( psk_complex a /*[in]*/, psk_complex b /*[in]*/ );

/*****************************************************************************/
/**
* psk_cmpl_mult
* Calculate the product of two complex numbers
* @param a First factor
* @param b Second factor
* @return The complex result
*/
psk_complex psk_cmpl_mult( psk_complex a /*[in]*/, psk_complex b /*[in]*/ );

/*****************************************************************************/
/**
* psk_cmpl_div
* Calculate the quotient of two complex numbers
* @param a Dividend
* @param b Divisor
* @return The complex result
*/
psk_complex psk_cmpl_div( psk_complex a /*[in]*/, psk_complex b /*[in]*/ );

/*****************************************************************************/
/**
* psk_cmpl_conj
* Get the complex conjugate of a number
* @param a The complex number
* @return The complex conjugate of a
*/
psk_complex psk_cmpl_conj( psk_complex a /*[in]*/ );

/*****************************************************************************/
/**
* psk_abs
* Get the absolute value of a complex number: sqrt(RE^2+IM^2)
* @param num The complex number
* @return The absolute value
*/
psk_double psk_abs( psk_complex num /*[in]*/ );

/*****************************************************************************/
/**
* psk_cmpl_vec_mult
* Calculate the product of vector elements with the same index and return
* the result in a vector. This function makes use of #psk_cmpl_mult
* The two vectors must have the same length
* @param a Factors of first vector
* @param b Factros of second vector
* @param len The number of elments. Must be the same for a and b
© ISO/IEC 2013 – All rights reserved 11

ISO/IEC 10373-6:2011/FDAM 5:2013(E)
* @return The complex product of a and b
*/
psk_complex* psk_cmpl_vec_mult( psk_complex* a,  /*[in]*/
psk_complex* b,  /*[in]*/
psk_uint32 len ); /*[in]*/
/*****************************************************************************/
/**
* psk_vec_abs
* Apply #psk_abs on every complex element of a vector
* @param a The complex input values
* @param len The number of elements in vector a
* @return The absolute values
*/
psk_double* psk_vec_abs( psk_complex* a /*[in]*/, psk_uint32 len /*[in]*/ );

/*****************************************************************************/
/**
* psk_cmpl_vec_conj
* Apply #psk_cmpl_conj on every complex element of a vector
* @param vec The complex input values
* @param len The number of elements in vector vec
* @return The complex conjugate of vec
*/
psk_complex* psk_cmpl_vec_conj( psk_complex* vec, /*[in]*/
psk_uint32 len); /*[in]*/
/*****************************************************************************/
/**
* psk_vec_angle
* Apply the built in function atan2 on every complex element of a vector
* @param vec The complex input values
* @param len The number of elements in vector vec
* @return The angle of every input element
*/
psk_double* psk_vec_angle( psk_complex* vec /*[in]*/, psk_uint32 len /*[in]*/ );

/*****************************************************************************/
/**
* psk_variance
* Calculate the variance of the elements in a vector
* @param vec The real number input values
* @param len The number of elements in vector vec
* @return The variance of the vector's elements
*/
psk_double psk_variance( psk_double* vec /*[in]*/, psk_uint32 len /*[in]*/ );

/*****************************************************************************/
/**
* psk_std
* Calculate the standard deviation of the elements in a vector
* This function uses #psk_variance and returns it's square root
* @param vec The real number input values
* @param len The number of elements in vector vec
* @return The standard deviation of the vector's elements
*/
psk_double psk_std( psk_double* vec /*[in]*/, psk_uint32 len /*[in]*/ );

/*****************************************************************************/
/**
* psk_normalize
* Normalize a vector's elements. This function uses #psk_vec_abs and #psk_max
* @param vec The real number input values.
* @param len The number of elements in vector vec
* @return The normalized vector
*/
psk_double* psk_normalize( psk_double* vec, /*[in]*/
psk_uint32 len ); /*[in]*/
/*****************************************************************************/
12 © ISO/IEC 2013 – All rights reserved

ISO/IEC 10373-6:2011/FDAM 5:2013(E)
/**
* psk_cmpl_normalize
* Normalize a vector's complex elements both real and imaginary part separatly
* @param vec The complex number input values.
* @param len The number of elements in vector vec
* @return The normalized vector
*/
psk_complex* psk_cmpl_normalize( psk_complex* vec, /*[in]*/
psk_uint32 len ); /*[in]*/
/*****************************************************************************/
/**
* psk_linspace
* Build a vector with a given start and stop value and defined step size
* @param start The value of the first element
* @param step The step size. Difference between two consecutive elements
* @param stop The value of the last element
* @param len Pointer where to save the length of the vector
* @return The resulting vector or NULL, if start >= stop
*/
psk_double* psk_linspace( psk_double start, /*[in]*/
psk_double step,  /*[in]*/
psk_double stop,  /*[in]*/
psk_uint32* len ); /*[out]*/
/*****************************************************************************/
/**
* psk_idx_linspace
* Build a vector with a given start and stop value and defined step size.
* This function uses integer values, so the resulting vector can be used
* as a indexing vector for signals.
* @param start The value of the first element
* @param step The step size. Difference between two consecutive elements
* @param stop The value of the last element
* @param len Pointer where to save the length of the vector
* @return The resulting vector or NULL, if start >= stop
*/
psk_uint32* psk_idx_linspace( psk_uint32 start, /*[in]*/
psk_uint32 step,  /*[in]*/
psk_uint32 stop,  /*[in]*/
psk_uint32* len ); /*[out]*/
#endif //PSK_MATH_H
/*****************************************************************************/
/*** psk_math.c                              ***/
/*** DESCIRPTION: Implementation of psk_math.h              ***/
/*** Contains the function implementation of used mathematical functions ***/
/*** for the VHBR PSK wave shape analysis tool              ***/
/*****************************************************************************/

#include
#include
#include "psk_defines.h"
#include "psk_types.h"
#include "psk_math.h"
//-----------------------------------------------------------------------------
psk_double psk_mean( psk_double* vec, psk_uint32 len )
{
psk_double sum = 0.0;
psk_uint32 idx;
if( len < 2 )
return sum;
for( idx = 0; idx < len; idx++ )
sum += vec[idx];
sum /= (double)len;
© ISO/IEC 2013 – All rights reserved 13

ISO/IEC 10373-6:2011/FDAM 5:2013(E)

return( sum );
}
//-----------------------------------------------------------------------------
psk_complex psk_cmpl_mean( psk_complex* vec, psk_uint32 len )
{
psk_complex mean;
RE( mean ) = 0.0;
IM( mean ) = 0.0;
psk_uint32 idx;
if( len < 2 )
return mean;
for( idx = 0; idx < len; idx++ )
{
RE( mean ) += RE( vec[idx] );
IM( mean ) += IM( vec[idx] );
}
RE( mean ) /= (double)len;
IM( mean ) /= (double)len;
return( mean );
}
//-----------------------------------------------------------------------------
psk_double* psk_diff( psk_double* vec , psk_uint32 len )
{
psk_double* diff = calloc( ( len - 1 ), sizeof(psk_double) );
psk_uint32 idx;
for( idx = 0; idx < ( len - 1 ); idx++ )
diff[idx] = vec[idx + 1] - vec[idx];

return( diff );
}
//-----------------------------------------------------------------------------
void psk_max( psk_double* vec,
psk_uint32 vec_len,
psk_double* max_val,
psk_uint32* max_idx )
{
if( vec == NULL )
return;
psk_uint32 idx;
*max_val = vec[0];
*max_idx = 0;
for( idx = 1; idx < vec_len; idx++ )
{
if( vec[idx] > *max_val )
{
*max_val = vec[idx];
*max_idx = idx;
}
}
}
//-----------------------------------------------------------------------------
void psk_min( psk_double* vec,
psk_uint32 vec_len,
psk_double* min_val,
psk_uint32* min_idx )
{
psk_uint32 idx;
*min_val = vec[0];
*min_idx = 0;
for( idx = 1; idx < vec_len; idx++ )
{
if( vec[idx] < *min_val )
{
*min_val = vec[idx];
14 © ISO/IEC 2013 – All rights reserved

ISO/IEC 10373-6:2011/FDAM 5:2013(E)
*min_idx = idx;
}
}
}
//-----------------------------------------------------------------------------
psk_complex psk_add( psk_complex a, psk_complex b )
{
psk_complex sum;
RE( sum ) = RE( a ) + RE( b );
IM( sum ) = IM( a ) + IM( b );

return( sum );
}
//-----------------------------------------------------------------------------
psk_complex psk_sub( psk_complex a, psk_complex b )
{
psk_complex diff;
RE( diff ) = RE( a ) - RE( b );
IM( diff ) = IM( a ) - IM( b );

return( diff );
}
//-----------------------------------------------------------------------------
psk_complex psk_cmpl_mult( psk_complex a, psk_complex b )
{
psk_complex prod;
RE( prod ) = RE( a ) * RE( b ) - IM( a ) * IM( b );
IM( prod ) = IM( a ) * RE( b ) + RE( a ) * IM( b );

return( prod );
}
//-----------------------------------------------------------------------------
psk_complex psk_cmpl_div( psk_complex a, psk_complex b )
{
psk_complex quot;
RE( quot ) = RE( a ) * RE( b ) + IM( a ) * IM( b );
RE( quot ) = RE( quot ) / ( RE( b ) * RE( b ) + IM( b ) * IM( b ) );

IM( quot ) = IM( a ) * RE( b ) - RE( a ) * IM( b );
IM( quot ) = IM( quot ) / ( RE( b ) * RE( b ) + IM( b ) * IM( b ) );
return( quot );
}
//-----------------------------------------------------------------------------
psk_complex psk_cmpl_conj( psk_complex a )
{
psk_complex conj;
RE( conj ) = RE( a );
IM( conj ) = -IM( a );
return( conj );
}
//-----------------------------------------------------------------------------
psk_double psk_abs( psk_complex num )
{
return( sqrt( pow( RE( num ), 2 ) + pow( IM( num ), 2 ) ) );
}
//-----------------------------------------------------------------------------
psk_complex* psk_cmpl_vec_mult( psk_complex* a,
psk_complex* b,
psk_uint32 len )
{
psk_complex *prod_vec = calloc( len, sizeof(psk_complex) );
psk_uint32 idx;
for( idx = 0; idx < len; idx++ )
prod_vec[idx] = psk_cmpl_mult( a[idx], b[idx] );

return( prod_vec );
}
© ISO/IEC 2013 – All rights reserved 15

ISO/IEC 10373-6:2011/FDAM 5:2013(E)

//-----------------------------------------------------------------------------
psk_double* psk_vec_abs( psk_complex* a, psk_uint32 len )
{
psk_double *abs_vec = calloc( len, sizeof(psk_complex) );
psk_uint32 idx;
for( idx = 0; idx < len; idx++ )
abs_vec[idx] = psk_abs( a[idx] );

return( abs_vec );
}
//-----------------------------------------------------------------------------
psk_complex* psk_cmpl_vec_conj( psk_complex* vec, psk_uint32 len )
{
psk_complex *conj_vec = calloc( len, sizeof(psk_complex) );
psk_uint32 idx;
for( idx = 0; idx < len; idx++ )
conj_vec[idx] = psk_cmpl_conj( vec[idx] );

return( conj_vec );
}
//-----------------------------------------------------------------------------
psk_double* psk_vec_angle( psk_complex* vec, psk_uint32 len)
{
psk_double *angle_vec = calloc( len, sizeof(psk_complex) );
psk_uint32 idx;
for( idx = 0; idx < len; idx++ )
angle_vec[idx] = atan2( IM( vec[idx] ), RE( vec[idx] ) );

return( angle_vec );
}
//-----------------------------------------------------------------------------
psk_double psk_variance( psk_double* vec, psk_uint32 len )
{
psk_double variance = 0.0;
psk_double mean = psk_mean( vec, len );
psk_uint32 idx;
for( idx = 0; idx < len; idx++ )
variance += pow( vec[idx] - mean, 2.0 );
variance /= (double)len;
return( variance );
}
//-----------------------------------------------------------------------------
psk_double psk_std( psk_double* vec, psk_uint32 len )
{
psk_double std_deviation = 0.0;
std_deviation = psk_variance( vec, len );
return( sqrt( std_deviation ) );
}
//-----------------------------------------------------------------------------
psk_double* psk_normalize( psk_double* vec, psk_uint32 len )
{
psk_double max_val = ABS( vec[0] );
psk_double* norm_vec = calloc( len, sizeof(psk_double) );
psk_uint32 idx;
for( idx = 0; idx < len; idx++ )
{
if ( ABS( vec[idx] ) > max_val )
max_val = ABS( vec[idx] );
}
for( idx = 0; idx < len; idx++ )
norm_vec[idx] = vec[idx] / max_val;

return( norm_vec );
16 © ISO/IEC 2013 – All rights reserved

ISO/IEC 10373-6:2011/FDAM 5:2013(E)
}
//-----------------------------------------------------------------------------
psk_complex* psk_cmpl_normalize( psk_complex* vec, psk_uint32 len )
{
psk_double max_abs = psk_abs( vec[0] );
psk_complex* norm_vec = calloc( len, sizeof(psk_complex) );
psk_uint32 idx;
psk_double tmp = 0.0;
// find absolute maxima
for( idx = 1; idx < len; idx++ )
{
tmp = psk_abs( vec[idx] );
if( tmp > max_abs )
max_abs = tmp;
}
// normalize
for( idx = 0; idx < len; idx++ )
{
RE( norm_vec[idx] ) = RE( vec[idx] ) / max_abs;
IM( norm_vec[idx] ) = IM( vec[idx] ) / max_abs;
}
return( norm_vec );
}
//-----------------------------------------------------------------------------
psk_double* psk_linspace( psk_double start,
psk_double step,
psk_double stop,
psk_uint32* len )
{
*len = ABS( ( (stop - start ) / step ) ) + 1.0;
if( *len < 2 )
return( NULL );
psk_double* out = calloc( *len, sizeof(psk_double) );
psk_uint32 idx = 0;
out[idx] = start;
for( idx = 1; idx < *len; idx++ )
out[idx] = out[idx - 1] + step;

return( out );
}
//-----------------------------------------------------------------------------
psk_uint32* psk_idx_linspace( psk_uint32 start,
psk_uint32 step,
psk_uint32 stop,
psk_uint32* len )
{
if( start >= stop || step == 0 )
return( NULL );
*len = ( ( ( (psk_double)stop - (psk_double)start ) /
(psk_double)step ) + 1.0 );
psk_uint32 *out = calloc( *len, sizeof(psk_uint32) );
psk_uint32 idx = 0;
out[idx] = start;
for( idx = 1; idx < *len; idx++ )
out[idx] = out[idx - 1] + step;

return( out );
}
/*****************************************************************************/
/*** psk_dsp.h                               ***/
/*** DESCIRPTION: header of psk_dsp.c                   ***/
/***  Collection of functions used for dsp in the PSK waveform      ***/
/*** characteristics analysis tool.                    ***/
/*****************************************************************************/

© ISO/IEC 2013 – All rights reserved 17

ISO/IEC 10373-6:2011/FDAM 5:2013(E)
#ifndef PSK_DSP_H
#define PSK_DSP_H
#include "psk_types.h"
#include "psk_math.h"
/*****************************************************************************/
/**
* psk_compute_butter_lp_coef
* Computes the low-pass filter coefficients of a 4th order Butterworth
* IIR filter with a cut-off frequency of 120MHz
* @param sample_rate Sampling rate
* @return Struct with the b and a polynom coefficients
*/
psk_butter_coefs psk_compute_butter_lp_coef( psk_double sample_rate /*[in]*/);

/*****************************************************************************/
/**
* psk_antialiasing filter
* Filters the signal with a 4th order IIR filter. This function makes use of
* #psk_compute_butter_lp_coef to get the filter coefficients.
* @param v_in Input signal amplitude
* @param len_in Length of v_in
* @param v_out_ptr This pointer will be set to the array containing the
*     output signal.
* @param len_out Length of the output signal
* @param sample_rate Sampling rate of the input signal
* @return error value as defined in psk_defines.h
*/
psk_int32 psk_antialiasing( psk_double* v_in,     /*[in]*/
psk_uint32 len_in,    /*[in]*/
psk_double** v_out_ptr,  /*[out]*/
psk_uint32* len_out,   /*[out]*/
psk_double sample_rate ); /*[in]*/

/*****************************************************************************/
/**
* psk_downsample
* resamples input signal to internal sampling rate (FS_INT)
* defined in "psk_defines.h" using linear interpolation
* @param samples_in Array of amplitude values
* @param time_in Array of time values
* @param len_in Length of samples_in and time_in
* @param samples_out_ptr Pointer to output array of amplitudes
* @param time_out_ptr Pointer to output array
...

Questions, Comments and Discussion

Ask us and Technical Secretary will try to provide an answer. You can facilitate discussion about the standard in here.

Loading comments...