NEW YORK — The right people at the right time in the right location.

That phrase — repeated over and over in a secret recording of a police supervisor — is at the crux of a civil rights challenge to the New York Police Department's contentious tactic known as stop, question and frisk.

"So, who are the right people?" asks officer Pedro Serrano, during an argument with his supervisor about how to make a legal stop.

"Depends where you are," replies Deputy Inspector Christopher McCormack.

The recording was played during Serrano's testimony last week at a federal trial that's providing a window into the workings of the nation's largest police force, the instincts officers rely on to do their jobs and the difficulty police supervisors have in translating written policies into practice on the street.

Serrano works patrol in the 40th Precinct in the Bronx, among the more crime-ridden in the city. Robberies there rose from 397 in 2011 to 478 in 2012, and grand larcenies rose from 412 to 469.

Serrano said his supervisors believed he tallied too few arrests, summonses and stop, question and frisk reports, known as "250s." When he appealed his annual evaluation earlier this year, Serrano decided to use his phone to record his boss.

The ongoing trial is creating an uncomfortable spotlight for a department more accustomed to bragging about its crime-fighting prowess and a drop in crime to levels not seen since the 1960s. Several top brass are expected to testify in the coming weeks, including Chief of Department Joseph Esposito and Paul Browne, the deputy commissioner for public information and a close adviser to Commissioner Raymond Kelly.

Mayor Michael Bloomberg and Kelly have hailed "stop and frisk" as a program that has deterred crime and saved lives by taking weapons off of would-be killers and by making crooks reconsider carrying weapons in the first place.

But the trial has exposed how in practice, the tactic creates often messy and difficult encounters between police and the public. So far, men have testified that they were stopped and frisked by officers as they went about their lives — getting milk at a store, walking home, going to a party. The men say they were doing nothing wrong and felt victimized by overzealous officers.